Skip to content

Commit b664ae3

Browse files
committed
win64,stackwalk: remove support for binaries missing SEH info
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.
1 parent 0041d44 commit b664ae3

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/stackwalk.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ JL_DLLEXPORT jl_value_t *jl_get_excstack(jl_task_t* task, int include_bt, int ma
358358
}
359359

360360
#if defined(_OS_WINDOWS_)
361+
// XXX: these caches should be per-thread
361362
#ifdef _CPU_X86_64_
362363
static UNWIND_HISTORY_TABLE HistoryTable;
363364
#else
@@ -495,14 +496,9 @@ static int jl_unw_step(bt_cursor_t *cursor, uintptr_t *ip, uintptr_t *sp)
495496

496497
PRUNTIME_FUNCTION FunctionEntry = (PRUNTIME_FUNCTION)JuliaFunctionTableAccess64(
497498
GetCurrentProcess(), cursor->Rip);
498-
if (!FunctionEntry) { // assume this is a NO_FPO RBP-based function
499-
cursor->Rsp = cursor->Rbp; // MOV RSP, RBP
500-
if (!readable_pointer((LPCVOID)cursor->Rsp))
501-
return 0;
502-
cursor->Rbp = *(DWORD64*)cursor->Rsp; // POP RBP
503-
cursor->Rsp += sizeof(void*);
504-
cursor->Rip = *(DWORD64*)cursor->Rsp; // POP RIP (aka RET)
505-
cursor->Rsp += sizeof(void*);
499+
if (!FunctionEntry) {
500+
// Not code or bad unwind?
501+
return 0;
506502
}
507503
else {
508504
PVOID HandlerData;

0 commit comments

Comments
 (0)