diff options
author | Pavel Labath <labath@google.com> | 2016-05-12 11:10:01 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2016-05-12 11:10:01 +0000 |
commit | 194357c5092b34ca2487da76ef828a82b4a4da34 (patch) | |
tree | 0821949e9fe367e9c9ccd14cc429c9594659aeab /llvm/lib/Target/Mips | |
parent | 55d383319f94687e641603f66a639a673cd72eb7 (diff) | |
download | bcm5719-llvm-194357c5092b34ca2487da76ef828a82b4a4da34.tar.gz bcm5719-llvm-194357c5092b34ca2487da76ef828a82b4a4da34.zip |
Fix a race in ProcessGDBRemote::MonitorDebugServerProcess
Summary:
MonitorDebugServerProcess went to a lot of effort to make sure its asynchronous invocation does
not cause any mischief, but it was still not race-free. Specifically, in a quick stop-restart
sequence (like the one in TestAddressBreakpoints) the copying of the process shared pointer via
target_sp->GetProcessSP() was racing with the resetting of the pointer in DeleteCurrentProcess,
as they were both accessing the same shared_ptr object.
To avoid this, I simply pass in a weak_ptr to the process when the callback is created. Locking
this pointer is race-free as they are two separate object even though they point to the same
process instance. This also removes the need for the complicated tap-dance around retrieving the
process pointer.
Reviewers: clayborg
Subscribers: tberghammer, lldb-commits
Differential Revision: http://reviews.llvm.org/D20107
llvm-svn: 269281
Diffstat (limited to 'llvm/lib/Target/Mips')
0 files changed, 0 insertions, 0 deletions