Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
proc: fix race between proxy calls and process termination
When a ustack() or similar thing is done, DTrace's main thread grabs the process and makes a proxy call into its process control thread. Now that waitfd() is gone this involves dodging a race via arming and firing a timer that hammers the process control thread with a dedicated realtime signal. Unfortunately, the process can die at any point, and proxy_call includes two potentially high-latency points (around the actual proxy call, and around the call to get the return value) at which point the process might have terminated and the timer been freed. Everything else that far down the proxy_call checks dpr->dpr_done to avoid this causing trouble, but the timer disarm does not. Fix this. (Spotted via valgrind causing its usual massive slowdown and widening this race until it was wide enough for the already-deleted state of the timer to be detectable.) Signed-off-by: Nick Alcock <nick.alcock@oracle.com> Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
- Loading branch information