On Wed, Dec 05, 2012 at 03:49:52PM +0100, Jakub Jelinek wrote:
> +FAIL: g++.dg/asan/asan_test.C  -O2  AddressSanitizer_PthreadExitTest 
> execution test
> 
> but that looks like a library problem to me:
> 
> AddressSanitizer CHECK failed: 
> ../../../../../libsanitizer/asan/asan_rtl.cc:271 "((curr_thread)) != (0)" 
> (0x0, 0x0)

Actually, the problem was that libasan was linked in after libpthread. 
Perhaps we need some driver hacks to make sure -lasan comes before -lpthread
when added automatically for -fsanitize=address (and similarly for -ltsan).
For now just tweaking dg-options.

Ok for trunk? (of course, depends on all the earlier patches from today and
Wei's patch).

With this the only failures I get are:
FAIL: g++.dg/asan/asan_test.C  -O2  AddressSanitizer_BitFieldPositiveTest 
x->bf1 = 0 execution test
FAIL: g++.dg/asan/asan_test.C  -O2  AddressSanitizer_BitFieldPositiveTest 
x->bf2 = 0 execution test
FAIL: g++.dg/asan/asan_test.C  -O2  AddressSanitizer_BitFieldPositiveTest 
x->bf3 = 0 execution test
FAIL: g++.dg/asan/asan_test.C  -O2  AddressSanitizer_BitFieldPositiveTest 
x->bf4 = 0 execution test
FAIL: g++.dg/asan/asan_test.C  -O2  AddressSanitizer_GlobalStringConstTest 
Ident(p[15]) execution test
FAIL: g++.dg/asan/asan_test.C  -O2  AddressSanitizer_FileNameInGlobalReportTest 
Ident(p[15]) output pattern test, should match zoo.*asan_test.cc
which is 4x missing bitfield instrumentation and twice unanalyzed thing.

2012-12-05  Jakub Jelinek  <ja...@redhat.com>

        * g++.dg/asan/asan_test.C: Link -lasan before -lpthread.
        * g++.dg/asan/deep-thread-stack-1.C: Likewise.  Remove dg-skip-if.

--- gcc/testsuite/g++.dg/asan/asan_test.C.jj    2012-12-03 12:43:20.000000000 
+0100
+++ gcc/testsuite/g++.dg/asan/asan_test.C       2012-12-05 15:50:36.686157455 
+0100
@@ -2,7 +2,7 @@
 // { dg-skip-if "" { *-*-* } { "*" } { "-O2" } }
 // { dg-skip-if "" { *-*-* } { "-flto" } { "" } }
 // { dg-additional-sources "asan_globals_test.cc" }
-// { dg-options "-fsanitize=address -fno-builtin -Wall -Wno-format -Werror -g 
-DASAN_UAR=0 -DASAN_HAS_EXCEPTIONS=1 -DASAN_HAS_BLACKLIST=0 
-DASAN_USE_DEJAGNU_GTEST=1 -lpthread -ldl" }
+// { dg-options "-fsanitize=address -fno-builtin -Wall -Wno-format -Werror -g 
-DASAN_UAR=0 -DASAN_HAS_EXCEPTIONS=1 -DASAN_HAS_BLACKLIST=0 
-DASAN_USE_DEJAGNU_GTEST=1 -lasan -lpthread -ldl" }
 // { dg-additional-options "-DASAN_NEEDS_SEGV=1" { target { ! arm*-*-* } } }
 // { dg-additional-options "-DASAN_LOW_MEMORY=1 -DASAN_NEEDS_SEGV=0" { target 
arm*-*-* } }
 // { dg-additional-options "-DASAN_AVOID_EXPENSIVE_TESTS=1" { target { ! 
run_expensive_tests } } }
--- gcc/testsuite/g++.dg/asan/deep-thread-stack-1.C.jj  2012-12-05 
11:45:31.000000000 +0100
+++ gcc/testsuite/g++.dg/asan/deep-thread-stack-1.C     2012-12-05 
15:51:20.687897439 +0100
@@ -1,6 +1,5 @@
 // { dg-do run { target pthread } }
-// { dg-skip-if "" { *-*-* } { "*" } { "" } }
-// { dg-options "-lpthread" }
+// { dg-options "-lasan -lpthread" }
 // { dg-shouldfail "asan" }
 
 #include <pthread.h>


        Jakub

Reply via email to