This is an archive of the discontinued LLVM Phabricator instance.

Do not crash with missing symbolication when running in DEDUP mode
ClosedPublic

Authored by george.karpenkov on Jun 30 2017, 3:32 PM.

Details

Summary

Printing stacktrace from ASAN crashes with a segfault in DEDUP mode when symbolication is missing.
Needless to say, this leads to very confusing crashes and behaviors, exacerbated by the fact that libFuzzer forks the process with a triggered bug, hiding the error out of sight.

This commit does not resolve the issue fully, as when libFuzzer forks the process the output is redirected into a logfile and will not be seen by the user. Yet at least it would be possible to diagnoze the issue by looking at that logfile.
Perhaps libFuzzer could check for existance of "ERROR: " string, and display it to stderr as well, but that would be tying two repositories two closely.

Diff Detail

Repository
rL LLVM

Event Timeline

kubamracek added inline comments.Jul 5 2017, 4:30 PM
lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc
48–51 ↗(On Diff #104947)

The "if" looks good, but the error message doesn't belong here: 1) it would be printed several times in this loop, 2) info.function isn't necessarily an indication that a symbolizer is not present/working (just one frame might be un-symbolizable). Either remove the error message, or move it to some other place (perhaps some init code where we initialize the symbolizers).

Moving error message to initialization is tricky, as that itself would require iterating over stack frames. Removing it entirely.

kubamracek accepted this revision.Jul 6 2017, 3:31 PM

LGTM.

Moving error message to initialization is tricky, as that itself would require iterating over stack frames. Removing it entirely.

I meant initialization of ASan. No need to walk any frames, just "is dedup_token set and there is no symbolizer available? abort." kind of thing.

This revision is now accepted and ready to land.Jul 6 2017, 3:31 PM
This revision was automatically updated to reflect the committed changes.