Page MenuHomePhabricator

[UBsan] Dumping call stacks when reporting bad-cast (-fsanitize=vptr)
Needs ReviewPublic

Authored by byoungyoung on Jul 7 2014, 10:40 AM.



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

byoungyoung retitled this revision from to [UBsan] Dumping call stacks when reporting bad-cast (-fsanitize=vptr).
byoungyoung updated this object.
byoungyoung edited the test plan for this revision. (Show Details)
byoungyoung updated this object.Jul 7 2014, 10:43 AM
byoungyoung updated this object.
byoungyoung added reviewers: kcc, rsmith, samsonov.
byoungyoung added a subscriber: Unknown Object (MLST).
samsonov edited edge metadata.Jul 15 2014, 9:48 AM

Thanks for working on this. I will take a look at it shortly.

byoungyoung edited edge metadata.

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.


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.

samsonov added inline comments.Jul 22 2014, 5:19 PM

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.