Skip to content
Browse files

Fix a mach race condition between a thread triggering a NRE and anoth…

…er aborting the former.
  • Loading branch information...
1 parent 3534284 commit 9222af93f9f838613c9db7c53d777db919d36e1a @kumpera kumpera committed with duncanmak Mar 2, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 mono/mini/mini-darwin.c
View
6 mono/mini/mini-darwin.c
@@ -148,7 +148,11 @@ mach_exception_thread (void *arg)
MACH_MSG_TIMEOUT_NONE,
MACH_PORT_NULL);
- g_assert (result == MACH_MSG_SUCCESS);
+ /*
+ If we try to abort the thread while delivering an exception. The port will be gone since the kernel
+ setup a send once port to deliver the resume message and thread_abort will consume it.
+ */
+ g_assert (result == MACH_MSG_SUCCESS || result == MACH_SEND_INVALID_DEST);
}
return NULL;
}

0 comments on commit 9222af9

Please sign in to comment.
Something went wrong with that request. Please try again.