From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22477 invoked by alias); 13 Dec 2012 15:22:48 -0000 Received: (qmail 22464 invoked by uid 22791); 13 Dec 2012 15:22:48 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_LV X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 13 Dec 2012 15:22:33 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBDFMADu022140 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 13 Dec 2012 10:22:10 -0500 Received: from zalov.redhat.com (vpn1-5-170.ams2.redhat.com [10.36.5.170]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qBDFM8fY031635 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 13 Dec 2012 10:22:09 -0500 Received: from zalov.cz (localhost [127.0.0.1]) by zalov.redhat.com (8.14.5/8.14.5) with ESMTP id qBDFM7bZ021129; Thu, 13 Dec 2012 16:22:07 +0100 Received: (from jakub@localhost) by zalov.cz (8.14.5/8.14.5/Submit) id qBDFM6Ru021128; Thu, 13 Dec 2012 16:22:06 +0100 Date: Thu, 13 Dec 2012 15:22:00 -0000 From: Jakub Jelinek To: Konstantin Serebryany Cc: Dodji Seketeli , Wei Mi , Mike Stump , GCC Patches , David Li , Diego Novillo , Kostya Serebryany , Dodji Seketeli , Alexander Potapenko , Evgeniy Stepanov , Alexey Samsonov , Dmitry Vyukov Subject: Re: [PATCH] asan unit tests from llvm lit-test incremental changes Message-ID: <20121213152206.GU2315@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <20121128101420.GG2315@tucnak.redhat.com> <20121203110018.GR2315@tucnak.redhat.com> <20121205122906.GO2315@tucnak.redhat.com> <87ehivq8ce.fsf@redhat.com> <20121212213013.GH2315@tucnak.redhat.com> <20121213083653.GL2315@tucnak.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-12/txt/msg00923.txt.bz2 On Thu, Dec 13, 2012 at 02:22:52PM +0400, Konstantin Serebryany wrote: > I've added two flags, both on by default for now. > > // Use fast (frame-pointer-based) unwinder on fatal errors (if available). > bool fast_unwind_on_fatal; > // Use fast (frame-pointer-based) unwinder on malloc/free (if available). > bool fast_unwind_on_malloc; > > > % clang -fsanitize=address -g > ~/llvm/projects/compiler-rt/lib/asan/lit_tests/overflow-in-qsort.cc > % ASAN_OPTIONS=fast_unwind_on_fatal=0 ./a.out 2>&1 | asan_symbolize.py > / | grep '#' > #0 0x419731 in QsortCallback overflow-in-qsort.cc:18 > #1 0x7fa7e137b61f in msort_with_tmp msort.c:143 > #2 0x7fa7e137baba in msort_with_tmp msort.c:46 > #3 0x419a58 in MyQsort overflow-in-qsort.cc:25 > #4 0x419c94 in main overflow-in-qsort.cc:33 > #5 0x7fa7e136276c in __libc_start_main libc-start.c:226 > #6 0x4193ac in _start ??:0 > % ASAN_OPTIONS=fast_unwind_on_fatal=1 ./a.out 2>&1 | asan_symbolize.py > / | grep '#' > #0 0x419731 in QsortCallback overflow-in-qsort.cc:18 > #1 0x7f816783f61f in msort_with_tmp msort.c:143 > % > > This feature still needs some love. > I'll set fast_unwind_on_fatal to 0 after some testing and then merge > to gcc (unless there is a rush). I'll wait for your commit, then will test it on Fedora. msort.c and qsort.c are definitely built with -fasynchronous-unwind-tables -fexceptions though, at least by default. > If we want to support new handler and allow asan's malloc to return 0, > it is much easier and cleaner to implement it from scratch. libstdc++ doesn't have __new_handler exported I think, and there is no way to query it outside of libstdc++ itself though. One can only set it. Jakub