[Lldb-commits] [PATCH] D53412: [lldb] Fixed deadlock when SBProcess is Kill()ed and inspected

Cameron via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 18 14:34:48 PDT 2018

cameron314 created this revision.
cameron314 added reviewers: zturner, clayborg.
Herald added a subscriber: lldb-commits.

This patch changes the order that mutexes are acquired in SBProcess such that the target API mutex is now always acquired before the public run lock mutex is acquired.

This fixes a deadlock in LLDB when calling `SBProcess::Kill()` while calling e.g. `SBProcess::GetThreadByID()`: `Kill` takes the target API mutex, then waits for the private state thread to exit, which tries to lock the public run lock mutex, but it's already being held by `GetThreadByID`, which is waiting in turn for the target API mutex.




-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53412.170125.patch
Type: text/x-patch
Size: 9531 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20181018/7beecbaa/attachment.bin>

More information about the lldb-commits mailing list