Teach all sanitizers to call abort() instead of _exit() after printing
an error report, if requested. This behavior is the default on Mac OS.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Alexey, there are two test failures with this change. The test sanitizer_common/TestCases/Darwin/abort_on_error.cc fails with
Undefined symbols for architecture i386: "__sanitizer::Die()", referenced from: _main in abort_on_error-4d1da3.o ld: symbol(s) not found for architecture i386
because __sanitizer::Die() is not an exported symbol. The second failure is in sanitizer_common/TestCases/options-include.cc:
Exit Code: 1 Error: Abort trap: 6
This is because the test overrides %tool_options without inheriting the default ones (like we do with %env_asan_opts in ASan lit tests). Therefore the test crashes on OS X instead of just quitting with a non-zero exit code.
%env_tool_opts='' not --crash %run %t doesn't work because it expands to env ASAN_OPTIONS=abort_on_error=0:'' not --crash .... How about introducing something like:
config.substitutions.append( ('%env_tool_opts_var_name', tool_options))
and then using it with %env_tool_opts_var_name='' not --crash %run %t? With that, all the tests pass (on OS X).
Kuba