Skip to content

ref(native): Publish CRASHING early - #2180

Open
jpnurmi wants to merge 1 commit into
masterfrom
jpnurmi/ref/native-crashing
Open

jpnurmi wants to merge 1 commit into
masterfrom
jpnurmi/ref/native-crashing

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Publish an early CRASHING state from the crash handler right after saving the crash context to shared memory but before invoking the on_crash or before_send callbacks that execute arbitrary user code that may, in the worst case, crash the crash handler.

This not only hardens the flow for the upcoming crash-stack unwinding (#2174), but in general, allows the daemon to detect such situations and act accordingly, instead of the app vanishing without any notification, resulting in misleading "Parent process exited without crash" logs.

flowchart TB
    subgraph app["App / backend"]
        direction LR
        READY
        subgraph handler["Crash handler"]
            direction LR
            CRASHING["CRASHING (new)"] -->|"on_crash/before_send"| CRASHED
        end
        READY --> handler
    end
    subgraph daemon["Crash daemon"]
        direction LR
        PROCESSING --> PROCESSED --> CAPTURED --> DONE
    end
    app --> daemon
    
    style CRASHING stroke:red,stroke-width:2px
Loading

@jpnurmi
jpnurmi added this pull request to stack #2181 October 8, 2026 18:47
@codecov

codecov Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.85106% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.39%. Comparing base (1ae39d3) to head (98293f1).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2180      +/-   ##
==========================================
- Coverage   75.48%   75.39%   -0.10%     
==========================================
  Files         103      103              
  Lines       28089    28119      +30     
  Branches     5150     5158       +8     
==========================================
- Hits        21202    21199       -3     
- Misses       5545     5587      +42     
+ Partials     1342     1333       -9     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This hardening exposes unfinished crash handling when local unwinding
or callbacks fault or stall. It also lets the daemon process completed
crashes when IPC notifications are lost.

Publish `CRASHING` after saving the original fault context, before
local capture and crash callbacks. Keep it separate from `CRASHED` so
the daemon does not consume mutable captures or event files. Warn once
after the handler timeout and continue waiting for delayed completion.

Check shared state after notifications and timeouts, and reread it
after parent death.
@jpnurmi
jpnurmi force-pushed the jpnurmi/ref/native-crashing branch from 2571c16 to 98293f1 Compare October 9, 2026 06:37
@jpnurmi
jpnurmi requested a review from mujacica October 9, 2026 15:37

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant