Skip to content

feat(linux): Support optional stack capture size limit - #2137

Merged
jpnurmi merged 9 commits into
getsentry:masterfrom
cerisier:cerisier/linux-stack-capture-limit
Oct 5, 2026
Merged

jpnurmi merged 9 commits into
getsentry:masterfrom
cerisier:cerisier/linux-stack-capture-limit

Conversation

@cerisier

Copy link
Copy Markdown
Contributor
  • Add an option to limit non-crashing thread stack capture on Linux
  • Set the option for crashpad

This follows up getsentry/crashpad#165 for Zig programs, which place a 256 KiB alternate signal stack in static TLS for every thread.

Related crashpad PR: getsentry/crashpad#172

@cerisier
cerisier marked this pull request as ready for review September 25, 2026 17:30
@codecov

codecov Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 38.88889% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.37%. Comparing base (636593d) to head (80aa5fb).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2137      +/-   ##
==========================================
- Coverage   75.41%   75.37%   -0.04%     
==========================================
  Files         103      103              
  Lines       28105    28119      +14     
  Branches     5132     5136       +4     
==========================================
  Hits        21194    21194              
- Misses       5578     5585       +7     
- Partials     1333     1340       +7     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jpnurmi

jpnurmi commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

Presumably, the native backend has the same problem. Since we plan to make it the default backend in 1.x, let's fix it too while we're at it, and drop the crashpad infix from the option name?

@jpnurmi

jpnurmi commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

Sorry about the bogus NDK lint failure - fixed by #2139

@jpnurmi jpnurmi changed the title feat(crashpad): Support optional stack capture size limit feat(linux): Support optional stack capture size limit Oct 3, 2026
The x86_64 red zone puts the capture start 128 bytes below SP.
When the capture limit fits entirely below SP, omit the red zone
so the captured range includes SP.

Use an explicit nonzero limit for non-crashing threads in place of
the internal 1 MiB default. Keep the default when the option is zero
and for the crashing thread.
@jpnurmi
jpnurmi merged commit bf04324 into getsentry:master Oct 5, 2026
62 checks passed
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