-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow fatal SBCL errors to be caught #54
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a first pass. I didn't try to understand what it is doing.
8d3f788
to
30991ab
Compare
656f7a8
to
c096346
Compare
c096346
to
551dae5
Compare
ff80900
to
bda3d3c
Compare
12567c1
to
6f4ba4d
Compare
6f4ba4d
to
0381264
Compare
ba8ed32
to
757be44
Compare
744a0bb
to
9a23881
Compare
c6eab0c
to
0c46ced
Compare
This pr should gracefully handle calling into lisp after a fatal error. Doing so should repeat the fatal error behavior. |
0c46ced
to
de02256
Compare
cd9c18e
to
4981dcb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Problem
A call into Lisp may trigger a fatal error in SBCL, dropping the process unceremoniously into LDB and making it difficult for the user to gracefully terminate the process.
Solution
Use
setjmp
to save the execution context before calling into Lisp, and uselongjmp
to return to the pre-call execution context with a special error code if a fatal SBCL error was encountered.Notes
This feature requires patching SBCL to make thelossage_handler
function pointer non-static, settingsbcl-librarian::*non-static-lossage-handler*
toT
, and adding afatal-error
code to the error map.set_lossage_handler
exists and is exported by the runtimeDEFINE-ERROR-TYPE
takes a newfatal-error
argument specifying which value to return when a Lisp call triggers a fatal SBCL error.setjmp
before calling into Lisp through the associated function pointer.error-map
or nofatal-code
is specified, then the fatal error handler just drops into LDB.