As mentioned in https://github.com/google/sanitizers/issues/834, suggested option can be handy for debugging.
Details
Diff Detail
Event Timeline
code LGTM, please add a test (sleep for 1 second, verify that "Sleeping for 1 second(s)" is printed
Take a look at test/asan/TestCases/sleep_before_dying.c,
you will need a similar one.
Then, run 'ninja check-asan'.
It should fail w/o your change and pass with your change.
Running:
$ make check
I see:
[ 98%] Built target clang
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/7/../../../libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/7/../../../libpthread.so when searching for -lpthread
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/7/../../../librt.so when searching for -lrt
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/7/../../../libm.so when searching for -lm
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/7/../../../libdl.so when searching for -ldl
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/7/../../../libc.so when searching for -lc
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: i386:x86-64 architecture of input file `/usr/lib64/gcc/x86_64-suse-linux/7/../../../crt1.o' is incompatible with i386 output
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: i386:x86-64 architecture of input file `/usr/lib64/gcc/x86_64-suse-linux/7/../../../crti.o' is incompatible with i386 output
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: i386:x86-64 architecture of input file `/usr/lib64/gcc/x86_64-suse-linux/7/../../../crtn.o' is incompatible with i386 output
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/gcc/x86_64-suse-linux/7/../../../crt1.o: file class ELFCLASS64 incompatible with ELFCLASS32
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: final link failed: File in wrong format
clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: * [projects/compiler-rt/lib/asan/tests/CMakeFiles/Asan-i386-inline-Test.dir/build.make:67: projects/compiler-rt/lib/asan/tests/CMakeFiles/Asan-i386-inline-Test] Error 1
make[2]: * [CMakeFiles/Makefile2:20864: projects/compiler-rt/lib/asan/tests/CMakeFiles/Asan-i386-inline-Test.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:24869: projects/compiler-rt/test/asan/CMakeFiles/check-asan.dir/rule] Error 2
So the problem with test-suite will be related to openSUSE, I've already create bug for that.
Update versioin where I added test-case. It's verified that it passes regression tests.
LGTM
You don't have commit access, do you?
I'll land it later today, unless someone else beats me to it.