https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118819
--- Comment #1 from Sam James <sjames at gcc dot gnu.org> --- With export UBSAN_OPTIONS="halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1", you should be able to get a nice backtrace. You can drop the halt/abort bits if you want.