lmi
[Top][All Lists]
Advanced

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

Re: [lmi] Invalid pointer-pair?


From: Greg Chicares
Subject: Re: [lmi] Invalid pointer-pair?
Date: Fri, 10 Jun 2022 20:26:03 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0

On 6/10/22 19:47, Greg Chicares wrote:
[...]
> I've enabled too many '-fsanitize=', 'export ASAN_OPTIONS=", and
> '-Wwhatever' flags all at once, and now I'm trying to find a maximal
> subset that doesn't cause problems, while simultaneously changing
> parts of the source code. I hope to have something useful to say later.
Here's a pair of pointer-pair tests: the first fails, but the second succeeds,
apparently because it removes
  pointer-compare,pointer-subtract,
from '-fsanitize=' options.

The stuff below is just for reference, because if I didn't copy it here when
I have it available, I'd surely need it later. I think the only conclusion
to be drawn here is that those 'pointer-whatever' options don't work well
with gcc. I built all of lmi with these options, and got dozens of sanitizer
warnings that seemed to occur only with 'pointer-whatever'.

*** FAILS ***

g++ -MMD -MP -MT zero_test.o -MF zero_test.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 -fsignaling-nans 
-std=c++20 -pedantic-errors -Werror -Wall -Walloc-zero -Walloca 
-Wcast-align=strict -Wcast-function-type -Wconversion -Wdangling-else 
-Wdeprecated-declarations -Wdisabled-optimization -Wdouble-promotion 
-Wduplicated-branches -Wduplicated-cond -Wextra -Wformat=2 -Wformat-nonliteral 
-Wformat-overflow=2 -Wformat-security -Wformat-signedness -Wformat-y2k -Wimport 
-Winvalid-pch -Wlogical-op -Wmissing-include-dirs -Wmultichar 
-Wnull-dereference -Wpacked -Wpointer-arith -Wredundant-decls -Wrestrict 
-Wshadow -Wshift-overflow=2 -Wsign-compare -Wstack-protector 
-Wstringop-overflow=4 -Wswitch-enum -Wtrampolines -Wundef -Wunreachable-code 
-Wunused-macros -Wvector-operation-performance -Wvla -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      -ggdb 
-fsanitize=address,undefined,leak,pointer-compare,pointer-subtract,float-divide-by-zero,float-cast-overflow,bounds-strict
 -Wno-duplicated-branches -fno-omit-frame-pointer -fno-var-tracking 
-fno-var-tracking-assignments -O3 --param max-gcse-memory=1000000  -fPIC   
/opt/lmi/src/lmi/zero_test.cpp -ozero_test.o

g++ -o zero_test alert.o alert_cli.o fenv_lmi.o getopt.o license.o unwind.o 
null_stream.o zero_test.o -L . -L /opt/lmi/local/gcc_x86_64-pc-linux-gnu/lib -L 
/opt/lmi/local/gcc_x86_64-pc-linux-gnu/bin  -ldw -lunwind -ldl   -ggdb 
-fsanitize=address,undefined,leak,pointer-compare,pointer-subtract,float-divide-by-zero,float-cast-overflow,bounds-strict
 -Wno-duplicated-branches -fno-omit-frame-pointer -fno-var-tracking 
-fno-var-tracking-assignments -O3 --param max-gcse-memory=1000000  -fPIC 
-Wl,-Map,zero_test.map  -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro 
-Wl,-z,separate-code 

/usr/bin/ld: zero_test.o: in function `std::__cxx11::basic_stringbuf<char, 
std::char_traits<char>, std::allocator<char> >::str() const &':
/usr/include/c++/11/sstream:245: undefined reference to 
`std::__cxx11::basic_stringbuf<char, std::char_traits<char>, 
std::allocator<char> >::_M_high_mark() const'
collect2: error: ld returned 1 exit status

*** SUCCEEDS ***

g++ -MMD -MP -MT zero_test.o -MF zero_test.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 -fsignaling-nans 
-std=c++20 -pedantic-errors -Werror -Wall -Walloc-zero -Walloca 
-Wcast-align=strict -Wcast-function-type -Wconversion -Wdangling-else 
-Wdeprecated-declarations -Wdisabled-optimization -Wdouble-promotion 
-Wduplicated-branches -Wduplicated-cond -Wextra -Wformat=2 -Wformat-nonliteral 
-Wformat-overflow=2 -Wformat-security -Wformat-signedness -Wformat-y2k -Wimport 
-Winvalid-pch -Wlogical-op -Wmissing-include-dirs -Wmultichar 
-Wnull-dereference -Wpacked -Wpointer-arith -Wredundant-decls -Wrestrict 
-Wshadow -Wshift-overflow=2 -Wsign-compare -Wstack-protector 
-Wstringop-overflow=4 -Wswitch-enum -Wtrampolines -Wundef -Wunreachable-code 
-Wunused-macros -Wvector-operation-performance -Wvla -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      -ggdb 
-fsanitize=address,undefined,leak,float-divide-by-zero,float-cast-overflow,bounds-strict
 -Wno-duplicated-branches -fno-omit-frame-pointer -fno-var-tracking 
-fno-var-tracking-assignments -O3 --param max-gcse-memory=1000000  -fPIC   
/opt/lmi/src/lmi/zero_test.cpp -ozero_test.o

g++ -o zero_test alert.o alert_cli.o fenv_lmi.o getopt.o license.o unwind.o 
null_stream.o zero_test.o -L . -L /opt/lmi/local/gcc_x86_64-pc-linux-gnu/lib -L 
/opt/lmi/local/gcc_x86_64-pc-linux-gnu/bin  -ldw -lunwind -ldl   -ggdb 
-fsanitize=address,undefined,leak,float-divide-by-zero,float-cast-overflow,bounds-strict
 -Wno-duplicated-branches -fno-omit-frame-pointer -fno-var-tracking 
-fno-var-tracking-assignments -O3 --param max-gcse-memory=1000000  -fPIC 
-Wl,-Map,zero_test.map  -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro 
-Wl,-z,separate-code 


reply via email to

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