This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Avoid falling in an infinite loop with a truncated .debug_str_offsets.dwo.
ClosedPublic

Authored by ikudrin on Aug 11 2020, 8:40 AM.

Details

Summary

dumpStringOffsetsSection() expects the size of a contribution to be correctly aligned. The patch adds the corresponding verifications for pre-v5 cases.

Diff Detail

Event Timeline

ikudrin created this revision.Aug 11 2020, 8:40 AM
ikudrin requested review of this revision.Aug 11 2020, 8:40 AM
ikudrin updated this revision to Diff 284982.Aug 11 2020, 11:52 PM
  • Do not issue an error is .debug_str_offset.dwo is empty or missed.

I'm not really up to speed on the pre-v5 .dwo stuff, so best that somebody else looks at this functionality, I think.

llvm/test/DebugInfo/X86/dwarfdump-str-offsets-v4-dwp-invalid.s
35 ↗(On Diff #284982)

If I've followed it right, the only difference between this test case and the other one is this extra section? Could you use --defsym/.if to merge the two together?

ikudrin updated this revision to Diff 285293.Aug 13 2020, 2:50 AM
ikudrin marked an inline comment as done.

Thanks for looking!

  • Merged the tests.
aprantl accepted this revision.Aug 13 2020, 9:15 AM
This revision is now accepted and ready to land.Aug 13 2020, 9:15 AM