Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,7 @@ endif
ifeq ($(OS), WINNT)
HAVE_SSP := 1
OSLIBS += -Wl,--export-all-symbols -Wl,--version-script=$(JULIAHOME)/src/julia.expmap \
$(NO_WHOLE_ARCHIVE) -lpsapi -lkernel32 -lws2_32 -liphlpapi -lwinmm -ldbghelp -luserenv -lsecur32 -latomic
$(NO_WHOLE_ARCHIVE) -lpsapi -lkernel32 -lws2_32 -liphlpapi -lwinmm -ldbghelp -luserenv -lsecur32 -latomic -lshell32 -lole32 -luuid
JLDFLAGS += -Wl,--stack,8388608
ifeq ($(ARCH),i686)
JLDFLAGS += -Wl,--large-address-aware
Expand Down
22 changes: 17 additions & 5 deletions src/signals-win.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,19 @@ LONG WINAPI jl_exception_handler(struct _EXCEPTION_POINTERS *ExceptionInfo)
break;
}
}
static int thread0_exit_count = 0;
SetUnhandledExceptionFilter(NULL);
thread0_exit_count++;
uv_tty_reset_mode();
fflush(NULL);

if (thread0_exit_count > 1) {
// This should not return
RaiseFailFastException(ExceptionInfo->ExceptionRecord, ExceptionInfo->ContextRecord, 0);
jl_safe_printf("Unexpected return from RaiseFailFastException()!\n");
return EXCEPTION_CONTINUE_SEARCH;
}

if (ExceptionInfo->ExceptionRecord->ExceptionCode == EXCEPTION_ILLEGAL_INSTRUCTION) {
jl_safe_printf("\n");
jl_show_sigill(ExceptionInfo->ContextRecord);
Expand Down Expand Up @@ -330,11 +343,10 @@ LONG WINAPI jl_exception_handler(struct _EXCEPTION_POINTERS *ExceptionInfo)
jl_print_native_codeloc((uintptr_t)ExceptionInfo->ExceptionRecord->ExceptionAddress);

jl_critical_error(0, 0, ExceptionInfo->ContextRecord, ct);
static int recursion = 0;
if (recursion++)
exit(1);
else
jl_exit(1);
jl_atexit_hook(128);
RaiseFailFastException(ExceptionInfo->ExceptionRecord, ExceptionInfo->ContextRecord, 0);
jl_safe_printf("Unexpected return from RaiseFailFastException()!\n");
return EXCEPTION_CONTINUE_SEARCH;
}

JL_DLLEXPORT void jl_install_sigint_handler(void)
Expand Down