Index: libcfa/src/interpose.cfa
===================================================================
--- libcfa/src/interpose.cfa	(revision 804c0ffe17f5af207b13b438b9c8bedaa3ab224a)
+++ libcfa/src/interpose.cfa	(revision 92bfda038b786d60ca776b71dd68b3dc8f69b94d)
@@ -125,12 +125,17 @@
 
 		// Failure handler
-		__cfaabi_sigaction( SIGSEGV, sigHandler_segv, SA_SIGINFO | SA_ONSTACK );
-		__cfaabi_sigaction( SIGBUS , sigHandler_segv, SA_SIGINFO | SA_ONSTACK );
-		__cfaabi_sigaction( SIGILL , sigHandler_ill , SA_SIGINFO | SA_ONSTACK );
-		__cfaabi_sigaction( SIGFPE , sigHandler_fpe , SA_SIGINFO | SA_ONSTACK );
-		__cfaabi_sigaction( SIGTERM, sigHandler_term, SA_SIGINFO | SA_ONSTACK | SA_RESETHAND ); // one shot handler, return to default
-		__cfaabi_sigaction( SIGINT , sigHandler_term, SA_SIGINFO | SA_ONSTACK | SA_RESETHAND );
-		__cfaabi_sigaction( SIGABRT, sigHandler_term, SA_SIGINFO | SA_ONSTACK | SA_RESETHAND );
-		__cfaabi_sigaction( SIGHUP , sigHandler_term, SA_SIGINFO | SA_ONSTACK | SA_RESETHAND ); // terminal hangup
+		 // internal errors
+		__cfaabi_sigaction( SIGSEGV, sigHandler_segv, SA_SIGINFO | SA_ONSTACK ); // Invalid memory reference (default: Core)
+		__cfaabi_sigaction( SIGBUS , sigHandler_segv, SA_SIGINFO | SA_ONSTACK ); // Bus error, bad memory access (default: Core)
+		__cfaabi_sigaction( SIGILL , sigHandler_ill , SA_SIGINFO | SA_ONSTACK ); // Illegal Instruction (default: Core)
+		__cfaabi_sigaction( SIGFPE , sigHandler_fpe , SA_SIGINFO | SA_ONSTACK ); // Floating-point exception (default: Core)
+
+ 		// handlers to outside errors
+		// reset in-case they insist and send it over and over
+		__cfaabi_sigaction( SIGTERM, sigHandler_term, SA_SIGINFO | SA_ONSTACK | SA_RESETHAND ); // Termination signal (default: Term)
+		__cfaabi_sigaction( SIGINT , sigHandler_term, SA_SIGINFO | SA_ONSTACK | SA_RESETHAND ); // Interrupt from keyboard (default: Term)
+		__cfaabi_sigaction( SIGHUP , sigHandler_term, SA_SIGINFO | SA_ONSTACK | SA_RESETHAND ); // Hangup detected on controlling terminal or death of controlling process (default: Term)
+		__cfaabi_sigaction( SIGQUIT, sigHandler_term, SA_SIGINFO | SA_ONSTACK | SA_RESETHAND ); // Quit from keyboard (default: Core)
+		__cfaabi_sigaction( SIGABRT, sigHandler_term, SA_SIGINFO | SA_ONSTACK | SA_RESETHAND ); // Abort signal from abort(3) (default: Core)
 	}
 }
@@ -163,8 +168,8 @@
 }
 
-void * kernel_abort( void ) __attribute__(( __nothrow__, __leaf__, __weak__ )) { return 0p; }
-void kernel_abort_msg( void * data, char buffer[], int size ) __attribute__(( __nothrow__, __leaf__, __weak__ )) {}
-// See concurrency/kernel.cfa for strong definition used in multi-processor mode.
-int kernel_abort_lastframe( void ) __attribute__(( __nothrow__, __leaf__, __weak__ )) { return 4; }
+// See concurrency/kernel.cfa and concurrency/preemption.cfa for strong definition used in multi-processor mode.
+void __kernel_abort_lock( void ) __attribute__(( __nothrow__, __leaf__, __weak__ )) {}
+void __kernel_abort_msg( char buffer[], int size ) __attribute__(( __nothrow__, __leaf__, __weak__ )) {}
+int __kernel_abort_lastframe( void ) __attribute__(( __nothrow__, __leaf__, __weak__ )) { return 4; }
 
 enum { abort_text_size = 1024 };
