This is an archive of the discontinued LLVM Phabricator instance.

[BOLT][DWARF] Fix handling of invalid DIE references
ClosedPublic

Authored by ayermolo on Aug 11 2023, 11:54 AM.

Details

Summary

Compiler can generate DIE References that are invalid. Previously BOLT could
assert when writing out IR to .debug_info. Changed where DIE offsets are changed
so that it's always done. Thus making sure that assert is not triggered.

Added more specific warnings, and ability to print out invalid referenced DIE
offset when verbosity >=1.

Diff Detail

Event Timeline

ayermolo created this revision.Aug 11 2023, 11:54 AM
Herald added a reviewer: Amir. · View Herald Transcript
Herald added a reviewer: maksfb. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
ayermolo requested review of this revision.Aug 11 2023, 11:54 AM
ayermolo updated this revision to Diff 549482.Aug 11 2023, 12:00 PM

Fixed dwarf version in commands

ayermolo retitled this revision from [BOLT][DWARF][NFC] Fix handling of invalid DIE references to [BOLT][DWARF] Fix handling of invalid DIE references.Aug 14 2023, 11:43 AM
Amir accepted this revision.Aug 14 2023, 3:35 PM

LGTM with minor nits. Tricky issue but thanks for handling it gracefully.

bolt/lib/Core/DIEBuilder.cpp
114

This needs to be the first sentence.

481–482
bolt/test/X86/dwarf4-invalid-reference-die-offset-no-internal-dwarf-error.s
11
This revision is now accepted and ready to land.Aug 14 2023, 3:35 PM
ayermolo marked 3 inline comments as done.Aug 14 2023, 4:42 PM
ayermolo updated this revision to Diff 550136.Aug 14 2023, 4:44 PM

addressed comments

This revision was automatically updated to reflect the committed changes.