itc-benchmarks
itc-benchmarks copied to clipboard
Binaries optimized out
Hi, first place, good work for making these test cases available! Thanks!
Autoconf is generating Makefiles with CFLAGS='-g -O2', and -O2 will optimized lots of parts of the code since most of it just exist to support the vulnerability.
For example: https://github.com/regehr/itc-benchmarks/blob/master/01.w_Defects/free_null_pointer.c#L452, should receive a SIGSEGV, since ptr is NULL and is being accessed. But it actually doesn't crash since -O2 is on, so GCC optimized out that line.
I'd recommend adding the following line to your README.md: ./configure CFLAGS='-g' CXXFLAGS='-g', will prevent from passing -O to GCC
in case someone wants to make binary analysis.