Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clang runtime checks: print backtrace

Clang compiler provides a number of useful runtime checks, like e.g. -fsanitize=unsigned-integer-overflow. Can I print a backtrace (e.g. using gdb) when one of the checks fails? Currently I get the exact location of the problem, but I do not have the context. How could I get more information from these runtime checks, especially the backtrace?

like image 671
Tomek Avatar asked Oct 20 '22 22:10

Tomek


1 Answers

An easier solution which does not require enabling fatal errors is to set env. variable UBSAN_OPTIONS=print_stacktrace=1.

like image 183
yugr Avatar answered Oct 30 '22 03:10

yugr