This is an archive of the discontinued LLVM Phabricator instance.

[trace] clear any existing tracing sessions before relaunching the binary
ClosedPublic

Authored by wallace on Mar 21 2022, 1:34 PM.

Details

Summary

There's a bug caused when a process is relaunched: the target, which
doesn't change, keeps the Trace object from the previous process, which
is already defunct, and causes segmentation faults when it's attempted
to be used.
A fix is to clean up the Trace object when the target is disposing of
the previous process during relaunches.

A way to reproduce this:

lldb a.out
b main
r
process trace start
c
r
process trace start

Diff Detail

Event Timeline

wallace created this revision.Mar 21 2022, 1:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 21 2022, 1:34 PM
wallace requested review of this revision.Mar 21 2022, 1:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 21 2022, 1:34 PM
wallace updated this revision to Diff 417082.Mar 21 2022, 1:44 PM

improve test

jj10306 accepted this revision.Mar 21 2022, 3:59 PM

nice catch, lgtm!

This revision is now accepted and ready to land.Mar 21 2022, 3:59 PM