From b664ae3cc44a23e6ab6cc4d8cf91a9a196e7add9 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Wed, 26 Aug 2020 09:59:51 -0400 Subject: [PATCH] win64,stackwalk: remove support for binaries missing SEH info This hack, added in 7e95d0911110e6d4fdfb5c9e96cd5957ad27d259, was a workaround for LLVM3.3 not being able to generate binaries with the mandatory SEH section information. Now, it is just a potential source of segfaults in observation. --- src/stackwalk.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/stackwalk.c b/src/stackwalk.c index f3ab648fe7ad9..1edf772c1f75c 100644 --- a/src/stackwalk.c +++ b/src/stackwalk.c @@ -358,6 +358,7 @@ JL_DLLEXPORT jl_value_t *jl_get_excstack(jl_task_t* task, int include_bt, int ma } #if defined(_OS_WINDOWS_) +// XXX: these caches should be per-thread #ifdef _CPU_X86_64_ static UNWIND_HISTORY_TABLE HistoryTable; #else @@ -495,14 +496,9 @@ static int jl_unw_step(bt_cursor_t *cursor, uintptr_t *ip, uintptr_t *sp) PRUNTIME_FUNCTION FunctionEntry = (PRUNTIME_FUNCTION)JuliaFunctionTableAccess64( GetCurrentProcess(), cursor->Rip); - if (!FunctionEntry) { // assume this is a NO_FPO RBP-based function - cursor->Rsp = cursor->Rbp; // MOV RSP, RBP - if (!readable_pointer((LPCVOID)cursor->Rsp)) - return 0; - cursor->Rbp = *(DWORD64*)cursor->Rsp; // POP RBP - cursor->Rsp += sizeof(void*); - cursor->Rip = *(DWORD64*)cursor->Rsp; // POP RIP (aka RET) - cursor->Rsp += sizeof(void*); + if (!FunctionEntry) { + // Not code or bad unwind? + return 0; } else { PVOID HandlerData;