UBSan and TSan
Find undefined behavior and races.
Two More Sanitizers
Beyond ASan, two sanitizers target different bug classes.
- UBSan: undefined behavior (overflow, bad shifts, null deref)
- TSan: data races in multithreaded code
Enabling UBSan
UndefinedBehaviorSanitizer is enabled with -fsanitize=undefined. It can combine with ASan.
g++ -fsanitize=undefined -g main.cpp -o app
./appAll lessons in this course
- Using gdb and lldb
- AddressSanitizer
- UBSan and TSan
- Valgrind Basics