This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Fix one leak in reproducer
ClosedPublic

Authored by MaskRay on Apr 19 2021, 5:59 PM.

Details

Summary

Use a variable of static storage duration to reference an intentionally
leaked variable. A static data area is in the GC-set of various leak
checkers.

This fixes 3 check-lldb-shell tests in a -DLLVM_USE_SANITIZER={Leaks,Address} build,
e.g. test/Shell/Reproducer/TestHomeDir.test

Diff Detail

Event Timeline

MaskRay requested review of this revision.Apr 19 2021, 5:59 PM
MaskRay created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptApr 19 2021, 5:59 PM
MaskRay added a comment.EditedApr 19 2021, 6:04 PM

@JDevlieghere The Reproducer library seems to have several other leaks. Maybe you'd like to look at them? :) I am unfamiliar with the code...
For example, lldb-shell :: Reproducer/TestMultipleTargets.test has the following issues:

==2013285==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 32 byte(s) in 2 object(s) allocated from:
    #0 0x27eaf8 in operator new(unsigned long) /home/maskray/llvm/compiler-rt/lib/lsan/lsan_interceptors.cpp:238:35
    #1 0x7ffff3c77612 in HandleReplayResult<lldb::SBFile> /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:341:57
    #2 0x7ffff3c77612 in lldb_private::repro::DefaultReplayer<lldb::SBFile (lldb::SBDebugger*)>::Replay(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:487:25
    #3 0x7ffff3c7e70a in lldb_private::repro::DefaultReplayer<lldb::SBFile (lldb::SBDebugger*)>::operator()(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:483:5
    #4 0x7ffff421975d in lldb_private::repro::Registry::Replay(lldb_private::repro::Deserializer&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:131:22
    #5 0x7ffff42194ff in Replay /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:108:10
    #6 0x7ffff42194ff in lldb_private::repro::Registry::Replay(lldb_private::FileSpec const&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:103:10
    #7 0x7ffff3d66b59 in lldb::SBReproducer::Replay(char const*, lldb::SBReplayOptions const&) /home/maskray/llvm/lldb/source/API/SBReproducer.cpp:263:12
    #8 0x28516c in InitializeReproducer /home/maskray/llvm/lldb/tools/driver/Driver.cpp:819:13
    #9 0x28516c in main /home/maskray/llvm/lldb/tools/driver/Driver.cpp:907:24
    #10 0x7ffff0734d09 in __libc_start_main csu/../csu/libc-start.c:308:16

Direct leak of 32 byte(s) in 2 object(s) allocated from:
    #0 0x27eaf8 in operator new(unsigned long) /home/maskray/llvm/compiler-rt/lib/lsan/lsan_interceptors.cpp:238:35
    #1 0x7ffff3cab513 in lldb_private::repro::construct<lldb::SBFile (lldb::SBFile const&)>::record(lldb::SBFile const&) /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:944:47
    #2 0x7ffff3cad519 in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:465:14
    #3 0x7ffff3cad519 in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:454:14
    #4 0x7ffff3cad519 in Replay /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:488:9
    #5 0x7ffff3cad519 in lldb_private::repro::DefaultReplayer<lldb::SBFile* (lldb::SBFile const&)>::operator()(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:483:5
    #6 0x7ffff421975d in lldb_private::repro::Registry::Replay(lldb_private::repro::Deserializer&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:131:22
    #7 0x7ffff42194ff in Replay /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:108:10
    #8 0x7ffff42194ff in lldb_private::repro::Registry::Replay(lldb_private::FileSpec const&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:103:10
    #9 0x7ffff3d66b59 in lldb::SBReproducer::Replay(char const*, lldb::SBReplayOptions const&) /home/maskray/llvm/lldb/source/API/SBReproducer.cpp:263:12
    #10 0x28516c in InitializeReproducer /home/maskray/llvm/lldb/tools/driver/Driver.cpp:819:13
    #11 0x28516c in main /home/maskray/llvm/lldb/tools/driver/Driver.cpp:907:24
    #12 0x7ffff0734d09 in __libc_start_main csu/../csu/libc-start.c:308:16

Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x27eaf8 in operator new(unsigned long) /home/maskray/llvm/compiler-rt/lib/lsan/lsan_interceptors.cpp:238:35
    #1 0x7ffff3c0b143 in lldb_private::repro::construct<lldb::SBBroadcaster (char const*)>::record(char const*) /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:944:47
    #2 0x7ffff3c0c73e in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:465:14
    #3 0x7ffff3c0c73e in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:454:14
    #4 0x7ffff3c0c73e in Replay /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:488:9
    #5 0x7ffff3c0c73e in lldb_private::repro::DefaultReplayer<lldb::SBBroadcaster* (char const*)>::operator()(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:483:5
    #6 0x7ffff421975d in lldb_private::repro::Registry::Replay(lldb_private::repro::Deserializer&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:131:22
    #7 0x7ffff42194ff in Replay /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:108:10
    #8 0x7ffff42194ff in lldb_private::repro::Registry::Replay(lldb_private::FileSpec const&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:103:10
    #9 0x7ffff3d66b59 in lldb::SBReproducer::Replay(char const*, lldb::SBReplayOptions const&) /home/maskray/llvm/lldb/source/API/SBReproducer.cpp:263:12
    #10 0x28516c in InitializeReproducer /home/maskray/llvm/lldb/tools/driver/Driver.cpp:819:13
    #11 0x28516c in main /home/maskray/llvm/lldb/tools/driver/Driver.cpp:907:24
    #12 0x7ffff0734d09 in __libc_start_main csu/../csu/libc-start.c:308:16

