Skip to content

fix(unwinder): Reduce maps buffer stack usage - #2212

Open
jpnurmi wants to merge 2 commits into
v1from
jpnurmi/fix/unwinder-stack-size
Open

jpnurmi wants to merge 2 commits into
v1from
jpnurmi/fix/unwinder-stack-size

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

#2174 brought the SDK unwinder's 4 KiB /proc/self/maps buffer onto the native signal-handler stack in the v1 branch:

Use 512 bytes; preserve oversized lines and address prefixes split across reads without new allocations. GCC 15 -O3, Linux x86-64, Ryzen AI 9 HX 370:

Measurement 4096 B 512 B
Native handler peak (B) 6,344 3,424
Maps lookups, 190 KiB / 1,900 mappings (ms) 0.406 0.490
Maps lookups, 308 KiB / 3,053 mappings (ms) 0.776 0.972

This saves 2,920 bytes of handler stack at the cost of more reads. Lookup timings are warm code/stack lookup pairs: medians of nine rotating batches, excluding unwinding and other crash handling.

#2174 brought the SDK unwinder's 4 KiB `/proc/self/maps` buffer onto
the native signal-handler stack. Use 512 bytes; preserve oversized
lines and address prefixes split across reads without new allocations.

GCC 15 `-O3`, Linux x86-64, Ryzen AI 9 HX 370:

| Measurement | 4096 B | 512 B |
| --- | ---: | ---: |
| Native handler peak (B) | 6,344 | 3,424 |
| Maps lookups, 190 KiB / 1,900 mappings (ms) | 0.406 | 0.490 |
| Maps lookups, 308 KiB / 3,053 mappings (ms) | 0.776 | 0.972 |

This saves 2,920 bytes of handler stack at the cost of more reads.
Lookup timings are warm code/stack lookup pairs: medians of nine
rotating batches, excluding unwinding and other crash handling.
@jpnurmi jpnurmi added the v1 Targets 1.0 (v1 branch) label Oct 16, 2026
@codecov

codecov Bot commented Oct 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.48%. Comparing base (4ce28e7) to head (541194d).

Additional details and impacted files
@@            Coverage Diff             @@
##               v1    #2212      +/-   ##
==========================================
+ Coverage   75.13%   75.48%   +0.34%     
==========================================
  Files         104      104              
  Lines       29630    29630              
  Branches     5479     5479              
==========================================
+ Hits        22263    22366     +103     
+ Misses       5960     5842     -118     
- Partials     1407     1422      +15     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

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

Labels

v1 Targets 1.0 (v1 branch)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant