Skip to content

ref(native): Publish CRASHING early - #2180

Merged
jpnurmi merged 3 commits into
masterfrom
jpnurmi/ref/native-crashing
Oct 12, 2026
Merged

jpnurmi merged 3 commits 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.50%. Comparing base (6e2447d) to head (c9a7776).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2180      +/-   ##
==========================================
- Coverage   75.54%   75.50%   -0.05%     
==========================================
  Files         103      103              
  Lines       28170    28200      +30     
  Branches     5159     5167       +8     
==========================================
+ Hits        21282    21292      +10     
- Misses       5543     5557      +14     
- Partials     1345     1351       +6     
🚀 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
@jpnurmi
jpnurmi merged commit ac7f5af into master Oct 12, 2026
70 checks passed
@jpnurmi
jpnurmi deleted the jpnurmi/ref/native-crashing branch October 12, 2026 16:04
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