Direct leak of 16 byte(s) in 2 object(s) allocated from:
    #0 0x27eaf8 in operator new(unsigned long) /home/maskray/llvm/compiler-rt/lib/lsan/lsan_interceptors.cpp:238:35
    #1 0x7ffff3c7781f in HandleReplayResult<lldb::SBCommandInterpreter> /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:341:57
    #2 0x7ffff3c7781f in lldb_private::repro::DefaultReplayer<lldb::SBCommandInterpreter (lldb::SBDebugger*)>::Replay(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:487:25
    #3 0x7ffff3c7e747 in lldb_private::repro::DefaultReplayer<lldb::SBCommandInterpreter (lldb::SBDebugger*)>::operator()(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:483:5
    #4 0x7ffff421975d in lldb_private::repro::Registry::Replay(lldb_private::repro::Deserializer&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:131:22
    #5 0x7ffff42194ff in Replay /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:108:10
    #6 0x7ffff42194ff in lldb_private::repro::Registry::Replay(lldb_private::FileSpec const&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:103:10
    #7 0x7ffff3d66b59 in lldb::SBReproducer::Replay(char const*, lldb::SBReplayOptions const&) /home/maskray/llvm/lldb/source/API/SBReproducer.cpp:263:12
    #8 0x28516c in InitializeReproducer /home/maskray/llvm/lldb/tools/driver/Driver.cpp:819:13
    #9 0x28516c in main /home/maskray/llvm/lldb/tools/driver/Driver.cpp:907:24
    #10 0x7ffff0734d09 in __libc_start_main csu/../csu/libc-start.c:308:16

Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x27eaf8 in operator new(unsigned long) /home/maskray/llvm/compiler-rt/lib/lsan/lsan_interceptors.cpp:238:35
    #1 0x7ffff3d783af in lldb_private::repro::construct<lldb::SBStream ()>::record() /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:944:47
    #2 0x7ffff3d7917f in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:465:14
    #3 0x7ffff3d7917f in Replay /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:488:9
    #4 0x7ffff3d7917f in lldb_private::repro::DefaultReplayer<lldb::SBStream* ()>::operator()(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:483:5
    #5 0x7ffff421975d in lldb_private::repro::Registry::Replay(lldb_private::repro::Deserializer&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:131:22
    #6 0x7ffff42194ff in Replay /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:108:10
    #7 0x7ffff42194ff in lldb_private::repro::Registry::Replay(lldb_private::FileSpec const&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:103:10
    #8 0x7ffff3d66b59 in lldb::SBReproducer::Replay(char const*, lldb::SBReplayOptions const&) /home/maskray/llvm/lldb/source/API/SBReproducer.cpp:263:12
    #9 0x28516c in InitializeReproducer /home/maskray/llvm/lldb/tools/driver/Driver.cpp:819:13
    #10 0x28516c in main /home/maskray/llvm/lldb/tools/driver/Driver.cpp:907:24
    #11 0x7ffff0734d09 in __libc_start_main csu/../csu/libc-start.c:308:16

Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x27eaf8 in operator new(unsigned long) /home/maskray/llvm/compiler-rt/lib/lsan/lsan_interceptors.cpp:238:35
    #1 0x7ffff3c72083 in lldb_private::repro::construct<lldb::SBDebugger (lldb::SBDebugger const&)>::record(lldb::SBDebugger const&) /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:944:47
    #2 0x7ffff3c7dfa9 in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:465:14
    #3 0x7ffff3c7dfa9 in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:454:14
    #4 0x7ffff3c7dfa9 in Replay /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:488:9
    #5 0x7ffff3c7dfa9 in lldb_private::repro::DefaultReplayer<lldb::SBDebugger* (lldb::SBDebugger const&)>::operator()(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:483:5
    #6 0x7ffff421975d in lldb_private::repro::Registry::Replay(lldb_private::repro::Deserializer&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:131:22
    #7 0x7ffff42194ff in Replay /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:108:10
    #8 0x7ffff42194ff in lldb_private::repro::Registry::Replay(lldb_private::FileSpec const&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:103:10
    #9 0x7ffff3d66b59 in lldb::SBReproducer::Replay(char const*, lldb::SBReplayOptions const&) /home/maskray/llvm/lldb/source/API/SBReproducer.cpp:263:12
    #10 0x28516c in InitializeReproducer /home/maskray/llvm/lldb/tools/driver/Driver.cpp:819:13
    #11 0x28516c in main /home/maskray/llvm/lldb/tools/driver/Driver.cpp:907:24
    #12 0x7ffff0734d09 in __libc_start_main csu/../csu/libc-start.c:308:16

Direct leak of 16 byte(s) in 2 object(s) allocated from:
    #0 0x27eaf8 in operator new(unsigned long) /home/maskray/llvm/compiler-rt/lib/lsan/lsan_interceptors.cpp:238:35
    #1 0x7ffff3c1b583 in lldb_private::repro::construct<lldb::SBCommandInterpreter (lldb::SBCommandInterpreter const&)>::record(lldb::SBCommandInterpreter const&) /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:944:47
    #2 0x7ffff3c227a9 in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:465:14
    #3 0x7ffff3c227a9 in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:454:14
    #4 0x7ffff3c227a9 in Replay /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:488:9
    #5 0x7ffff3c227a9 in lldb_private::repro::DefaultReplayer<lldb::SBCommandInterpreter* (lldb::SBCommandInterpreter const&)>::operator()(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:483:5
    #6 0x7ffff421975d in lldb_private::repro::Registry::Replay(lldb_private::repro::Deserializer&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:131:22
    #7 0x7ffff42194ff in Replay /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:108:10
    #8 0x7ffff42194ff in lldb_private::repro::Registry::Replay(lldb_private::FileSpec const&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:103:10
    #9 0x7ffff3d66b59 in lldb::SBReproducer::Replay(char const*, lldb::SBReplayOptions const&) /home/maskray/llvm/lldb/source/API/SBReproducer.cpp:263:12
    #10 0x28516c in InitializeReproducer /home/maskray/llvm/lldb/tools/driver/Driver.cpp:819:13
    #11 0x28516c in main /home/maskray/llvm/lldb/tools/driver/Driver.cpp:907:24
    #12 0x7ffff0734d09 in __libc_start_main csu/../csu/libc-start.c:308:16

