lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] UBSAN flags


From: Vadim Zeitlin
Subject: Re: [lmi] UBSAN flags
Date: Sat, 4 Jun 2022 17:03:34 +0200

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.

 For the reference, compiling this file here takes less than 1 second
normally.

GC> Here's the command I used, but of course I've customized
GC> the makefile...
GC> 
GC> /opt/lmi/src/lmi[0]$time make $coefficiency unit_tests 
unit_test_targets=i7702_test build_type=ubsan 2>&1 |less -S
GC> make $coefficiency unit_tests unit_test_targets=i7702_test build_type=ubsan 
2  0.43s user 0.16s system 0% cpu 1:18:09.69 total
GC> less -S  0.01s user 0.00s system 0% cpu 1:20:10.86 total
GC> 
GC> ...so let me post the full command (everything that was
GC> in the 'less' session started above):
GC> 
GC> g++ -MMD -MP -MT i7702.o -MF i7702.d  -c -I /opt/lmi/src/lmi -I 
/opt/lmi/src/lmi/tools/pete-2.1.1 -isystem 
/opt/lmi/local/gcc_x86_64-pc-linux-gnu/lib/wx/include/gtk3-unicode-3.1 -isystem 
/opt/lmi/local/include/wx-3.1 -isystem /opt/lmi/third_party/include -isystem 
/opt/lmi/local/include -isystem /opt/lmi/local/include/libxml2 
-DLMI_WX_NEW_USE_SO     -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ 
-D_FILE_OFFSET_BITS=64   -fno-ms-extensions -frounding-math -std=c++20 
-pedantic-errors -Werror -Wall -Walloc-zero -Walloca -Wcast-align 
-Wcast-function-type -Wconversion -Wdangling-else -Wdeprecated-declarations 
-Wdisabled-optimization -Wdouble-promotion -Wduplicated-branches 
-Wduplicated-cond -Wextra -Wformat-nonliteral -Wformat-security 
-Wformat-signedness -Wformat-y2k -Wimport -Winvalid-pch -Wlogical-op 
-Wmissing-include-dirs -Wmultichar -Wnull-dereference -Wpacked -Wpointer-arith 
-Wredundant-decls -Wrestrict -Wshadow -Wsign-compare -Wstack-protector 
-Wswitch-enum -Wtrampolines -Wundef -Wunreachable-code -Wunused-macros 
-Wvector-operation-performance -Wno-parentheses  -Wc++11-compat -Wc++14-compat 
-Wc++1z-compat -Wcatch-value=3 -Wconditionally-supported -Wctor-dtor-privacy 
-Wdelete-non-virtual-dtor -Wdeprecated -Wextra-semi -Wnoexcept -Wnoexcept-type 
-Wnon-template-friend -Wnon-virtual-dtor -Wold-style-cast -Woverloaded-virtual 
-Wplacement-new=2 -Wpmf-conversions -Wregister -Wreorder -Wstrict-null-sentinel 
-Wsuggest-override -Wsynth -Wuseless-cast -Wzero-as-null-pointer-constant  
-Wcast-qual  -Wredundant-tags -Wvolatile     -O0 -fno-omit-frame-pointer -ggdb 
-fsanitize=undefined -fno-var-tracking-assignments -fPIC   
/opt/lmi/src/lmi/i7702.cpp -oi7702.o
GC> make[2]: *** [/opt/lmi/src/lmi/workhorse.make:925: i7702.o] Interrupt
GC> make[1]: [/opt/lmi/src/lmi/workhorse.make:1281: unit_tests] Interrupt 
(ignored)
GC> make: *** [GNUmakefile:240: /opt/lmi/gcc_x86_64-pc-linux-gnu/build/ubsan] 
Interrupt

 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. I.e. simply removing it from
the command above makes the compilation succeed.

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.

 Regards,
VZ

Attachment: pgpOchVUFHCWh.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]