From: Jakub Jelinek <jakub@redhat.com>
To: Maxim Ostapenko <m.ostapenko@partner.samsung.com>
Cc: Kostya Serebryany <kcc@google.com>,
GCC Patches <gcc-patches@gcc.gnu.org>,
Yury Gribov <y.gribov@samsung.com>,
Vyacheslav Barinov <v.barinov@samsung.com>,
Slava Garbuzov <v.garbuzov@samsung.com>
Subject: Re: [PATCH 2/2] Libsanitizer merge from upstream r253555.
Date: Mon, 23 Nov 2015 08:20:00 -0000 [thread overview]
Message-ID: <20151123081918.GT5675@tucnak.redhat.com> (raw)
In-Reply-To: <5652C4CE.7020409@partner.samsung.com>
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 <string.h>
> +
> +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 <string.h>
> +
> +volatile int ten = 10;
> +
> +int main() {
> + char x[10];
> + memset(x, 0, 11);
Likewise.
Otherwise OK for trunk.
Jakub
prev parent reply other threads:[~2015-11-23 8:19 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-23 7:46 [PATCH 0/2] " Maxim Ostapenko
2015-11-23 7:48 ` [PATCH 1/2] " Maxim Ostapenko
2015-11-23 8:19 ` Jakub Jelinek
2015-11-23 12:24 ` Christophe Lyon
2015-11-23 12:37 ` Maxim Ostapenko
2015-11-23 12:42 ` Jakub Jelinek
2015-11-23 13:05 ` Christophe Lyon
2015-11-23 13:24 ` Maxim Ostapenko
2015-11-23 13:29 ` Jakub Jelinek
2015-11-24 8:08 ` Maxim Ostapenko
2015-11-24 8:30 ` Jakub Jelinek
2015-11-24 8:38 ` Maxim Ostapenko
2015-11-24 8:43 ` Jakub Jelinek
2015-11-24 8:58 ` Maxim Ostapenko
2015-11-24 9:24 ` Christophe Lyon
2015-11-24 11:12 ` Christophe Lyon
2015-11-24 11:23 ` Jakub Jelinek
2015-11-24 11:23 ` Christophe Lyon
2015-11-24 11:34 ` Jakub Jelinek
2015-11-24 11:57 ` Maxim Ostapenko
2015-11-24 12:06 ` Jakub Jelinek
2015-11-24 12:20 ` Christophe Lyon
2015-11-24 13:06 ` Maxim Ostapenko
2015-11-24 12:09 ` Yury Gribov
2015-11-23 8:06 ` [PATCH 2/2] " Maxim Ostapenko
2015-11-23 8:20 ` Jakub Jelinek [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151123081918.GT5675@tucnak.redhat.com \
--to=jakub@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=kcc@google.com \
--cc=m.ostapenko@partner.samsung.com \
--cc=v.barinov@samsung.com \
--cc=v.garbuzov@samsung.com \
--cc=y.gribov@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).