This is an archive of the discontinued LLVM Phabricator instance.

Add new ASAN_OPTION: sleep_after_init.
ClosedPublic

Authored by marxin on Jul 14 2017, 4:34 AM.

Diff Detail

Event Timeline

marxin created this revision.Jul 14 2017, 4:34 AM
kcc edited edge metadata.Jul 14 2017, 9:53 AM

code LGTM, please add a test (sleep for 1 second, verify that "Sleeping for 1 second(s)" is printed

In D35409#809729, @kcc wrote:

code LGTM, please add a test (sleep for 1 second, verify that "Sleeping for 1 second(s)" is printed

Sure. May I please ask you for advise about how to run a single test?

kcc added a comment.Jul 31 2017, 11:47 AM

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.

marxin added a comment.Aug 1 2017, 5:50 AM

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

marxin added a comment.Aug 2 2017, 6:17 AM

So the problem with test-suite will be related to openSUSE, I've already create bug for that.

marxin updated this revision to Diff 109328.Aug 2 2017, 6:18 AM

Update versioin where I added test-case. It's verified that it passes regression tests.

kcc accepted this revision.Aug 2 2017, 10:17 AM

LGTM
You don't have commit access, do you?
I'll land it later today, unless someone else beats me to it.

This revision is now accepted and ready to land.Aug 2 2017, 10:17 AM
kcc closed this revision.Aug 2 2017, 11:49 AM
marxin added a comment.Aug 3 2017, 2:12 AM

Yes, thanks for review and please install the patch.