Skip to content

Commit 81e6bef

Browse files
[GR-67214] Use SetUnhandledExceptionFilter on Windows.
PullRequest: graal/21542
2 parents c11dd2e + 96dc6fa commit 81e6bef

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

substratevm/src/com.oracle.svm.core.windows/src/com/oracle/svm/core/windows/WindowsSubstrateSegfaultHandler.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ public void install() {
7373
if (ErrHandlingAPI.AddVectoredContinueHandler(0, HANDLER_LITERAL.getFunctionPointer()).isNull()) {
7474
VMError.shouldNotReachHere("SubstrateSegfaultHandler installation failed.");
7575
}
76+
/* Install secondary signal handler. */
77+
ErrHandlingAPI.SetUnhandledExceptionFilter(HANDLER_LITERAL.getFunctionPointer());
7678
}
7779

7880
private static final CEntryPointLiteral<CFunctionPointer> HANDLER_LITERAL = CEntryPointLiteral.create(WindowsSubstrateSegfaultHandler.class, "handler", ErrHandlingAPI.EXCEPTION_POINTERS.class);

substratevm/src/com.oracle.svm.core.windows/src/com/oracle/svm/core/windows/headers/ErrHandlingAPI.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ public class ErrHandlingAPI {
5151
@CFunction(transition = NO_TRANSITION)
5252
public static native PointerBase AddVectoredContinueHandler(int first, CFunctionPointer handler);
5353

54+
@CFunction(transition = NO_TRANSITION)
55+
public static native CFunctionPointer SetUnhandledExceptionFilter(CFunctionPointer handler);
56+
5457
@CConstant
5558
public static native int EXCEPTION_CONTINUE_SEARCH();
5659

0 commit comments

Comments
 (0)