Skip to content

feat: add intentional crash API - #2013

Merged
jpnurmi merged 18 commits into
masterfrom
jpnurmi/feat/trigger-crash
Aug 27, 2026
Merged

feat: add intentional crash API#2013
jpnurmi merged 18 commits into
masterfrom
jpnurmi/feat/trigger-crash

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Adds sentry_crash() to deliberately crash the current process, allowing downstream SDKs and users to verify native crash reporting without bundling a custom crash library. It is promoted from the example and preserves the existing ASan and AIX handling.

Because this API intentionally contains code that crashes, there is a risk that static analysis tools will report it as a defect. This may cause analysis failures in downstream projects that include sentry-native in their source tree and in static analysis.

To reduce that risk, #2014 added CI builds using GCC -fanalyzer, MSVC /analyze, and Cppcheck. These checks increase confidence for the analyzers we run, but we cannot practically cover every commercial or downstream analyzer, such as Coverity, SonarQube, and others. Analyzer-specific findings therefore remain possible, although their impact should generally be manageable because these tools typically support excluding, ignoring, or suppressing individual findings.

Close: #913

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 23d6d60

@jpnurmi
jpnurmi force-pushed the jpnurmi/feat/trigger-crash branch from a093937 to adf82a7 Compare August 23, 2026 08:48
@codecov

codecov Bot commented Aug 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.30%. Comparing base (bb7666a) to head (23d6d60).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2013      +/-   ##
==========================================
+ Coverage   74.17%   74.30%   +0.13%     
==========================================
  Files         104      104              
  Lines       26619    26627       +8     
  Branches     4844     4844              
==========================================
+ Hits        19744    19786      +42     
+ Misses       5532     5492      -40     
- Partials     1343     1349       +6     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Expose sentry_crash for verifying native crash reporting integrations and use
it across existing crash test fixtures.
@jpnurmi
jpnurmi force-pushed the jpnurmi/feat/trigger-crash branch from adf82a7 to c3099b0 Compare August 24, 2026 09:48
@jpnurmi
jpnurmi marked this pull request as ready for review August 24, 2026 11:08
Comment thread src/sentry_core.c Outdated
Comment thread src/sentry_core.c Outdated
@jpnurmi
jpnurmi force-pushed the jpnurmi/feat/trigger-crash branch from 5848186 to ef9b3f0 Compare August 24, 2026 14:32
Comment thread src/sentry_core.c Outdated

@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 1 potential issue.

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 dd226c8. Configure here.

Comment thread src/sentry_core.c
@jpnurmi
jpnurmi merged commit 719803e into master Aug 27, 2026
70 checks passed
@jpnurmi
jpnurmi deleted the jpnurmi/feat/trigger-crash branch August 27, 2026 13:02
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.

New API to delliberately crash the application

2 participants