This is an archive of the discontinued LLVM Phabricator instance.

[LLDB] MinidumpParser: Prefer executable module even at higher address
ClosedPublic

Authored by JosephTremoulet on Jan 13 2021, 12:54 PM.

Details

Summary

When a program maps one of its own modules for reading, and then
crashes, breakpad can emit two entries for that module in the
ModuleList. We have logic to identify this case by checking permissions
on mapped memory regions and report just the module with an executable
region. As currently written, though, the check is assymetric -- the
entry with the executable region must be the second one encountered for
the preference to kick in.

This change makes the logic symmetric, so that the first-encountered
module will similarly be preferred if it has an executable region but
the second-encountered module does not. This happens for example when
the module in question is the executable itself, which breakpad likes to
report first -- we need to ignore the other entry for that module when
we see it later, even though it may be mapped at a lower virtual
address.

Diff Detail

Event Timeline

JosephTremoulet requested review of this revision.Jan 13 2021, 12:54 PM
JosephTremoulet created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 13 2021, 12:54 PM
clayborg accepted this revision.Jan 13 2021, 2:22 PM

LGTM!

This revision is now accepted and ready to land.Jan 13 2021, 2:22 PM
This revision was landed with ongoing or failed builds.Jan 14 2021, 10:18 AM
This revision was automatically updated to reflect the committed changes.