develooper Front page | perl.perl5.porters | Postings from September 2016

sanitize=undefined

From:
Jarkko Hietaniemi
Date:
September 20, 2016 12:03
Subject:
sanitize=undefined
Message ID:
956e6814-c5be-5be2-be02-9ae9b4a42ccb@iki.fi
The -fsanitize=undefined seems to be getting much better in both
gcc and clang.  I tried configuring in OS X as:

sh Configure -des -Dusedevel -Dcc=clang-mp-3.9 
-Accflags='-fsanitize=address,undefined' 
-Aldflags='-fsanitize=address,undefined'

(the clang-mp-3.9 is the MacPorts clang)

Note that I configured also with "asan".  This is possible, as in,
the sanitizers can coexist.  The downside is that the "AddressSanitizer"
label gets overused a bit in the reports (at least with clang, didn't
try gcc).  But the point is that the "ubsan" will insert its checks,
visible in the output as "runtime".

Built miniperl, and ran minitest. 18 failures, log attached, linenumbers 
as of blead edc2c47a7af2b67f9541072b69a97b21f56cdcd4

By default ubsan just warns about the problem and doesn't halt, if you 
want that, run with

env UBSAN_OPTIONS=halt_on_error=1 ...

More information for clang and gcc:

http://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html








nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About