Direct leak of 16 byte(s) in 2 object(s) allocated from:
    #0 0x27eaf8 in operator new(unsigned long) /home/maskray/llvm/compiler-rt/lib/lsan/lsan_interceptors.cpp:238:35
    #1 0x7ffff3ca68f3 in lldb_private::repro::construct<lldb::SBFileSpec (char const*)>::record(char const*) /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:944:47
    #2 0x7ffff3ca805e in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:465:14
    #3 0x7ffff3ca805e in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:454:14
    #4 0x7ffff3ca805e in Replay /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:488:9
    #5 0x7ffff3ca805e in lldb_private::repro::DefaultReplayer<lldb::SBFileSpec* (char const*)>::operator()(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:483:5
    #6 0x7ffff421975d in lldb_private::repro::Registry::Replay(lldb_private::repro::Deserializer&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:131:22
    #7 0x7ffff42194ff in Replay /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:108:10
    #8 0x7ffff42194ff in lldb_private::repro::Registry::Replay(lldb_private::FileSpec const&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:103:10
    #9 0x7ffff3d66b59 in lldb::SBReproducer::Replay(char const*, lldb::SBReplayOptions const&) /home/maskray/llvm/lldb/source/API/SBReproducer.cpp:263:12
    #10 0x28516c in InitializeReproducer /home/maskray/llvm/lldb/tools/driver/Driver.cpp:819:13
    #11 0x28516c in main /home/maskray/llvm/lldb/tools/driver/Driver.cpp:907:24
    #12 0x7ffff0734d09 in __libc_start_main csu/../csu/libc-start.c:308:16

Direct leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0x27eaf8 in operator new(unsigned long) /home/maskray/llvm/compiler-rt/lib/lsan/lsan_interceptors.cpp:238:35
    #1 0x7ffff3c8e3bf in lldb_private::repro::construct<lldb::SBError ()>::record() /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:944:47
    #2 0x7ffff3c8f30f in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:465:14
    #3 0x7ffff3c8f30f in Replay /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:488:9
    #4 0x7ffff3c8f30f in lldb_private::repro::DefaultReplayer<lldb::SBError* ()>::operator()(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:483:5
    #5 0x7ffff421975d in lldb_private::repro::Registry::Replay(lldb_private::repro::Deserializer&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:131:22
    #6 0x7ffff42194ff in Replay /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:108:10
    #7 0x7ffff42194ff in lldb_private::repro::Registry::Replay(lldb_private::FileSpec const&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:103:10
    #8 0x7ffff3d66b59 in lldb::SBReproducer::Replay(char const*, lldb::SBReplayOptions const&) /home/maskray/llvm/lldb/source/API/SBReproducer.cpp:263:12
    #9 0x28516c in InitializeReproducer /home/maskray/llvm/lldb/tools/driver/Driver.cpp:819:13
    #10 0x28516c in main /home/maskray/llvm/lldb/tools/driver/Driver.cpp:907:24
    #11 0x7ffff0734d09 in __libc_start_main csu/../csu/libc-start.c:308:16

Direct leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0x27eaf8 in operator new(unsigned long) /home/maskray/llvm/compiler-rt/lib/lsan/lsan_interceptors.cpp:238:35
    #1 0x7ffff3c280b3 in lldb_private::repro::construct<lldb::SBCommandInterpreterRunResult (lldb::SBCommandInterpreterRunResult const&)>::record(lldb::SBCommandInterpreterRunResult const&) /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:944:47
    #2 0x7ffff3c29869 in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:465:14
    #3 0x7ffff3c29869 in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:454:14
    #4 0x7ffff3c29869 in Replay /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:488:9
    #5 0x7ffff3c29869 in lldb_private::repro::DefaultReplayer<lldb::SBCommandInterpreterRunResult* (lldb::SBCommandInterpreterRunResult const&)>::operator()(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:483:5
    #6 0x7ffff421975d in lldb_private::repro::Registry::Replay(lldb_private::repro::Deserializer&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:131:22
    #7 0x7ffff42194ff in Replay /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:108:10
    #8 0x7ffff42194ff in lldb_private::repro::Registry::Replay(lldb_private::FileSpec const&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:103:10
    #9 0x7ffff3d66b59 in lldb::SBReproducer::Replay(char const*, lldb::SBReplayOptions const&) /home/maskray/llvm/lldb/source/API/SBReproducer.cpp:263:12
    #10 0x28516c in InitializeReproducer /home/maskray/llvm/lldb/tools/driver/Driver.cpp:819:13
    #11 0x28516c in main /home/maskray/llvm/lldb/tools/driver/Driver.cpp:907:24
    #12 0x7ffff0734d09 in __libc_start_main csu/../csu/libc-start.c:308:16

