[Lldb-commits] [lldb] [lldb/DWARF] Make sure bad abbreviation codes do not crash lldb (PR #93006)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Thu May 23 02:10:01 PDT 2024


labath wrote:

> We have to back out the PeekDieName() patch locally at Meta because it was crashing us due to this assertion due to .debug_names tables having incorrect values for type units. Only one type unit will appear in the final file and type units can have differing contents for the same type. This means accelerator table entries from .o file that had a type unit, but its type unit didn't end up in the final output file, can be bogus and not point to valid DIE offsets which can cause PeekDieName to parse at random offsets in a type unit and crash or report an error now. So we might need an extra bool to be passed to the `DWARFDebugInfoEntry::Extract(...)` function that says to report an error and have PeekDieName call this with "report_errors = false". Right now many of these entries will cause a large numver of errors to be reported. This is being fixed by verifying that type unit accelerator table entries are matched to the right type unit, but that PR isn't in yet.

I think that is orthogonal to this patch, but it is troubling nonetheless (thank you for bringing it to my attention). If you want to go down this path, you might want to consider something like call_once (or call_once_every_N_sec) to make sure there is some record of the issue somewhere. If not, I might get around to this at some point.

https://github.com/llvm/llvm-project/pull/93006


More information about the lldb-commits mailing list