It seems our exception handler can be called before it's fully set up.
Handle that case without potentially leaking too many ports.
Reported by Gabriel Dos Reis on sbcl-devel.
;;;; -*- coding: utf-8; fill-column: 78 -*-
changes relative to sbcl-1.1.6
+ * bug fix: our mach exception handler can seemingly called very early in
+ the program execution process on OS X 10.8.0. Try and handle that case
+ robustly, without potentially leaking mach ports too much.
* enhancement: TRACE :PRINT-ALL handles multiple-valued forms.
(lp#457053)
* bug fix: :allocation slot option works for condition slots
ret = KERN_INVALID_RIGHT;
}
+ if (current_mach_task == MACH_PORT_NULL)
+ current_mach_task = mach_task_self();
+
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);
call_handler_on_thread(thread, &thread_state, signal, &siginfo, handler);
}
+ if (current_mach_task == MACH_PORT_NULL)
+ current_mach_task = mach_task_self();
+
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);