Skip to content

spawnSync: make signal-forwarding register/unregister safe for concurrent callers - #30956

Open
robobun wants to merge 14 commits into
mainfrom
farm/a5eb0a5e/spawnsync-sigpwr
Open

spawnSync: make signal-forwarding register/unregister safe for concurrent callers#30956
robobun wants to merge 14 commits into
mainfrom
farm/a5eb0a5e/spawnsync-sigpwr

shorten comment

79f6fd1
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Aug 16, 2026 in 13m 46s

Code review found 1 important issue

Found 1 candidates, confirmed 3. See review comments for details.

Details

Severity Count
🔴 Important 1
🟡 Nit 2
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/jsc/bindings/c-bindings.cpp:1042-1044 Inner Drop's reset_on_posix() defeats depth guard for SIGABRT/SIGTRAP

Annotations

Check warning on line 1044 in src/jsc/bindings/c-bindings.cpp

See this annotation in the file changed.

@claude claude / Claude Code Review

Inner Drop's reset_on_posix() defeats depth guard for SIGABRT/SIGTRAP

🟡 Same class as the `Bun__currentSyncPID = 0` placement above, but on the Rust side: `Drop for SignalForwarding` (src/spawn/process.rs:2872) calls `bun_crash_handler::reset_on_posix()` unconditionally *after* `Bun__unregisterSignalsForForwarding()`, and `reset_on_posix()` installs the crash handler for `SIGABRT`/`SIGTRAP` — both of which are in `FOR_EACH_POSIX_SIGNAL`. So an inner caller finishing while an outer `spawnSync` is still waiting overwrites the forwarding lambda for those two signals