Direct leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0x27eaf8 in operator new(unsigned long) /home/maskray/llvm/compiler-rt/lib/lsan/lsan_interceptors.cpp:238:35
    #1 0x7ffff3c317ff in lldb_private::repro::construct<lldb::SBCommandReturnObject ()>::record() /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:944:47
    #2 0x7ffff3c3470f in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:465:14
    #3 0x7ffff3c3470f in Replay /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:488:9
    #4 0x7ffff3c3470f in lldb_private::repro::DefaultReplayer<lldb::SBCommandReturnObject* ()>::operator()(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:483:5
    #5 0x7ffff421975d in lldb_private::repro::Registry::Replay(lldb_private::repro::Deserializer&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:131:22
    #6 0x7ffff42194ff in Replay /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:108:10
    #7 0x7ffff42194ff in lldb_private::repro::Registry::Replay(lldb_private::FileSpec const&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:103:10
    #8 0x7ffff3d66b59 in lldb::SBReproducer::Replay(char const*, lldb::SBReplayOptions const&) /home/maskray/llvm/lldb/source/API/SBReproducer.cpp:263:12
    #9 0x28516c in InitializeReproducer /home/maskray/llvm/lldb/tools/driver/Driver.cpp:819:13
    #10 0x28516c in main /home/maskray/llvm/lldb/tools/driver/Driver.cpp:907:24
    #11 0x7ffff0734d09 in __libc_start_main csu/../csu/libc-start.c:308:16

Direct leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0x27eaf8 in operator new(unsigned long) /home/maskray/llvm/compiler-rt/lib/lsan/lsan_interceptors.cpp:238:35
    #1 0x7ffff3c8e3f3 in lldb_private::repro::construct<lldb::SBError (lldb::SBError const&)>::record(lldb::SBError const&) /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:944:47
    #2 0x7ffff3c8f3d9 in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:465:14
    #3 0x7ffff3c8f3d9 in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:454:14
    #4 0x7ffff3c8f3d9 in Replay /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:488:9
    #5 0x7ffff3c8f3d9 in lldb_private::repro::DefaultReplayer<lldb::SBError* (lldb::SBError const&)>::operator()(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:483:5
    #6 0x7ffff421975d in lldb_private::repro::Registry::Replay(lldb_private::repro::Deserializer&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:131:22
    #7 0x7ffff42194ff in Replay /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:108:10
    #8 0x7ffff42194ff in lldb_private::repro::Registry::Replay(lldb_private::FileSpec const&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:103:10
    #9 0x7ffff3d66b59 in lldb::SBReproducer::Replay(char const*, lldb::SBReplayOptions const&) /home/maskray/llvm/lldb/source/API/SBReproducer.cpp:263:12
    #10 0x28516c in InitializeReproducer /home/maskray/llvm/lldb/tools/driver/Driver.cpp:819:13
    #11 0x28516c in main /home/maskray/llvm/lldb/tools/driver/Driver.cpp:907:24
    #12 0x7ffff0734d09 in __libc_start_main csu/../csu/libc-start.c:308:16

Direct leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0x27eaf8 in operator new(unsigned long) /home/maskray/llvm/compiler-rt/lib/lsan/lsan_interceptors.cpp:238:35
    #1 0x7ffff3c2801f in lldb_private::repro::construct<lldb::SBCommandInterpreterRunOptions ()>::record() /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:944:47
    #2 0x7ffff3c294af in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:465:14
    #3 0x7ffff3c294af in Replay /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:488:9
    #4 0x7ffff3c294af in lldb_private::repro::DefaultReplayer<lldb::SBCommandInterpreterRunOptions* ()>::operator()(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:483:5
    #5 0x7ffff421975d in lldb_private::repro::Registry::Replay(lldb_private::repro::Deserializer&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:131:22
    #6 0x7ffff42194ff in Replay /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:108:10
    #7 0x7ffff42194ff in lldb_private::repro::Registry::Replay(lldb_private::FileSpec const&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:103:10
    #8 0x7ffff3d66b59 in lldb::SBReproducer::Replay(char const*, lldb::SBReplayOptions const&) /home/maskray/llvm/lldb/source/API/SBReproducer.cpp:263:12
    #9 0x28516c in InitializeReproducer /home/maskray/llvm/lldb/tools/driver/Driver.cpp:819:13
    #10 0x28516c in main /home/maskray/llvm/lldb/tools/driver/Driver.cpp:907:24
    #11 0x7ffff0734d09 in __libc_start_main csu/../csu/libc-start.c:308:16

Direct leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0x27eaf8 in operator new(unsigned long) /home/maskray/llvm/compiler-rt/lib/lsan/lsan_interceptors.cpp:238:35
    #1 0x7ffff3c7af26 in HandleReplayResult<lldb::SBCommandInterpreterRunResult> /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:341:57
    #2 0x7ffff3c7af26 in lldb_private::repro::DefaultReplayer<lldb::SBCommandInterpreterRunResult (lldb::SBDebugger*, lldb::SBCommandInterpreterRunOptions const&)>::Replay(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:487:25
    #3 0x7ffff3c809d7 in lldb_private::repro::DefaultReplayer<lldb::SBCommandInterpreterRunResult (lldb::SBDebugger*, lldb::SBCommandInterpreterRunOptions const&)>::operator()(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:483:5
    #4 0x7ffff421975d in lldb_private::repro::Registry::Replay(lldb_private::repro::Deserializer&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:131:22
    #5 0x7ffff42194ff in Replay /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:108:10
    #6 0x7ffff42194ff in lldb_private::repro::Registry::Replay(lldb_private::FileSpec const&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:103:10
    #7 0x7ffff3d66b59 in lldb::SBReproducer::Replay(char const*, lldb::SBReplayOptions const&) /home/maskray/llvm/lldb/source/API/SBReproducer.cpp:263:12
    #8 0x28516c in InitializeReproducer /home/maskray/llvm/lldb/tools/driver/Driver.cpp:819:13
    #9 0x28516c in main /home/maskray/llvm/lldb/tools/driver/Driver.cpp:907:24
    #10 0x7ffff0734d09 in __libc_start_main csu/../csu/libc-start.c:308:16

