1.0.46.30: don't deallocate exception_port and check return values from mach_port_dea...
authorCyrus Harmon <ch-sbcl@bobobeach.com>
Tue, 8 Mar 2011 02:56:27 +0000 (02:56 +0000)
committerCyrus Harmon <ch-sbcl@bobobeach.com>
Tue, 8 Mar 2011 02:56:27 +0000 (02:56 +0000)
 * mach_port_deallocate of the exception_port was returning
   KERN_INVALID_RIGHT; assume this call was bogus and remove it.  So
   now we can be more strict about checking the return values of the
   other deallocate calls.

src/runtime/x86-64-darwin-os.c
version.lisp-expr

index 7f24fb7..180db11 100644 (file)
@@ -301,7 +301,7 @@ catch_exception_raise(mach_port_t exception_port,
                       exception_data_t code_vector,
                       mach_msg_type_number_t code_count)
 {
-    kern_return_t ret;
+    kern_return_t ret, dealloc_ret;
     int signal;
     siginfo_t* siginfo;
 
@@ -574,9 +574,15 @@ catch_exception_raise(mach_port_t exception_port,
         ret = KERN_INVALID_RIGHT;
     }
 
-    mach_port_deallocate (current_mach_task, exception_port);
-    mach_port_deallocate (current_mach_task, thread);
-    mach_port_deallocate (current_mach_task, task);
+    dealloc_ret = mach_port_deallocate (current_mach_task, thread);
+    if (dealloc_ret) {
+      lose("mach_port_deallocate (thread) failed with return_code %d\n", dealloc_ret);
+    }
+
+    dealloc_ret = mach_port_deallocate (current_mach_task, task);
+    if (dealloc_ret) {
+      lose("mach_port_deallocate (task) failed with return_code %d\n", dealloc_ret);
+    }
 
     return ret;
 }
index b743558..ba612df 100644 (file)
@@ -20,4 +20,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.46.29"
+"1.0.46.30"