itc-benchmarks icon indicating copy to clipboard operation
itc-benchmarks copied to clipboard

Binaries optimized out

Open chaws opened this issue 8 years ago • 0 comments

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.

chaws avatar May 04 '16 22:05 chaws