When UBsan reports a bad-casting, this patch additional dumps call stacks in the report. To avoid the online symbolization, ubsan_init() is also added to initialize an empty symbolizer.
Once again, sorry for the delay.
I'm opposed to this. Instead, you should use the value of "symbolize" flag in sanitizer_common. Probably it's time to introduce UBSAN_OPTIONS similar to another sanitizers. I will take a look at existing code and return with more comments.
And again, it's better to make use of fast_unwind_on_fatal flag from sanitizer_common.
It makes sense to hide this feature under a runtime flag.