This is an archive of the discontinued LLVM Phabricator instance.

Make lsan complain loudly when running under ptrace
ClosedPublic

Authored by kcc on Oct 12 2016, 5:38 PM.

Details

Summary

LeakSanitizer does not work with ptrace but currently it
will print warnings (only under verbosity=1) and then proceed
to print tons of false reports.
This patch makes lsan fail hard under ptrace with a verbose message.

https://github.com/google/sanitizers/issues/728

Event Timeline

kcc updated this revision to Diff 74461.Oct 12 2016, 5:38 PM
kcc retitled this revision from to Make lsan complain loudly when running under ptrace.
kcc updated this object.
kcc added reviewers: eugenis, vitalybuka, aizatsky.
kcc added a subscriber: llvm-commits.
aizatsky accepted this revision.Oct 13 2016, 1:18 PM
aizatsky edited edge metadata.

Thanks.

This revision is now accepted and ready to land.Oct 13 2016, 1:18 PM
kcc updated this object.Oct 13 2016, 3:42 PM
kcc edited edge metadata.
kcc closed this revision.Oct 13 2016, 3:43 PM
thakis added a subscriber: thakis.Dec 15 2016, 11:29 PM
thakis added inline comments.
test/lsan/TestCases/strace_test.cc
3

Apparently strace doesn't exist on all the bots:

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-debian-fast/builds/971/steps/test/logs/stdio

/home/llvmbb/llvm-build-dir/llvm-clang-lld-x86_64-debian-fast/llvm.src/projects/compiler-rt/test/lsan/TestCases/strace_test.cc:13:11: error: expected string not found in input
// CHECK: LeakSanitizer has encountered a fatal error
          ^
<stdin>:1:1: note: scanning from here
Error: Unable to find `strace' in PATH: No such file or directory

Maybe this needs a "requires:" line, or that bot needs strace installed. (Not sure, and not my bot, so I don't care much, just happened to see it.)