Indirect leak of 344 byte(s) in 1 object(s) allocated from:
    #0 0x27eaf8 in operator new(unsigned long) /home/maskray/llvm/compiler-rt/lib/lsan/lsan_interceptors.cpp:238:35
    #1 0x7ffff3c29a76 in SBCommandReturnObjectImpl /home/maskray/llvm/lldb/source/API/SBCommandReturnObject.cpp:25:15
    #2 0x7ffff3c29a76 in lldb::SBCommandReturnObject::SBCommandReturnObject() /home/maskray/llvm/lldb/source/API/SBCommandReturnObject.cpp:49:23
    #3 0x7ffff3c3180a in lldb_private::repro::construct<lldb::SBCommandReturnObject ()>::record() /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:944:51
    #4 0x7ffff3c3470f in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:465:14
    #5 0x7ffff3c3470f in Replay /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:488:9
    #6 0x7ffff3c3470f in lldb_private::repro::DefaultReplayer<lldb::SBCommandReturnObject* ()>::operator()(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:483:5
    #7 0x7ffff421975d in lldb_private::repro::Registry::Replay(lldb_private::repro::Deserializer&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:131:22
    #8 0x7ffff42194ff in Replay /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:108:10
    #9 0x7ffff42194ff in lldb_private::repro::Registry::Replay(lldb_private::FileSpec const&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:103:10
    #10 0x7ffff3d66b59 in lldb::SBReproducer::Replay(char const*, lldb::SBReplayOptions const&) /home/maskray/llvm/lldb/source/API/SBReproducer.cpp:263:12
    #11 0x28516c in InitializeReproducer /home/maskray/llvm/lldb/tools/driver/Driver.cpp:819:13
    #12 0x28516c in main /home/maskray/llvm/lldb/tools/driver/Driver.cpp:907:24
    #13 0x7ffff0734d09 in __libc_start_main csu/../csu/libc-start.c:308:16

Indirect leak of 272 byte(s) in 1 object(s) allocated from:
    #0 0x27eaf8 in operator new(unsigned long) /home/maskray/llvm/compiler-rt/lib/lsan/lsan_interceptors.cpp:238:35
    #1 0x7ffff41fc3cd in allocate /usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ext/new_allocator.h:115:27
    #2 0x7ffff41fc3cd in allocate /usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/alloc_traits.h:460:20
    #3 0x7ffff41fc3cd in __allocate_guarded<std::allocator<std::_Sp_counted_ptr_inplace<lldb_private::Broadcaster::BroadcasterImpl, std::allocator<lldb_private::Broadcaster::BroadcasterImpl>, __gnu_cxx::_S_atomic> > > /usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/allocated_ptr.h:97:21
    #4 0x7ffff41fc3cd in __shared_count<lldb_private::Broadcaster::BroadcasterImpl, std::allocator<lldb_private::Broadcaster::BroadcasterImpl>, lldb_private::Broadcaster &> /usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/shared_ptr_base.h:680:19
    #5 0x7ffff41fc3cd in __shared_ptr<std::allocator<lldb_private::Broadcaster::BroadcasterImpl>, lldb_private::Broadcaster &> /usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/shared_ptr_base.h:1371:14
    #6 0x7ffff41fc3cd in shared_ptr<std::allocator<lldb_private::Broadcaster::BroadcasterImpl>, lldb_private::Broadcaster &> /usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/shared_ptr.h:408:4
    #7 0x7ffff41fc3cd in allocate_shared<lldb_private::Broadcaster::BroadcasterImpl, std::allocator<lldb_private::Broadcaster::BroadcasterImpl>, lldb_private::Broadcaster &> /usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/shared_ptr.h:859:14
    #8 0x7ffff41fc3cd in make_shared<lldb_private::Broadcaster::BroadcasterImpl, lldb_private::Broadcaster &> /usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/shared_ptr.h:875:14
    #9 0x7ffff41fc3cd in lldb_private::Broadcaster::Broadcaster(std::shared_ptr<lldb_private::BroadcasterManager>, char const*) /home/maskray/llvm/lldb/source/Utility/Broadcaster.cpp:29:24
    #10 0x7ffff3c07285 in lldb::SBBroadcaster::SBBroadcaster(char const*) /home/maskray/llvm/lldb/source/API/SBBroadcaster.cpp:24:23
    #11 0x7ffff3c0b151 in lldb_private::repro::construct<lldb::SBBroadcaster (char const*)>::record(char const*) /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:944:51
    #12 0x7ffff3c0c73e in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:465:14
    #13 0x7ffff3c0c73e in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:454:14
    #14 0x7ffff3c0c73e in Replay /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:488:9
    #15 0x7ffff3c0c73e in lldb_private::repro::DefaultReplayer<lldb::SBBroadcaster* (char const*)>::operator()(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:483:5
    #16 0x7ffff421975d in lldb_private::repro::Registry::Replay(lldb_private::repro::Deserializer&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:131:22
    #17 0x7ffff42194ff in Replay /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:108:10
    #18 0x7ffff42194ff in lldb_private::repro::Registry::Replay(lldb_private::FileSpec const&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:103:10
    #19 0x7ffff3d66b59 in lldb::SBReproducer::Replay(char const*, lldb::SBReplayOptions const&) /home/maskray/llvm/lldb/source/API/SBReproducer.cpp:263:12
    #20 0x28516c in InitializeReproducer /home/maskray/llvm/lldb/tools/driver/Driver.cpp:819:13
    #21 0x28516c in main /home/maskray/llvm/lldb/tools/driver/Driver.cpp:907:24
    #22 0x7ffff0734d09 in __libc_start_main csu/../csu/libc-start.c:308:16

