29

Use UndefinedBehaviourSanitizer (UBSAN)

Enable it like that:

gcc/clang:

$ $CC -fsanitize=undefined $CFLAGS ...

meson (> 0.55.0):

$ meson compile -Db_sanitize=undefined ...
#EmbeddedLinux
The Undefined Behaviour Sanitizer, in short UBSAN, can detect undefined behaviour like out-of-bounds errors or null pointer dereference by modifying the program at compile time during debugging. Like ASAN, it can be activated with a command-line switch.
Icon with a waving hand

Get in touch

sigma star gmbh
Eduard-Bodem-Gasse 6, 1st floor
6020 Innsbruck | Austria

sigma star gmbh logo