Index: libcfa/src/bits/locks.hfa
===================================================================
--- libcfa/src/bits/locks.hfa	(revision cb870e04a1fa8b52d7cbaa83d0b9a6ab245a2fd1)
+++ libcfa/src/bits/locks.hfa	(revision be91ab4b15c324cf50bb6e2b5831a7f08d33c07c)
@@ -112,4 +112,9 @@
 	#endif
 
+	extern "C" {
+		char * strerror(int);
+	}
+	#define CHECKED(x) { int err = x; if( err != 0 ) abort("KERNEL ERROR: %s\n", strerror(err)); }
+
 	struct __bin_sem_t {
 		pthread_mutex_t 	lock;
@@ -119,22 +124,27 @@
 
 	static inline void ?{}(__bin_sem_t & this) with( this ) {
-		pthread_mutex_init(&lock, NULL);
-		pthread_cond_init (&cond, NULL);
+		// Create the mutex with error checking
+		pthread_mutexattr_t mattr;
+		pthread_mutexattr_init( &mattr );
+		pthread_mutexattr_settype( &mattr, PTHREAD_MUTEX_ERRORCHECK_NP);
+		pthread_mutex_init(&lock, &mattr);
+
+		pthread_cond_init (&cond, 0p);
 		val = 0;
 	}
 
 	static inline void ^?{}(__bin_sem_t & this) with( this ) {
-		pthread_mutex_destroy(&lock);
-		pthread_cond_destroy (&cond);
+		CHECKED( pthread_mutex_destroy(&lock) );
+		CHECKED( pthread_cond_destroy (&cond) );
 	}
 
 	static inline void wait(__bin_sem_t & this) with( this ) {
 		verify(__cfaabi_dbg_in_kernel());
-		pthread_mutex_lock(&lock);
+		CHECKED( pthread_mutex_lock(&lock) );
 			while(val < 1) {
 				pthread_cond_wait(&cond, &lock);
 			}
 			val -= 1;
-		pthread_mutex_unlock(&lock);
+		CHECKED( pthread_mutex_unlock(&lock) );
 	}
 
@@ -142,5 +152,5 @@
 		bool needs_signal = false;
 
-		pthread_mutex_lock(&lock);
+		CHECKED( pthread_mutex_lock(&lock) );
 			if(val < 1) {
 				val += 1;
@@ -148,7 +158,9 @@
 				needs_signal = true;
 			}
-		pthread_mutex_unlock(&lock);
+		CHECKED( pthread_mutex_unlock(&lock) );
 
 		return needs_signal;
 	}
+
+	#undef CHECKED
 #endif
Index: libcfa/src/concurrency/io.cfa
===================================================================
--- libcfa/src/concurrency/io.cfa	(revision cb870e04a1fa8b52d7cbaa83d0b9a6ab245a2fd1)
+++ libcfa/src/concurrency/io.cfa	(revision be91ab4b15c324cf50bb6e2b5831a7f08d33c07c)
@@ -1007,10 +1007,12 @@
 bool has_user_level_blocking( fptr_t func ) {
 	#if defined(HAVE_LINUX_IO_URING_H)
-		if( /*func == (fptr_t)preadv2 || */
-			func == (fptr_t)cfa_preadv2 )
-			#define _CFA_IO_FEATURE_IORING_OP_READV ,
-			return IS_DEFINED(IORING_OP_READV);
-
 		#if defined(HAVE_PREADV2)
+			if( /*func == (fptr_t)preadv2 || */
+				func == (fptr_t)cfa_preadv2 )
+				#define _CFA_IO_FEATURE_IORING_OP_READV ,
+				return IS_DEFINED(IORING_OP_READV);
+		#endif
+
+		#if defined(HAVE_PWRITEV2)
 			if( /*func == (fptr_t)pwritev2 || */
 				func == (fptr_t)cfa_pwritev2 )
@@ -1019,10 +1021,8 @@
 		#endif
 
-		#if defined(HAVE_PWRITEV2)
-			if( /*func == (fptr_t)fsync || */
-				func == (fptr_t)cfa_fsync )
-				#define _CFA_IO_FEATURE_IORING_OP_FSYNC ,
-				return IS_DEFINED(IORING_OP_FSYNC);
-		#endif
+		if( /*func == (fptr_t)fsync || */
+			func == (fptr_t)cfa_fsync )
+			#define _CFA_IO_FEATURE_IORING_OP_FSYNC ,
+			return IS_DEFINED(IORING_OP_FSYNC);
 
 		if( /*func == (fptr_t)ync_file_range || */
Index: libcfa/src/concurrency/kernel.cfa
===================================================================
--- libcfa/src/concurrency/kernel.cfa	(revision cb870e04a1fa8b52d7cbaa83d0b9a6ab245a2fd1)
+++ libcfa/src/concurrency/kernel.cfa	(revision be91ab4b15c324cf50bb6e2b5831a7f08d33c07c)
@@ -250,5 +250,7 @@
 	}
 
-	pthread_join( kernel_thread, 0p );
+	int err = pthread_join( kernel_thread, 0p );
+	if( err != 0 ) abort("KERNEL ERROR: joining processor %p caused error %s\n", &this, strerror(err));
+
 	free( this.stack );
 }
@@ -824,4 +826,8 @@
 	// Destroy the main processor and its context in reverse order of construction
 	// These were manually constructed so we need manually destroy them
+	void ^?{}(processor & this) with( this ){
+		/* paranoid */ verify( this.do_terminate == true );
+	}
+
 	^(*mainProcessor){};
 