Indirect leak of 136 byte(s) in 1 object(s) allocated from:
    #0 0x27eaf8 in operator new(unsigned long) /home/maskray/llvm/compiler-rt/lib/lsan/lsan_interceptors.cpp:238:35
    #1 0x7ffff3d74267 in lldb::SBStream::SBStream() /home/maskray/llvm/lldb/source/API/SBStream.cpp:22:36
    #2 0x7ffff3d783ba in lldb_private::repro::construct<lldb::SBStream ()>::record() /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:944:51
    #3 0x7ffff3d7917f in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:465:14
    #4 0x7ffff3d7917f in Replay /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:488:9
    #5 0x7ffff3d7917f in lldb_private::repro::DefaultReplayer<lldb::SBStream* ()>::operator()(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:483:5
    #6 0x7ffff421975d in lldb_private::repro::Registry::Replay(lldb_private::repro::Deserializer&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:131:22
    #7 0x7ffff42194ff in Replay /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:108:10
    #8 0x7ffff42194ff in lldb_private::repro::Registry::Replay(lldb_private::FileSpec const&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:103:10
    #9 0x7ffff3d66b59 in lldb::SBReproducer::Replay(char const*, lldb::SBReplayOptions const&) /home/maskray/llvm/lldb/source/API/SBReproducer.cpp:263:12
    #10 0x28516c in InitializeReproducer /home/maskray/llvm/lldb/tools/driver/Driver.cpp:819:13
    #11 0x28516c in main /home/maskray/llvm/lldb/tools/driver/Driver.cpp:907:24
    #12 0x7ffff0734d09 in __libc_start_main csu/../csu/libc-start.c:308:16

Indirect leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x27eaf8 in operator new(unsigned long) /home/maskray/llvm/compiler-rt/lib/lsan/lsan_interceptors.cpp:238:35
    #1 0x7ffff3c0726c in lldb::SBBroadcaster::SBBroadcaster(char const*) /home/maskray/llvm/lldb/source/API/SBBroadcaster.cpp:24:19
    #2 0x7ffff3c0b151 in lldb_private::repro::construct<lldb::SBBroadcaster (char const*)>::record(char const*) /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:944:51
    #3 0x7ffff3c0c73e in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:465:14
    #4 0x7ffff3c0c73e in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:454:14
    #5 0x7ffff3c0c73e in Replay /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:488:9
    #6 0x7ffff3c0c73e in lldb_private::repro::DefaultReplayer<lldb::SBBroadcaster* (char const*)>::operator()(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:483:5
    #7 0x7ffff421975d in lldb_private::repro::Registry::Replay(lldb_private::repro::Deserializer&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:131:22
    #8 0x7ffff42194ff in Replay /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:108:10
    #9 0x7ffff42194ff in lldb_private::repro::Registry::Replay(lldb_private::FileSpec const&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:103:10
    #10 0x7ffff3d66b59 in lldb::SBReproducer::Replay(char const*, lldb::SBReplayOptions const&) /home/maskray/llvm/lldb/source/API/SBReproducer.cpp:263:12
    #11 0x28516c in InitializeReproducer /home/maskray/llvm/lldb/tools/driver/Driver.cpp:819:13
    #12 0x28516c in main /home/maskray/llvm/lldb/tools/driver/Driver.cpp:907:24
    #13 0x7ffff0734d09 in __libc_start_main csu/../csu/libc-start.c:308:16

Indirect leak of 40 byte(s) in 1 object(s) allocated from:
    #0 0x27eaf8 in operator new(unsigned long) /home/maskray/llvm/compiler-rt/lib/lsan/lsan_interceptors.cpp:238:35
    #1 0x7ffff3c23ea2 in make_unique<lldb_private::CommandInterpreterRunOptions> /usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/unique_ptr.h:962:30
    #2 0x7ffff3c23ea2 in lldb::SBCommandInterpreterRunOptions::SBCommandInterpreterRunOptions() /home/maskray/llvm/lldb/source/API/SBCommandInterpreterRunOptions.cpp:24:17
    #3 0x7ffff3c2802a in lldb_private::repro::construct<lldb::SBCommandInterpreterRunOptions ()>::record() /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:944:51
    #4 0x7ffff3c294af in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:465:14
    #5 0x7ffff3c294af in Replay /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:488:9
    #6 0x7ffff3c294af in lldb_private::repro::DefaultReplayer<lldb::SBCommandInterpreterRunOptions* ()>::operator()(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:483:5
    #7 0x7ffff421975d in lldb_private::repro::Registry::Replay(lldb_private::repro::Deserializer&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:131:22
    #8 0x7ffff42194ff in Replay /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:108:10
    #9 0x7ffff42194ff in lldb_private::repro::Registry::Replay(lldb_private::FileSpec const&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:103:10
    #10 0x7ffff3d66b59 in lldb::SBReproducer::Replay(char const*, lldb::SBReplayOptions const&) /home/maskray/llvm/lldb/source/API/SBReproducer.cpp:263:12
    #11 0x28516c in InitializeReproducer /home/maskray/llvm/lldb/tools/driver/Driver.cpp:819:13
    #12 0x28516c in main /home/maskray/llvm/lldb/tools/driver/Driver.cpp:907:24
    #13 0x7ffff0734d09 in __libc_start_main csu/../csu/libc-start.c:308:16

