]> git.ipfire.org Git - thirdparty/systemd.git/commit
tests: pass halt_on_error=1 to UBSan
authorEvgeny Vereshchagin <evvers@ya.ru>
Wed, 10 Oct 2018 02:36:36 +0000 (02:36 +0000)
committerLennart Poettering <lennart@poettering.net>
Thu, 11 Oct 2018 06:55:04 +0000 (08:55 +0200)
commit2614d83aa06592aedbab82ff877bc461d0c481fd
tree601122f96502981a25a49389250172484111911f
parent3118a4cf17fa941bfe1058481369edbd17ff1660
tests: pass halt_on_error=1 to UBSan

By default, UBSan neither crashes nor exits with a non-zero exit code
when undefined behavior has been detected. This is problematic because
it makes it much harder to catch issues like https://github.com/systemd/systemd/issues/10346,
 https://github.com/systemd/systemd/issues/10347, and https://github.com/systemd/systemd/issues/10333.
In fact, those issue were found just because I decided to grep
the test log, which isn't something that I normally do :-)

As it turns out, the only way to make UBSan signal that something is wrong that works more or less
reliably everywhere is to pass halt_on_error=1 (though, it's probably worth noting that it's currently
not set for PID1 in order not to trigger kernel panics).

See https://reviews.llvm.org/D35085#804183 and https://chromium.googlesource.com/chromium/src/testing/libfuzzer/+/HEAD/reference.md
test/test-functions