[PATCH] D151353: [DebugInfo] Add error-handling to DWARFAbbreviationDeclarationSet

Alex Langford via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 30 10:49:38 PDT 2023


bulbazord marked an inline comment as done.
bulbazord added a comment.

Ok, the pre-submission checks failing are actually due to this change. Specifically, parsing the `debug_abbrev` section of the objects produced by these tests leads to an infinite loop. It goes as follows:

- We fail to get an ULEB128 value for the code because the contents of the debug_abbrev are invalid. The DataExtractor thus returns 0, signaling to the DWARFAbbreviationDeclaration parsing code that were done with this DWARFAbbreviationDeclaration.
- The DWARFAbbreviationDeclarationSet sees it's done and returns an empty Set to the DWARFDebugAbbrev parsing code. The offset is still at 0, so it's still technically a valid offset for the DataExtractor. So we continue on...

I believe `DWARFDebugAbbrev::parse` was relying on knowing when it's done by checking if the offset has moved. Otherwise we end up in an infinite loop. I'm going to add some additional safety checks, but it shouldn't be significant. I'll request another review after adding it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151353/new/

https://reviews.llvm.org/D151353



More information about the llvm-commits mailing list