fix(debuginfo): Add some dwarf debuginfo recursion limits#1015
Conversation
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
### Fixes
- Add some dwarf debuginfo recursion limits ([#1015](https://github.com/getsentry/symbolic/pull/1015))If none of the above apply, you can opt out of this check by adding |
| /// The maximum depth to recurse to when parsing inlined functions. | ||
| const MAX_PARSE_INLINEE_DEPTH: u32 = 256; |
There was a problem hiding this comment.
For this you could piggyback on the max_inline_depth option introduced in #1014.
18c09ee to
9921fec
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7e8612e. Configure here.
| // into it. | ||
| if ranges.is_empty() { | ||
| return self.parse_functions(depth, entries, output); | ||
| return self.parse_functions(depth, remaining_inline_depth, entries, output); |
There was a problem hiding this comment.
Empty inlinees bypass depth limit
High Severity
When a DW_TAG_inlined_subroutine or DW_TAG_subprogram has no code ranges, parsing continues via parse_functions without decrementing remaining_inline_depth. A long chain of empty surrogate DIEs can recurse indefinitely and still hit stack overflow, bypassing the new inline depth cap.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 7e8612e. Configure here.
| self.parse_function_children( | ||
| depth, | ||
| inline_depth + 1, | ||
| remaining_inline_depth - 1, |
There was a problem hiding this comment.
Dwarf breakpad inline limit mismatch
Medium Severity
The same max_inline_depth option is applied differently in DWARF versus Breakpad/FunctionBuilder. DWARF decrements a remaining budget per inlinee (so 128 allows 128 frames with depth indices 0..127), while FunctionBuilder keeps records while depth <= max_inline_depth (so 512 keeps depth indices 0..512, as in the symcache test).
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 7e8612e. Configure here.


Ref: INGEST-967