-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
win64: use vectored exception handler only when necessary
Windows exceptions can originate in both software and hardware and can be handled by vectored exception handlers and frame-based exception handlers. Vectored exception handlers are triggered first in a fashion similar to UNIX signal handlers. They are established globally for the SBCL process and catch exceptions signalled in any thread. Afterwards, frame-based exception handlers are searched starting in the current stack frame, continuing through to preceding frames until an applicable handler is found. SBCL's vectored exception handler was handling virtually all exceptions, with unknown exceptions yielding a Lisp error. This is problematic with FFI, since the handler would catch every exception, including those that would otherwise be gracefully handled within foreign code. (Notably, win32's open file dialog will raise and handle exceptions internally.) This commit restricts our vectored exception handler to EXCEPTION_ACCESS_VIOLATION and exceptions that are triggered by Lisp code. In the interest of interactive development and/or error logging, we need to do something about unhandled exceptions coming from foreign code which by default would cause the kernel to terminate our process. This is handled by a frame-based exception handler established by set_up_win64_seh_thunk() in coordination with EMIT-C-CALL, both of which contain comments explaining how the (somewhat convoluted) mechanism works.
- Loading branch information
Showing
9 changed files
with
614 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.