X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Finterrupt.c;h=2be4af4b639148e0fa7d460ddedbf28b92a83fad;hb=85483d976cc2d779493985f77f39efefb2ea622b;hp=6601a950e3a908d4bdab5adb545d7d12d85a6fd9;hpb=be7adb92bf0012ab07adac2943e73772dfad7911;p=sbcl.git diff --git a/src/runtime/interrupt.c b/src/runtime/interrupt.c index 6601a95..2be4af4 100644 --- a/src/runtime/interrupt.c +++ b/src/runtime/interrupt.c @@ -150,18 +150,17 @@ union interrupt_handler interrupt_handlers[NSIG]; * mask ought to be clear anyway most of the time, but may be non-zero * if we were interrupted e.g. while waiting for a queue. */ -void reset_signal_mask () +void reset_signal_mask(void) { sigset_t new; sigemptyset(&new); thread_sigmask(SIG_SETMASK,&new,0); } -void block_blockable_signals () +void block_blockable_signals(void) { sigset_t block; - sigemptyset(&block); - sigaddset_blockable(&block); + sigcopyset(&block, &blockable_sigset); thread_sigmask(SIG_BLOCK, &block, 0); } @@ -170,7 +169,7 @@ void block_blockable_signals () * utility routines used by various signal handlers */ -void +static void build_fake_control_stack_frames(struct thread *th,os_context_t *context) { #ifndef LISP_FEATURE_C_STACK_IS_CONTROL_STACK @@ -301,33 +300,31 @@ interrupt_internal_error(int signal, siginfo_t *info, os_context_t *context, { lispobj context_sap = 0; - check_blockables_blocked_or_lose(); fake_foreign_function_call(context); + if (!internal_errors_enabled) { + describe_internal_error(context); + /* There's no good way to recover from an internal error + * before the Lisp error handling mechanism is set up. */ + lose("internal error too early in init, can't recover"); + } + /* Allocate the SAP object while the interrupts are still * disabled. */ - if (internal_errors_enabled) { - context_sap = alloc_sap(context); - } + context_sap = alloc_sap(context); thread_sigmask(SIG_SETMASK, os_context_sigmask_addr(context), 0); - if (internal_errors_enabled) { - SHOW("in interrupt_internal_error"); + SHOW("in interrupt_internal_error"); #ifdef QSHOW - /* Display some rudimentary debugging information about the - * error, so that even if the Lisp error handler gets badly - * confused, we have a chance to determine what's going on. */ - describe_internal_error(context); + /* Display some rudimentary debugging information about the + * error, so that even if the Lisp error handler gets badly + * confused, we have a chance to determine what's going on. */ + describe_internal_error(context); #endif - funcall2(SymbolFunction(INTERNAL_ERROR), context_sap, - continuable ? T : NIL); - } else { - describe_internal_error(context); - /* There's no good way to recover from an internal error - * before the Lisp error handling mechanism is set up. */ - lose("internal error too early in init, can't recover"); - } + funcall2(SymbolFunction(INTERNAL_ERROR), context_sap, + continuable ? T : NIL); + undo_fake_foreign_function_call(context); /* blocks signals again */ if (continuable) { arch_skip_instruction(context); @@ -678,8 +675,7 @@ sig_stop_for_gc_handler(int signal, siginfo_t *info, void *void_context) /* need the context stored so it can have registers scavenged */ fake_foreign_function_call(context); - sigemptyset(&ss); - for(i=1;i