Skip to content

fix(debuginfo): Add some dwarf debuginfo recursion limits#1015

Open
klochek wants to merge 5 commits into
masterfrom
christopherklochek/dwarf_recursion_limits
Open

fix(debuginfo): Add some dwarf debuginfo recursion limits#1015
klochek wants to merge 5 commits into
masterfrom
christopherklochek/dwarf_recursion_limits

Conversation

@klochek

@klochek klochek commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Ref: INGEST-967

@klochek klochek requested a review from a team as a code owner July 9, 2026 13:01
@linear-code

linear-code Bot commented Jul 9, 2026

Copy link
Copy Markdown

INGEST-967

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

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 #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against 4c8c487

Comment thread symbolic-debuginfo/src/dwarf.rs
Comment thread symbolic-debuginfo/src/dwarf.rs Outdated
Comment on lines +564 to +565
/// The maximum depth to recurse to when parsing inlined functions.
const MAX_PARSE_INLINEE_DEPTH: u32 = 256;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this you could piggyback on the max_inline_depth option introduced in #1014.

@klochek klochek force-pushed the christopherklochek/dwarf_recursion_limits branch from 18c09ee to 9921fec Compare July 10, 2026 18:52

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ 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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7e8612e. Configure here.

self.parse_function_children(
depth,
inline_depth + 1,
remaining_inline_depth - 1,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7e8612e. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants