Open llvmbot opened 3 years ago
so remaining issue:
Forget about the default exitcode part. I saw https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/asan/asan_flags.cpp#L60 and noticed the same is not there for ubsan. But I see now COMMON_FLAG already sets the default to 1, so it's not that it's missing in ubsan but that's redundant in asan.
and memprof=1
If I change that, I'd rather change all to 1 for consistency.
To make exitcode work you need -fno-sanitize-recover=undefined. Otherwise program continues execution and returns regular code.
Other sanitizers intercept _exit() and override programs code. It's possible and easy to do for ubsan too.
Regarding default exitcode, looks like we have inconsistency here which probably unsafe to change as it will break some users. exitcode for hwasan=99, lsan=23, tsan=66, ubsan=1, asan=1, msan=1
Extended Description
sanitizer_common/sanitizer_flags.inc defines the "exitcode" option.
AFAICS it's honoured by all the sanitizers except ubsan. All the sanitizers also seem to set it to some !=0 default value in a InitializeFlags() function, except ubsan.