From 6d8482c379f67a00d63acd823ef351497a7bba4d Mon Sep 17 00:00:00 2001 From: Mike McLaughlin Date: Mon, 19 Aug 2019 17:11:24 -0700 Subject: arm64 out of proc unwind for DAC (#26156) Removed FEATURE_DATATARGET4 for arm64 Added SP check to createdump's native unwind loop to make it more robust. Issue: https://github.com/dotnet/coreclr/issues/15062 --- src/debug/createdump/threadinfo.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/debug') diff --git a/src/debug/createdump/threadinfo.cpp b/src/debug/createdump/threadinfo.cpp index f974b76677..02233c14dd 100644 --- a/src/debug/createdump/threadinfo.cpp +++ b/src/debug/createdump/threadinfo.cpp @@ -110,6 +110,8 @@ ReadMemoryAdapter(PVOID address, PVOID buffer, SIZE_T size) void ThreadInfo::UnwindNativeFrames(CrashInfo& crashInfo, CONTEXT* pContext) { + uint64_t previousSp = 0; + // For each native frame while (true) { @@ -117,9 +119,10 @@ ThreadInfo::UnwindNativeFrames(CrashInfo& crashInfo, CONTEXT* pContext) GetFrameLocation(pContext, &ip, &sp); TRACE("Unwind: sp %" PRIA PRIx64 " ip %" PRIA PRIx64 "\n", sp, ip); - if (ip == 0) { + if (ip == 0 || sp <= previousSp) { break; } + // Add two pages around the instruction pointer to the core dump crashInfo.InsertMemoryRegion(ip - PAGE_SIZE, PAGE_SIZE * 2); @@ -136,6 +139,7 @@ ThreadInfo::UnwindNativeFrames(CrashInfo& crashInfo, CONTEXT* pContext) TRACE("Unwind: PAL_VirtualUnwindOutOfProc returned false\n"); break; } + previousSp = sp; } } -- cgit v1.2.3