Indirect leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x27eaf8 in operator new(unsigned long) /home/maskray/llvm/compiler-rt/lib/lsan/lsan_interceptors.cpp:238:35
    #1 0x7ffff3ca2dec in lldb::SBFileSpec::SBFileSpec(char const*) /home/maskray/llvm/lldb/source/API/SBFileSpec.cpp:40:56
    #2 0x7ffff3ca6901 in lldb_private::repro::construct<lldb::SBFileSpec (char const*)>::record(char const*) /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:944:51
    #3 0x7ffff3ca805e in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:465:14
    #4 0x7ffff3ca805e in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:454:14
    #5 0x7ffff3ca805e in Replay /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:488:9
    #6 0x7ffff3ca805e in lldb_private::repro::DefaultReplayer<lldb::SBFileSpec* (char const*)>::operator()(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:483:5
    #7 0x7ffff421975d in lldb_private::repro::Registry::Replay(lldb_private::repro::Deserializer&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:131:22
    #8 0x7ffff42194ff in Replay /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:108:10
    #9 0x7ffff42194ff in lldb_private::repro::Registry::Replay(lldb_private::FileSpec const&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:103:10
    #10 0x7ffff3d66b59 in lldb::SBReproducer::Replay(char const*, lldb::SBReplayOptions const&) /home/maskray/llvm/lldb/source/API/SBReproducer.cpp:263:12
    #11 0x28516c in InitializeReproducer /home/maskray/llvm/lldb/tools/driver/Driver.cpp:819:13
    #12 0x28516c in main /home/maskray/llvm/lldb/tools/driver/Driver.cpp:907:24
    #13 0x7ffff0734d09 in __libc_start_main csu/../csu/libc-start.c:308:16

Indirect leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x27eaf8 in operator new(unsigned long) /home/maskray/llvm/compiler-rt/lib/lsan/lsan_interceptors.cpp:238:35
    #1 0x7ffff3c07292 in __shared_count<lldb_private::Broadcaster *> /usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/shared_ptr_base.h:628:16
    #2 0x7ffff3c07292 in __shared_count<lldb_private::Broadcaster *> /usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/shared_ptr_base.h:639:4
    #3 0x7ffff3c07292 in __shared_ptr<lldb_private::Broadcaster, void> /usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/shared_ptr_base.h:1128:17
    #4 0x7ffff3c07292 in shared_ptr<lldb_private::Broadcaster, void> /usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/shared_ptr.h:159:25
    #5 0x7ffff3c07292 in lldb::SBBroadcaster::SBBroadcaster(char const*) /home/maskray/llvm/lldb/source/API/SBBroadcaster.cpp:24:7
    #6 0x7ffff3c0b151 in lldb_private::repro::construct<lldb::SBBroadcaster (char const*)>::record(char const*) /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:944:51
    #7 0x7ffff3c0c73e in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:465:14
    #8 0x7ffff3c0c73e in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:454:14
    #9 0x7ffff3c0c73e in Replay /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:488:9
    #10 0x7ffff3c0c73e in lldb_private::repro::DefaultReplayer<lldb::SBBroadcaster* (char const*)>::operator()(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:483:5
    #11 0x7ffff421975d in lldb_private::repro::Registry::Replay(lldb_private::repro::Deserializer&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:131:22
    #12 0x7ffff42194ff in Replay /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:108:10
    #13 0x7ffff42194ff in lldb_private::repro::Registry::Replay(lldb_private::FileSpec const&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:103:10
    #14 0x7ffff3d66b59 in lldb::SBReproducer::Replay(char const*, lldb::SBReplayOptions const&) /home/maskray/llvm/lldb/source/API/SBReproducer.cpp:263:12
    #15 0x28516c in InitializeReproducer /home/maskray/llvm/lldb/tools/driver/Driver.cpp:819:13
    #16 0x28516c in main /home/maskray/llvm/lldb/tools/driver/Driver.cpp:907:24
    #17 0x7ffff0734d09 in __libc_start_main csu/../csu/libc-start.c:308:16

Indirect leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x27eaf8 in operator new(unsigned long) /home/maskray/llvm/compiler-rt/lib/lsan/lsan_interceptors.cpp:238:35
    #1 0x7ffff3c29a69 in lldb::SBCommandReturnObject::SBCommandReturnObject() /home/maskray/llvm/lldb/source/API/SBCommandReturnObject.cpp:49:19
    #2 0x7ffff3c3180a in lldb_private::repro::construct<lldb::SBCommandReturnObject ()>::record() /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:944:51
    #3 0x7ffff3c3470f in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:465:14
    #4 0x7ffff3c3470f in Replay /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:488:9
    #5 0x7ffff3c3470f in lldb_private::repro::DefaultReplayer<lldb::SBCommandReturnObject* ()>::operator()(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:483:5
    #6 0x7ffff421975d in lldb_private::repro::Registry::Replay(lldb_private::repro::Deserializer&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:131:22
    #7 0x7ffff42194ff in Replay /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:108:10
    #8 0x7ffff42194ff in lldb_private::repro::Registry::Replay(lldb_private::FileSpec const&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:103:10
    #9 0x7ffff3d66b59 in lldb::SBReproducer::Replay(char const*, lldb::SBReplayOptions const&) /home/maskray/llvm/lldb/source/API/SBReproducer.cpp:263:12
    #10 0x28516c in InitializeReproducer /home/maskray/llvm/lldb/tools/driver/Driver.cpp:819:13
    #11 0x28516c in main /home/maskray/llvm/lldb/tools/driver/Driver.cpp:907:24
    #12 0x7ffff0734d09 in __libc_start_main csu/../csu/libc-start.c:308:16

