This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add support for -fno-sanitize-recover and -fsanitize-undefined-trap-on-error (PR sanitizer/60275)
- From: Ramana Radhakrishnan <ramana dot gcc at googlemail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Richard Biener <rguenther at suse dot de>, Marek Polacek <polacek at redhat dot com>, Dodji Seketeli <dseketel at redhat dot com>, Konstantin Serebryany <konstantin dot s dot serebryany at gmail dot com>, Tobias Burnus <burnus at net-b dot de>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Richard Sandiford <rdsandiford at googlemail dot com>
- Date: Thu, 15 May 2014 11:39:26 +0100
- Subject: Re: [PATCH] Add support for -fno-sanitize-recover and -fsanitize-undefined-trap-on-error (PR sanitizer/60275)
- Authentication-results: sourceware.org; auth=none
- References: <20140415101156 dot GB1817 at tucnak dot redhat dot com> <87a9ajfi5r dot fsf at talisman dot default> <20140515103357 dot GL10386 at tucnak dot redhat dot com>
- Reply-to: ramrad01 at arm dot com
On Thu, May 15, 2014 at 11:33 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Thu, May 15, 2014 at 11:30:40AM +0100, Richard Sandiford wrote:
>> Jakub Jelinek <jakub@redhat.com> writes:
>> > This patch adds two new options (compatible with clang) which allow
>> > users to choose the behavior of undefined behavior sanitization.
>> >
>> > By default as before, all undefined behaviors (except for
>> > __builtin_unreachable and missing return in C++) continue after reporting
>> > which means that you can get lots of runtime errors from a single program
>> > run and the exit code will not reflect the failure in that case.
>> >
>> > With this patch, one can use -fsanitize=undefined -fno-sanitize-recover,
>> > which will report just the first undefined behavior and then exit with
>> > non-zero code.
>>
>> Would it make sense for this to be the default for bootstrap-ubsan,
>> so that the bootstrap fails on undefined behaviour?
>
> Perhaps eventually, but is current bootstrap-ubsan really ubsan error free
> on at least the major targets? I've made some efforts towards that goal on
> x86_64-linux, but haven't tried bootstrap-ubsan recently.
What's the overhead with bootstrap-ubsan ?
Ramana
>
> Jakub