This is an archive of the discontinued LLVM Phabricator instance.

[HWASan] allow symbolizer script to index binaries by build id.
ClosedPublic

Authored by fmayer on Apr 8 2022, 8:25 PM.

Details

Summary

Tested on an example callstack with misplaced binaries from Android.
Tested Regex against callstack without Build ID to confirm it still works.

Diff Detail

Event Timeline

fmayer created this revision.Apr 8 2022, 8:25 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 8 2022, 8:25 PM
fmayer requested review of this revision.Apr 8 2022, 8:25 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 8 2022, 8:25 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
fmayer retitled this revision from [HWASan] allow symbolizer script to index binaries by build id. Tested on an example callstack with misplaced binaries from Android. Tested Regex against callstack without Build ID to confirm it still works. to [HWASan] allow symbolizer script to index binaries by build id..Apr 8 2022, 8:25 PM
fmayer edited the summary of this revision. (Show Details)
fmayer added a reviewer: eugenis.
eugenis added inline comments.Apr 11 2022, 12:53 PM
compiler-rt/lib/hwasan/scripts/hwasan_symbolize
78

Not only, there is x86_64 support. This seems like an arbitrary limitation.

93

Do we need to catch exceptions around this code? What happens if a binary is corrupted, or some indices are out of bounds?

fmayer updated this revision to Diff 422023.Apr 11 2022, 1:17 PM
fmayer marked an inline comment as done.

clarify comment

compiler-rt/lib/hwasan/scripts/hwasan_symbolize
78

It's not really limited to ARM64. It's limited to LE 64bit, which I think is all we need for now, I don't think it's worth adding code for BE (which is easier) or 32 bit (which requires basically duplicating the ELF constants) for now.

I clarified the comment.

93

I wanted to let it propagate because the reasons I can think of are

  • There is a bug in the parser.
  • An ELF file is corrupted.
  • A non-ELF file has the magic ELF bytes and is "corrupted".

Only the third one of those is a non-critical error (as in, should not be reported or corrected) and seems extremely unlikely.

I am happy to add error handling though.

eugenis accepted this revision.Apr 11 2022, 1:44 PM

LGTM

compiler-rt/lib/hwasan/scripts/hwasan_symbolize
93

OK, this is a reasonable approach for a developer tool.

This revision is now accepted and ready to land.Apr 11 2022, 1:44 PM
This revision was landed with ongoing or failed builds.Apr 11 2022, 2:12 PM
This revision was automatically updated to reflect the committed changes.