[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] UBSAN flags
From: |
Greg Chicares |
Subject: |
Re: [lmi] UBSAN flags |
Date: |
Sat, 4 Jun 2022 20:19:19 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 |
On 6/4/22 15:03, Vadim Zeitlin wrote:
> On Sat, 4 Jun 2022 00:26:14 +0000 Greg Chicares <gchicares@sbcglobal.net>
> wrote:
>
> GC> This attempt to compile only 'i7702.cpp' didn't look like
> GC> it would succeed, so I Ctrl-C'd it after 78 minutes.
[...snip lengthy full command line...]
> Thanks for pasting the full command, I could reproduce the problem using
> it and by removing the differences between it and the working command line
> used in autotools build I could find the culprit: I'd have never guessed
> it, but it's the -Wduplicated-branches option.
Confirmed. With that option suppressed, all unit tests build in about
five minutes ("5:21.16 total").
Maybe we should turn off all warnings for "sanitizer" builds? No: that
saves zero time ("5:22.59 total"), and while it still catches this:
input_test.cpp:165 ... runtime error: load of value 25000
it doesn't catch the other error you reported (something like bool=2).
Whether with or without warning options, it also catches
fdlibm_expm1.c:243:13: runtime error: left shift of negative value -2
which may have been exposed by a test I added only recently.
> GC> Am I missing something obvious?
>
> This is clearly a bug in gcc. Of course, knowing the bug is it was simple
> to find the existing https://gcc.gnu.org/bugzilla//show_bug.cgi?id=82952
> which is exactly about this. I've subscribed to it to be notified if/when
> it is fixed, but for now it seems we need to have different warning flags
> for the UBSAN build too.
Seems like they ought to suppress that warning with UBSAN, which
would seem easy enough, or at least issue a warning:
You are using the undefined-behavior sanitizer with
'-Wduplicated-branches', which is known to be a
problematic combination: see gcc bugzilla #82952.
because anyone who goes to the trouble of using UBSAN is likely to
enable all plausible warnings including '-Wduplicated-branches', no?
It's surprising that this crucial point isn't mentioned in any
obvious place like a FAQ--but there seems to be no FAQ.
Maybe it'll help in a small way if I list some likely keywords here
so that a web search might find this message:
undefined behavior sanitizer UBSAN gcc slow hangs too-long
- Re: [lmi] Unit tests hygiene, Greg Chicares, 2022/06/03
- Re: [lmi] Unit tests hygiene, Vadim Zeitlin, 2022/06/03
- [lmi] UBSAN flags [Was: Unit tests hygiene], Greg Chicares, 2022/06/03
- Re: [lmi] UBSAN flags, Vadim Zeitlin, 2022/06/03
- Re: [lmi] UBSAN flags, Greg Chicares, 2022/06/03
- Re: [lmi] UBSAN flags, Vadim Zeitlin, 2022/06/04
- Re: [lmi] UBSAN flags,
Greg Chicares <=
- Re: [lmi] UBSAN flags, Greg Chicares, 2022/06/06
- Re: [lmi] UBSAN flags, Vadim Zeitlin, 2022/06/06
- Re: [lmi] UBSAN flags, Greg Chicares, 2022/06/06
- Re: [lmi] UBSAN flags, Vadim Zeitlin, 2022/06/06
- Re: [lmi] UBSAN flags, Greg Chicares, 2022/06/07