From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 911 invoked by alias); 23 Nov 2015 08:19:29 -0000 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 Received: (qmail 902 invoked by uid 89); 23 Nov 2015 08:19:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_50,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 23 Nov 2015 08:19:27 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 8F88A80082; Mon, 23 Nov 2015 08:19:25 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-34.ams2.redhat.com [10.36.116.34]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tAN8JNpF014571 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 23 Nov 2015 03:19:24 -0500 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id tAN8JLR7018667; Mon, 23 Nov 2015 09:19:22 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id tAN8JIhX018666; Mon, 23 Nov 2015 09:19:18 +0100 Date: Mon, 23 Nov 2015 08:20:00 -0000 From: Jakub Jelinek To: Maxim Ostapenko Cc: Kostya Serebryany , GCC Patches , Yury Gribov , Vyacheslav Barinov , Slava Garbuzov Subject: Re: [PATCH 2/2] Libsanitizer merge from upstream r253555. Message-ID: <20151123081918.GT5675@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <5652C3E0.4030000@partner.samsung.com> <5652C4CE.7020409@partner.samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5652C4CE.7020409@partner.samsung.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg02648.txt.bz2 On Mon, Nov 23, 2015 at 10:48:30AM +0300, Maxim Ostapenko wrote: > Index: gcc/testsuite/c-c++-common/asan/halt_on_error-1.c > =================================================================== > --- gcc/testsuite/c-c++-common/asan/halt_on_error-1.c (revision 0) > +++ gcc/testsuite/c-c++-common/asan/halt_on_error-1.c (working copy) > @@ -0,0 +1,23 @@ > +/* Test recovery mode. */ > +/* { dg-do run } */ > +/* { dg-options "-fsanitize-recover=address" } */ > +/* { dg-set-target-env-var ASAN_OPTIONS "halt_on_error=false" } */ > + > +#include > + > +volatile int ten = 10; > + > +int main() { > + char x[10]; > + memset(x, 0, 11); Please use ten + 1 instead of 11 here. With -fsanitize=address, there will be padding immediately after the variable, therefore otherwise (if the compiler does not see we are running into undefined behavior) the testcase might be ok. > --- gcc/testsuite/c-c++-common/asan/halt_on_error-2.c (revision 0) > +++ gcc/testsuite/c-c++-common/asan/halt_on_error-2.c (working copy) > @@ -0,0 +1,24 @@ > +/* Test recovery mode. */ > +/* { dg-do run } */ > +/* { dg-options "-fsanitize-recover=address" } */ > +/* { dg-set-target-env-var ASAN_OPTIONS "halt_on_error=true" } */ > +/* { dg-shouldfail "asan" } */ > + > +#include > + > +volatile int ten = 10; > + > +int main() { > + char x[10]; > + memset(x, 0, 11); Likewise. Otherwise OK for trunk. Jakub