[PATCH] D35443: Enable 64-bit Darwin LeakSanitizer by default on AddressSanitizer builds
Francis Ricci via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 18 14:57:16 PDT 2017
fjricci added a comment.
I'm running the swift stdlib test suite with LSan, and it complains about the dyld insertion:
dyld: warning: could not load inserted library '/Users/fjricci/Source/llvm/build/lib/clang/5.0.0/lib/darwin/libclang_rt.lsan_osx_dynamic.dylib' into library validated process because no suitable image found. Did find:
/Users/fjricci/Source/llvm/build/lib/clang/5.0.0/lib/darwin/libclang_rt.lsan_osx_dynamic.dylib: code signature in (/Users/fjricci/Source/llvm/build/lib/clang/5.0.0/lib/darwin/libclang_rt.lsan_osx_dynamic.dylib) not valid for use in process using Library Validation: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)
In addition to those warnings, it also reports a lot of leaks. For example:
Direct leak of 1024 byte(s) in 1 object(s) allocated from:
#0 0x10f81313e in wrap_malloc sanitizer_malloc_mac.inc:137
#1 0x1108bc788 in swift_slowAlloc Heap.cpp:28
#2 0x10f7ce9b0 in closure #1 in closure #8 in (a.out_swift4:x86_64+0x1000039b0)
#3 0x10f7df26b in partial apply for closure #1 in closure #8 in (a.out_swift4:x86_64+0x10001426b)
#4 0x10f7cead5 in thunk for @callee_owned () -> (@error @owned Error) (a.out_swift4:x86_64+0x100003ad5)
#5 0x10f7df312 in partial apply for thunk for @callee_owned () -> (@error @owned Error) (a.out_swift4:x86_64+0x100014312)
#6 0x11152e6f7 in autoreleasepool<A>(invoking:) ObjectiveC.swift:177
#7 0x10f7ce89d in closure #8 in (a.out_swift4:x86_64+0x10000389d)
#8 0x1115a3898 in specialized TestSuite._runTest(name:parameter:) StdlibUnittest.swift:1708
#9 0x11154d653 in _childProcess() <unknown>
#10 0x11155263f in runAllTests() StdlibUnittest.swift:1587
#11 0x10f7cbff8 in $defer #1 () in (a.out_swift4:x86_64+0x100000ff8)
#12 0x10f7cd909 in main (a.out_swift4:x86_64+0x100002909)
#13 0x7fffaf267234 in start (libdyld.dylib:x86_64+0x5234)
Direct leak of 44 byte(s) in 1 object(s) allocated from:
#0 0x10f81313e in wrap_malloc sanitizer_malloc_mac.inc:137
#1 0x7fffaf29b873 in _Block_copy (libsystem_blocks.dylib:x86_64+0x873)
#2 0x7fffaf231b75 in _dispatch_Block_copy (libdispatch.dylib:x86_64+0x1b75)
#3 0x7fffaf239e44 in dispatch_async (libdispatch.dylib:x86_64+0x9e44)
#4 0x10f812727 in wrap_dispatch_async lsan_mac.cc:160
#5 0x111082028 in _swift_dispatch_syncTm DispatchOverlayShims.h:129
#6 0x11107554b in DispatchQueue.async(execute:) Queue.swift:184
#7 0x10f7ce5dd in closure #6 in (a.out_swift4:x86_64+0x1000035dd)
#8 0x1115a3898 in specialized TestSuite._runTest(name:parameter:) StdlibUnittest.swift:1708
#9 0x11154d653 in _childProcess() <unknown>
#10 0x11155263f in runAllTests() StdlibUnittest.swift:1587
#11 0x10f7cbff8 in $defer #1 () in (a.out_swift4:x86_64+0x100000ff8)
#12 0x10f7cd909 in main (a.out_swift4:x86_64+0x100002909)
#13 0x7fffaf267234 in start (libdyld.dylib:x86_64+0x5234)
Assuming that these are false positives and not real leaks, and that we care about swift support, we should hold off on this patch.
https://reviews.llvm.org/D35443
More information about the llvm-commits
mailing list