This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Fix infinite loop caused by reading past debug_line end
ClosedPublic

Authored by jhenderson on Jan 6 2020, 8:42 AM.

Details

Summary

If the claimed unit length of a debug line program is such that the line table would finish past the end of the .debug_line section, an infinite loop occurs because the data extractor will continue to "read" zeroes without changing the offset. This previously didn't hit an error because the line table program handles a series of zeroes as a bad extended opcode.

This patch fixes the inifinite loop and adds a warning if the program doesn't fit in the available data.

Diff Detail

Event Timeline

jhenderson created this revision.Jan 6 2020, 8:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 6 2020, 8:42 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
JDevlieghere accepted this revision.Jan 6 2020, 10:15 AM

LGTM. Thanks for fixing this!

This revision is now accepted and ready to land.Jan 6 2020, 10:15 AM
This revision was automatically updated to reflect the committed changes.