goblint / analyzer

Static analysis framework for C
https://goblint.in.tum.de
MIT License
184 stars 75 forks source link

Fix regression tests with fortify source #706

Open sim642 opened 2 years ago

sim642 commented 2 years ago

Using _FORTIFY_SOURCE (and the optimization required for it), regression tests can be run with:

gobopt='--set pre.cppflags[+] -D_FORTIFY_SOURCE=2 --set pre.cppflags[+] -O3' ./scripts/update_suite.rb

I used these options to debug MacOS failures following #696, since apparently MacOS seems to do some fortification by default (and thus use alternative built-in bounds-checked versions of some special functions using macro definitions).

Failures

As of writing, this causes 8 tests to fail:

TODO

sim642 commented 2 years ago

04/71 memset_direct_rc is just because the the fortified version replaces memset with a macro that calls an inline function instead, so the race location ends up being there, not where the macro was expanded from. Not sure if there's anything to do about that.

The fileUse analysis ones are probably because it doesn't handle some _chk versions of the functions.