This is an archive of the discontinued LLVM Phabricator instance.

[lldb-vscode] Synchronize calls to SendTerminatedEvent
ClosedPublic

Authored by asahay on Jun 3 2021, 4:17 AM.

Details

Summary

If an inferior exits prior to the processing of a disconnect request,
then the threads executing EventThreadFunction and request_discontinue
respectively may call SendTerminatedEvent simultaneously, in turn,
testing and/or setting g_vsc.sent_terminated_event without any
synchronization. In case the thread executing EventThreadFunction sets
it before the thread executing request_discontinue has had a chance to
test it, the latter would move ahead to issue a response to the
disconnect request. Said response may be dispatched ahead of the
terminated event compelling the client to terminate the debug session
without consuming any console output that might've been generated by
the execution of terminateCommands.

Diff Detail

Event Timeline

asahay created this revision.Jun 3 2021, 4:17 AM
asahay requested review of this revision.Jun 3 2021, 4:17 AM
asahay set the repository for this revision to rG LLVM Github Monorepo.
asahay added a subscriber: lldb-commits.
wallace accepted this revision.Jun 3 2021, 10:28 AM

thanks

This revision is now accepted and ready to land.Jun 3 2021, 10:28 AM
clayborg accepted this revision.Jun 3 2021, 11:18 AM
This revision was landed with ongoing or failed builds.Jun 11 2021, 9:08 AM
This revision was automatically updated to reflect the committed changes.