KHB: Failure-oblivious computing
Posted Jun 29, 2006 18:09 UTC (Thu) by
cventers (subscriber, #31465)
In reply to:
KHB: Failure-oblivious computing by cventers
Parent article:
KHB: Failure-oblivious computing
I apologize to the readers and editors about the volume of my comments
replying to myself, but I think we need a longjmp() that is safe to use
as an exit from a signal handler. Then my above code could be:
int handle (int sig)
{
struct jmp_buf buf;
if (sig == SIGSEGV) {
if (fork() == 0) raise(SIGABRT);
pop_jmp_buf_from_tls_stack(&buf);
longjmp_after_sig(&buf, sig);
}
}
...then strategically place:
// Prepare an exception context
if (save_context_in_tls_stack() == SIGSEGV) {
// operation failed
}
do_something_possibly_unsafe();
// Forget about that context
pop_jmp_buf_from_tls_stack(NULL);
Comments?
(
Log in to post comments)