Revision
22967
Author
zarzycki@apple.com
Date
2006-12-04 09:44:33 -0800 (Mon, 04 Dec 2006)

Log Message

It is probably, just probably, a good idea for the setjmp() to have a valid stack frame when returned to via longjmp(). :-P

Modified Paths

Diff

Modified: trunk/launchd/src/launchd.c (22966 => 22967)


--- trunk/launchd/src/launchd.c	2006-12-04 17:34:49 UTC (rev 22966)
+++ trunk/launchd/src/launchd.c	2006-12-04 17:44:33 UTC (rev 22967)
@@ -294,6 +294,21 @@
 		job_dispatch(fbj, true);
 	}
 
+	switch (setjmp(doom_doom_doom)) {
+		case SIGILL:
+		case SIGFPE:
+			syslog(LOG_EMERG, "We crashed at instruction: %p", crash_addr);
+			abort();
+		case SIGBUS:
+		case SIGSEGV:
+			syslog(LOG_EMERG, "We crashed trying to read/write: %p", crash_addr);
+			abort();
+		default:
+			abort();
+		case 0:
+			break;
+	}
+
 	if (getpid() == 1) {
 		handle_pid1_crashes_separately();
 
@@ -310,21 +325,6 @@
 {
 	struct sigaction fsa;
 
-	switch (setjmp(doom_doom_doom)) {
-		case SIGILL:
-		case SIGFPE:
-			syslog(LOG_EMERG, "We crashed at instruction: %p", crash_addr);
-			abort();
-		case SIGBUS:
-		case SIGSEGV:
-			syslog(LOG_EMERG, "We crashed trying to read/write: %p", crash_addr);
-			abort();
-		default:
-			abort();
-		case 0:
-			break;
-	}
-
 	fsa.sa_sigaction = fatal_signal_handler;
 	fsa.sa_flags = SA_SIGINFO;
 	sigemptyset(&fsa.sa_mask);