This is an archive of the discontinued LLVM Phabricator instance.

Fix deadlock while attaching to inferiors
ClosedPublic

Authored by labath on Sep 2 2015, 3:51 AM.

Details

Summary

There was a race condition in the AsyncThread, where we would end up sending a vAttach
notification to the thread before it got a chance set up its listener (this can be reproduced by
adding a sleep() at the very beginning of ProcessGDBRemote::AsyncThread()). This event would then
get lost and we LLDB would deadlock. I fix this by setting up the listener early on, in the
ProcessGDBRemote constructor.

This should improve the stability of all attach tests. For now, I am removing XTIMEOUT from
TestAttachResume, and will watch the buildbots for signs of trouble.

Diff Detail

Repository
rL LLVM

Event Timeline

labath updated this revision to Diff 33795.Sep 2 2015, 3:51 AM
labath retitled this revision from to Fix deadlock while attaching to inferiors.
labath updated this object.
labath added reviewers: clayborg, ovyalov.
labath added a subscriber: lldb-commits.
clayborg accepted this revision.Sep 2 2015, 10:13 AM
clayborg edited edge metadata.

Looks good.

This revision is now accepted and ready to land.Sep 2 2015, 10:13 AM
ovyalov accepted this revision.Sep 2 2015, 10:53 AM
ovyalov edited edge metadata.

LGTM

This revision was automatically updated to reflect the committed changes.