This is an archive of the discontinued LLVM Phabricator instance.

[MSan] Print current stack on CHECK violation
ClosedPublic

Authored by alekseyshl on Feb 23 2018, 1:17 PM.

Details

Summary

Print current stack on CHECK violation to aid debugging and
match other sanitizers functionality.

Diff Detail

Event Timeline

alekseyshl created this revision.Feb 23 2018, 1:17 PM
Herald added subscribers: Restricted Project, delcypher. · View Herald TranscriptFeb 23 2018, 1:17 PM

Could you reliably trigger a check failure, with a wild free for example?
I'm thinking a test would be nice.

This has potential for deadlocks. Slow unwinder may malloc AFAIK, which is not good if the CHECK failure is itself in malloc. On the other hand, fast unwinder would require frame pointers in internal msan and sanitizer_common functions, which we try to avoid.

I'm tempted to land this anyway and see if the deadlocks actually happen in practice or they are purely theoretical.

  • Add a test.

Yes, that's how I tested it, with unaligned pointer (added the same test).

MSan does make an effort to block interceptors during unwind (see SymbolizerScope), so if the problem arises, we'll fix it.

eugenis accepted this revision.Feb 23 2018, 6:11 PM
This revision is now accepted and ready to land.Feb 23 2018, 6:11 PM
This revision was automatically updated to reflect the committed changes.