[cmucl-commit] CMUCL commit: src/lisp (Darwin-os.c)

Raymond Toy rtoy at common-lisp.net
Sat Sep 3 06:46:35 CEST 2011


    Date: Friday, September 2, 2011 @ 21:46:35
  Author: rtoy
    Path: /project/cmucl/cvsroot/src/lisp

Modified: Darwin-os.c

Cleanup sigbus handler for stack overflow.

We don't need sigbus_handler_tramp; sigbus_handle_now is good enough.
Print out the PC too when we get a real sigbus.


-------------+
 Darwin-os.c |   32 +++-----------------------------
 1 file changed, 3 insertions(+), 29 deletions(-)


Index: src/lisp/Darwin-os.c
diff -u src/lisp/Darwin-os.c:1.34 src/lisp/Darwin-os.c:1.35
--- src/lisp/Darwin-os.c:1.34	Thu Sep  1 09:16:49 2011
+++ src/lisp/Darwin-os.c	Fri Sep  2 21:46:34 2011
@@ -14,7 +14,7 @@
  * Frobbed for OpenBSD by Pierre R. Mai, 2001.
  * Frobbed for Darwin by Pierre R. Mai, 2003.
  *
- * $Header: /project/cmucl/cvsroot/src/lisp/Darwin-os.c,v 1.34 2011/09/01 16:16:49 rtoy Exp $
+ * $Header: /project/cmucl/cvsroot/src/lisp/Darwin-os.c,v 1.35 2011/09/03 04:46:34 rtoy Exp $
  *
  */
 
@@ -462,18 +462,6 @@
     interrupt_handle_now(signal, code, context);
 }
 
-
-static int tramp_signal;
-static siginfo_t tramp_code;
-static ucontext_t tramp_context;
-
-static void
-sigbus_handler_tramp(void)
-{
-  sigbus_handle_now(tramp_signal, &tramp_code, &tramp_context);
-}
-
-
 static void
 sigbus_handler(HANDLER_ARGS)
 {
@@ -508,24 +496,10 @@
     if (interrupt_maybe_gc(signal, code, context))
 	return;
 #endif
-#ifdef RED_ZONE_HIT
-    {
-        /*
-         * Switch back to the normal stack and invoke the Lisp signal
-         * handler there.  Global variables are used to pass the
-         * context * to the other stack.
-         */
-      
-	tramp_signal = signal;
-	tramp_code = *code;
-	tramp_context = *context;
-	SC_PC(context) = sigbus_handler_tramp;
-	return;
-    }
-#endif
 
     /* a *real* protection fault */
-    fprintf(stderr, "sigbus_handler: Real protection violation: %p\n", fault_addr);
+    fprintf(stderr, "sigbus_handler: Real protection violation at %p, PC = %p\n",
+            fault_addr, SC_PC(context));
     sigbus_handle_now(signal, code, context);
 #ifdef __ppc__
     /* Work around G5 bug; fix courtesy gbyers via chandler */


More information about the cmucl-commit mailing list