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.
Diff Detail
Event Timeline
Updated the patch including a test case. The environment variable, UBSAN_NO_SYMBOLIZE, is used to selectively turn off the online symbolization.
Once again, sorry for the delay.
lib/ubsan/ubsan_diag.cc | ||
---|---|---|
40 ↗ | (On Diff #11682) | 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. |
lib/ubsan/ubsan_diag.h | ||
29 ↗ | (On Diff #11682) | And again, it's better to make use of fast_unwind_on_fatal flag from sanitizer_common. |
lib/ubsan/ubsan_handlers_cxx.cc | ||
71 | It makes sense to hide this feature under a runtime flag. |
lib/ubsan/ubsan_handlers_cxx.cc | ||
---|---|---|
38 | Required early initialization of UBSan is a separate problem. Let's deal with it later, in subsequent patches. |
FYI I'm working on a slightly modified version of this patch. Will update this thread tomorrow.
Required early initialization of UBSan is a separate problem. Let's deal with it later, in subsequent patches.