From patchwork Wed Dec 5 15:06:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [asan] Handle noreturn calls with __asan_handle_no_return () X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 203884 Message-Id: <20121205150651.GW2315@tucnak.redhat.com> To: Konstantin Serebryany , Dodji Seketeli Cc: gcc-patches@gcc.gnu.org Date: Wed, 5 Dec 2012 16:06:51 +0100 From: Jakub Jelinek List-Id: 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 * g++.dg/asan/asan_test.C: Link -lasan before -lpthread. * g++.dg/asan/deep-thread-stack-1.C: Likewise. Remove dg-skip-if. Jakub --- 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