[PATCH] D40768: [msan] LIT: Add lld testing config
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 6 01:32:35 PST 2017
lebedev.ri added a comment.
In https://reviews.llvm.org/D40768#945946, @eugenis wrote:
> LLD fixed in r319860.
> Please check that you see the same error in the dtls test with and without lld, and remove the XFAIL line.
================
Comment at: test/msan/dtls_test.c:10
+// Fails with assert(handle != 0); with LLD.
+// XFAIL: lld
----------------
eugenis wrote:
> lebedev.ri wrote:
> > eugenis wrote:
> > > Do you mean the one on line 49? What does the error message on line 48 say?
> > ```
> > [6/7] Running the MemorySanitizer tests
> > FAIL: MemorySanitizer-X86_64 :: dtls_test.c (618 of 842)
> > ******************** TEST 'MemorySanitizer-X86_64 :: dtls_test.c' FAILED ********************
> > Script:
> > --
> > /build/llvm-build-Clang-release/./bin/clang -fsanitize=memory -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -g /build/compiler-rt/test/msan/dtls_test.c -o /build/llvm-build-Clang-release/projects/compiler-rt/test/msan/X86_64/Output/dtls_test.c.tmp
> > /build/llvm-build-Clang-release/./bin/clang -fsanitize=memory -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -g /build/compiler-rt/test/msan/dtls_test.c -DBUILD_SO -fPIC -o /build/llvm-build-Clang-release/projects/compiler-rt/test/msan/X86_64/Output/dtls_test.c.tmp-so.so -shared
> > /build/llvm-build-Clang-release/projects/compiler-rt/test/msan/X86_64/Output/dtls_test.c.tmp 2>&1
> > --
> > Exit Code: 77
> >
> > Command Output (stdout):
> > --
> > ==5943==WARNING: MemorySanitizer: use-of-uninitialized-value
> > #0 0x48d683 in Thread1 /build/compiler-rt/test/msan/dtls_test.c:22:7
> > #1 0x7f223997f518 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x7518)
> > #2 0x7f2238d7ca5e in clone (/lib/x86_64-linux-gnu/libc.so.6+0xeca5e)
> >
> > SUMMARY: MemorySanitizer: use-of-uninitialized-value /build/compiler-rt/test/msan/dtls_test.c:22:7 in Thread1
> > Exiting
> >
> > --
> >
> > ********************
> > FAIL: MemorySanitizer-lld-X86_64 :: dtls_test.c (749 of 842)
> > ******************** TEST 'MemorySanitizer-lld-X86_64 :: dtls_test.c' FAILED ********************
> > Script:
> > --
> > /build/llvm-build-Clang-release/./bin/clang -fsanitize=memory -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -fuse-ld=lld -gline-tables-only -g /build/compiler-rt/test/msan/dtls_test.c -o /build/llvm-build-Clang-release/projects/compiler-rt/test/msan/lld-X86_64/Output/dtls_test.c.tmp
> > /build/llvm-build-Clang-release/./bin/clang -fsanitize=memory -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -fuse-ld=lld -gline-tables-only -g /build/compiler-rt/test/msan/dtls_test.c -DBUILD_SO -fPIC -o /build/llvm-build-Clang-release/projects/compiler-rt/test/msan/lld-X86_64/Output/dtls_test.c.tmp-so.so -shared
> > /build/llvm-build-Clang-release/projects/compiler-rt/test/msan/lld-X86_64/Output/dtls_test.c.tmp 2>&1
> > --
> > Exit Code: 134
> >
> > Command Output (stdout):
> > --
> > /build/llvm-build-Clang-release/projects/compiler-rt/test/msan/lld-X86_64/Output/dtls_test.c.tmp-so.so: undefined symbol: __msan_retval_tls
> > dtls_test.c.tmp: /build/compiler-rt/test/msan/dtls_test.c:44: int main(int, char **): Assertion `handle != 0' failed.
> >
> > --
> > Command Output (stderr):
> > --
> > /build/llvm-build-Clang-release/projects/compiler-rt/test/msan/lld-X86_64/Output/dtls_test.c.script: line 3: 9429 Aborted /build/llvm-build-Clang-release/projects/compiler-rt/test/msan/lld-X86_64/Output/dtls_test.c.tmp 2>&1
> >
> > --
> >
> > ********************
> > Testing Time: 45.72s
> > ********************
> > Failing Tests (2):
> > MemorySanitizer-X86_64 :: dtls_test.c
> > MemorySanitizer-lld-X86_64 :: dtls_test.c
> >
> > Expected Passes : 838
> > Expected Failures : 2
> > Unexpected Failures: 2
> > FAILED: projects/compiler-rt/test/msan/CMakeFiles/check-msan
> > cd /build/llvm-build-Clang-release/projects/compiler-rt/test/msan && /usr/bin/python2.7 /build/llvm-build-Clang-release/./bin/llvm-lit -sv /build/llvm-build-Clang-release/projects/compiler-rt/test/msan/X86_64 /build/llvm-build-Clang-release/projects/compiler-rt/test/msan/lld-X86_64 /build/llvm-build-Clang-release/projects/compiler-rt/test/msan/Unit
> > ninja: build stopped: subcommand failed.
> > ```
> The first failure means that dtls handling in sanitizer_common is broken on your machine. Must be a new or otherwise unsupported glibc version. It's a mess. Out of curiosity, what is your version?
>
> The second is even more interesting. LLD does not re-export msan interface symbols from executables. Compare objdump -T path/to/binary | grep __msan with and without lld. It's a dumb bug in lld, it's great that we caught it. I'll fix.
> The first failure means that dtls handling in sanitizer_common is broken on your machine. Must be a new or otherwise unsupported glibc version. It's a mess. Out of curiosity, what is your version?
This is debian sid, amd64.
```
$ dpkg -l | grep glibc
ii glibc-doc 2.25-3 all GNU C Library: Documentation
ii glibc-doc-reference 2.25-1 all GNU C Library: Documentatio
```
> The second is even more interesting. LLD does not re-export msan interface symbols from executables. Compare objdump -T path/to/binary | grep __msan with and without lld. It's a dumb bug in lld, it's great that we caught it. I'll fix.
Ooh, nice, so this doubling of the test time actually caught something :)
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D40768
More information about the llvm-commits
mailing list