@@ -173,5 +178,5 @@
 static void __cfaabi_backtrace( int start ) {
 	enum { Frames = 50, };								// maximum number of stack frames
-	int last = kernel_abort_lastframe();				// skip last N stack frames
+	int last = __kernel_abort_lastframe();				// skip last N stack frames
 
 	void * array[Frames];
@@ -220,50 +225,44 @@
 }
 
-static volatile int __abort_stage = 0;
+static volatile bool __abort_first = 0;
 
 // Cannot forward va_list.
 void __abort( bool signalAbort, const char fmt[], va_list args ) {
-	int stage = __atomic_add_fetch( &__abort_stage, 1, __ATOMIC_SEQ_CST );
-
-	// First stage: stop the cforall kernel and print
-	if(stage == 1) {
-		// increment stage
-		stage = __atomic_add_fetch( &__abort_stage, 1, __ATOMIC_SEQ_CST );
-
-		// must be done here to lock down kernel
-		void * kernel_data = kernel_abort();
-		int len;
-
-		signal( SIGABRT, SIG_DFL );							// prevent final "real" abort from recursing to handler
-
-		len = snprintf( abort_text, abort_text_size, "Cforall Runtime error (UNIX pid:%ld) ", (long int)getpid() ); // use UNIX pid (versus getPid)
-		__cfaabi_bits_write( STDERR_FILENO, abort_text, len );
-
-		assert( fmt );
-		len = vsnprintf( abort_text, abort_text_size, fmt, args );
-		__cfaabi_bits_write( STDERR_FILENO, abort_text, len );
-
-		// add optional newline if missing at the end of the format text
-		if ( fmt[strlen( fmt ) - 1] != '\n' ) {
-			__cfaabi_bits_write( STDERR_FILENO, "\n", 1 );
-		} // if
-		kernel_abort_msg( kernel_data, abort_text, abort_text_size );
-	}
-
-	// Second stage: print the backtrace
-	if(stage == 2) {
-		// increment stage
-		stage = __atomic_add_fetch( &__abort_stage, 1, __ATOMIC_SEQ_CST );
-
-		// print stack trace in handler
-		__cfaabi_backtrace( signalAbort ? 4 : 2 );
-	}
-
-	do {
-		// Finally call abort
+	// Multiple threads can come here from multiple paths
+	// To make sure this is safe any concurrent/subsequent call to abort is redirected to libc-abort
+	bool first = ! __atomic_test_and_set( &__abort_first, __ATOMIC_SEQ_CST);
+
+	// Prevent preemption from kicking-in and messing with the abort
+	__kernel_abort_lock();
+
+	// first to abort ?
+	if ( !first ) {
+		// We aren't the first to abort just let C handle it
+		signal( SIGABRT, SIG_DFL );	// restore default in case we came here through the function.
 		__cabi_libc.abort();
-
-		// Loop so that we never return
-	} while(true);
+	}
+
+	int len = snprintf( abort_text, abort_text_size, "Cforall Runtime error (UNIX pid:%ld) ", (long int)getpid() ); // use UNIX pid (versus getPid)
+	__cfaabi_bits_write( STDERR_FILENO, abort_text, len );
+
+	// print the cause of the error
+	assert( fmt );
+	len = vsnprintf( abort_text, abort_text_size, fmt, args );
+	__cfaabi_bits_write( STDERR_FILENO, abort_text, len );
+
+	// add optional newline if missing at the end of the format text
+	if ( fmt[strlen( fmt ) - 1] != '\n' ) {
+		__cfaabi_bits_write( STDERR_FILENO, "\n", 1 );
+	} // if
+
+	// Give the kernel the chance to add some data in here
+	__kernel_abort_msg( abort_text, abort_text_size );
+
+	// print stack trace in handler
+	__cfaabi_backtrace( signalAbort ? 4 : 2 );
+
+	// Finally call abort
+	__cabi_libc.abort();
+
 }
 
@@ -282,10 +281,4 @@
     // CONTROL NEVER REACHES HERE!
     va_end( args );
-}
-
-extern "C" {
-	void __cfaabi_real_abort(void) {
-		__cabi_libc.abort();
-	}
 }
 
