diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2009-12-21 23:10:45 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2009-12-21 23:10:45 +0100 |
commit | f67ebd0771424181f8713f1931ee221d306eb683 (patch) | |
tree | 57849a0209c0569ee1b7877903d1ae92d34bc287 /ipc | |
parent | 7b9d0458105831a79d211f1ca98a184adedf82f5 (diff) |
Invoke debugger on duplicate port deallocation
* ipc/mach_port.c (mach_port_deallocate): Call SoftDebugger if
ipc_right_lookup_write was not succcessful and `name' is not
MACH_PORT_NULL or MACH_PORT_DEAD.
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/mach_port.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ipc/mach_port.c b/ipc/mach_port.c index 17aaf88..4315e80 100644 --- a/ipc/mach_port.c +++ b/ipc/mach_port.c @@ -602,8 +602,13 @@ mach_port_deallocate( return KERN_INVALID_TASK; kr = ipc_right_lookup_write(space, name, &entry); - if (kr != KERN_SUCCESS) + if (kr != KERN_SUCCESS) { + if (name != MACH_PORT_NULL && name != MACH_PORT_DEAD) { + printf("task %p deallocating an invalid port %u, most probably a bug.\n", current_task(), name); + SoftDebugger("mach_port_deallocate"); + } return kr; + } /* space is write-locked */ kr = ipc_right_dealloc(space, name, entry); /* unlocks space */ |