[PATCH] D35085: Respect exitcode sanitizer option in UBSan

Francis Ricci via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 13:18:27 PDT 2017


fjricci added a subscriber: compnerd.
fjricci added a comment.

It might be possible to change the default exitcode for UBSan, but I still think it should be possible for the user to make UBSan errors to return failure. Two primary reasons:

- Consistency: As far as I'm aware, all of the other sanitizers return a failing exit code when they detect an error in a program, and I'm not sure why UBSan should be different in that respect.
- Utility: A common use case I could imagine would be the case where a user wants to prevent UB regressions in their codebase by running a unit test suite with UBSan enabled. If it's not possible to return a failing exit code (either by default or otherwise), the test suite will continue passing just fine when UB is introduced.

A workaround that can be used currently to force a failing exit code on failure would be to use halt_on_error=1. However, it's not always desirable to limit error output to only one error (for example, brining up a unit test suite in a new codebase, where there may be many UB errors). In addition, ASan currently returns a failing exit code at the end of program execution even when halt_on_error=0 and it doesn't immediately abort.


https://reviews.llvm.org/D35085





More information about the llvm-commits mailing list