Indirect leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0x27eaf8 in operator new(unsigned long) /home/maskray/llvm/compiler-rt/lib/lsan/lsan_interceptors.cpp:238:35
    #1 0x7ffff3c262be in lldb::SBCommandInterpreterRunResult::SBCommandInterpreterRunResult(lldb::SBCommandInterpreterRunResult const&) /home/maskray/llvm/lldb/source/API/SBCommandInterpreterRunOptions.cpp:210:19
    #2 0x7ffff3c7af34 in HandleReplayResult<lldb::SBCommandInterpreterRunResult> /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:341:61
    #3 0x7ffff3c7af34 in lldb_private::repro::DefaultReplayer<lldb::SBCommandInterpreterRunResult (lldb::SBDebugger*, lldb::SBCommandInterpreterRunOptions const&)>::Replay(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:487:25
    #4 0x7ffff3c809d7 in lldb_private::repro::DefaultReplayer<lldb::SBCommandInterpreterRunResult (lldb::SBDebugger*, lldb::SBCommandInterpreterRunOptions const&)>::operator()(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:483:5
    #5 0x7ffff421975d in lldb_private::repro::Registry::Replay(lldb_private::repro::Deserializer&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:131:22
    #6 0x7ffff42194ff in Replay /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:108:10
    #7 0x7ffff42194ff in lldb_private::repro::Registry::Replay(lldb_private::FileSpec const&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:103:10
    #8 0x7ffff3d66b59 in lldb::SBReproducer::Replay(char const*, lldb::SBReplayOptions const&) /home/maskray/llvm/lldb/source/API/SBReproducer.cpp:263:12
    #9 0x28516c in InitializeReproducer /home/maskray/llvm/lldb/tools/driver/Driver.cpp:819:13
    #10 0x28516c in main /home/maskray/llvm/lldb/tools/driver/Driver.cpp:907:24
    #11 0x7ffff0734d09 in __libc_start_main csu/../csu/libc-start.c:308:16

Indirect leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0x27eaf8 in operator new(unsigned long) /home/maskray/llvm/compiler-rt/lib/lsan/lsan_interceptors.cpp:238:35
    #1 0x7ffff3c262be in lldb::SBCommandInterpreterRunResult::SBCommandInterpreterRunResult(lldb::SBCommandInterpreterRunResult const&) /home/maskray/llvm/lldb/source/API/SBCommandInterpreterRunOptions.cpp:210:19
    #2 0x7ffff3c280c1 in lldb_private::repro::construct<lldb::SBCommandInterpreterRunResult (lldb::SBCommandInterpreterRunResult const&)>::record(lldb::SBCommandInterpreterRunResult const&) /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:944:51
    #3 0x7ffff3c29869 in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:465:14
    #4 0x7ffff3c29869 in doit /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:454:14
    #5 0x7ffff3c29869 in Replay /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:488:9
    #6 0x7ffff3c29869 in lldb_private::repro::DefaultReplayer<lldb::SBCommandInterpreterRunResult* (lldb::SBCommandInterpreterRunResult const&)>::operator()(lldb_private::repro::Deserializer&) const /home/maskray/llvm/lldb/include/lldb/Utility/ReproducerInstrumentation.h:483:5
    #7 0x7ffff421975d in lldb_private::repro::Registry::Replay(lldb_private::repro::Deserializer&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:131:22
    #8 0x7ffff42194ff in Replay /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:108:10
    #9 0x7ffff42194ff in lldb_private::repro::Registry::Replay(lldb_private::FileSpec const&) /home/maskray/llvm/lldb/source/Utility/ReproducerInstrumentation.cpp:103:10
    #10 0x7ffff3d66b59 in lldb::SBReproducer::Replay(char const*, lldb::SBReplayOptions const&) /home/maskray/llvm/lldb/source/API/SBReproducer.cpp:263:12
    #11 0x28516c in InitializeReproducer /home/maskray/llvm/lldb/tools/driver/Driver.cpp:819:13
    #12 0x28516c in main /home/maskray/llvm/lldb/tools/driver/Driver.cpp:907:24
    #13 0x7ffff0734d09 in __libc_start_main csu/../csu/libc-start.c:308:16

SUMMARY: LeakSanitizer: 1136 byte(s) leaked in 29 allocation(s).
rupprecht added inline comments.Apr 19 2021, 6:11 PM
lldb/tools/driver/Driver.cpp
856

This is no longer a leak (at least in the technical sense of "never freed, but also never inaccessible). Either remove this comment, or figure out if this is a load-bearing leak :)

JDevlieghere accepted this revision.Apr 19 2021, 6:37 PM

This LGTM

@JDevlieghere The Reproducer library seems to have several other leaks. Maybe you'd like to look at them? :) I am unfamiliar with the code...

Unfortunately I don't have bandwidth to look at that right now. IIRC there were a few places where we leaked on purpose during replay (we shouldn't be leaking anything during capture tho), but I'd have to take another look at the code to remember the details.

This revision is now accepted and ready to land.Apr 19 2021, 6:37 PM
MaskRay updated this revision to Diff 338688.Apr 19 2021, 7:34 PM
MaskRay marked an inline comment as done.

remove a stale comment

This revision was landed with ongoing or failed builds.Apr 19 2021, 7:39 PM
This revision was automatically updated to reflect the committed changes.
dblaikie added inline comments.
lldb/tools/driver/Driver.cpp
857

Can this code execute more than once? If it does I guess it'll really leak?

(if it's not meant to be called more than once, maybe something like:

static std::string *x = nullptr;
assert(!x);
x = new std::string(argv0);
...
MaskRay marked an inline comment as done.Apr 19 2021, 9:52 PM
MaskRay added inline comments.
lldb/tools/driver/Driver.cpp
857

The function is only executed once.

dblaikie added inline comments.Apr 20 2021, 10:03 AM
lldb/tools/driver/Driver.cpp
857

If that's not enforced in any way (at least I can't see any) & the rest of the code looks like it would be OK being called more than once (I think?) - might be worth some checking?

MaskRay marked 2 inline comments as done.Apr 20 2021, 10:18 AM
MaskRay added inline comments.
lldb/tools/driver/Driver.cpp
857

The function is oneshot and from the called functions it should be clear the function cannot be executed more than once (otherwise, duplicate error messages).

I changed the function to static so that it is clear this is not used a library function.