Skip to content

Commit

Permalink
win64,stackwalk: remove support for binaries missing SEH info
Browse files Browse the repository at this point in the history
This hack, added in 7e95d09, 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.
  • Loading branch information
vtjnash committed Aug 26, 2020
1 parent 0041d44 commit b664ae3
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/stackwalk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit b664ae3

Please sign in to comment.