Skip to content

Commit 128ac34

Browse files
tombaldwinclaude
andcommitted
scan: exit by falling off the end, never process.exit (Node 24 shutdown deadlock); bound dep re-scans
candor-spec CI (ubuntu-26.04, Node 24.22.2) hung in conformance PARTs 38, 98 and 104 across six runs since 2026-11-02, each time with a `node` child (thread name MainThread) left running after its verdict was written. The cause is upstream nodejs/node#64274: process.exit() disposes the V8 platform while the isolate is alive and joins its workers, one of which can be parked in CollectionBarrier::AwaitCollectionBackground waiting for a GC only the joining main thread can run. Reproduced on macOS / Node 24.13 with --stress-concurrent-allocation: 15/67 gate runs hung before (sample: main thread in WorkerThreadsTaskRunner::Shutdown -> uv_thread_join), 0/67 after. Everything after the imports is now the block `scan:`, and every module-level exit is `{ process.exitCode = N; break scan; }`; the crash handler sets exitCode and returns. A natural exit disposes the isolate first. The two functions that still call process.exit run before any analysis; a unit test pins that set and fails on any module-level process.exit (checked against the old file). The --workspace and --dep-inits child re-scans had no timeout; they now have 600 s, and on expiry the dependency is named on stderr and handled as one that failed to scan (not chained). Byte-identity: 90 fixture runs (PART 104 cells + calltarget/sitetable; no policy, binding policy, zero-rule policy; with and without --json; exit 0/1/2 all exercised) -- rc, stdout, stderr and all .candor/*.json identical to the previous scan.mjs; the comparison was shown able to fail with a seeded stderr line. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jaUYop2PEqPfxttcNWPFx
1 parent fa6689e commit 128ac34

3 files changed

Lines changed: 111 additions & 41 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,21 @@ report bytes or gate verdicts (regenerate baselines / expect verdict changes acr
1010

1111
## Unreleased
1212

13+
- **A scan no longer hangs at exit on Node 24.** `scan.mjs` ended a gate verdict (a violation, exit 1; a refusal or
14+
an incomplete verdict, exit 2; `--json`) with `process.exit()`, which on Node 24 can deadlock in platform
15+
shutdown: a V8 background worker parked waiting for a GC that the joining main thread never runs
16+
(nodejs/node#64274, open upstream). The report and verdict were already written; the process never exited.
17+
candor-spec CI on ubuntu-26.04 (Node 24.22.2) hung this way in conformance PARTs 38, 98 and 104 across six runs
18+
since 2026-11-02. Every module-level exit is now `process.exitCode` plus a fall-through to the end of the file,
19+
which disposes the isolate before the platform and does not hang; the crash handler exits the same way. The only
20+
`process.exit` calls left run before any analysis (engine pin, config load), and a unit test pins that.
21+
Reproduced on macOS with Node 24.13 under `--stress-concurrent-allocation`: 15 of 67 runs hung before, 0 of 67
22+
after. Report bytes, stdout, stderr and exit codes are unchanged on 90 fixture runs (exit 0/1/2, with and
23+
without `--json`).
24+
- **The `--workspace` and `--dep-inits` dependency re-scans have a deadline (600 s).** They had none, so one child
25+
that never returned hung the whole scan. On expiry the child is killed, stderr names the dependency, and it is
26+
handled as a dependency that failed to scan: not chained, so its calls read Unknown/invisible.
27+
1328
## [0.41.2] — 2026-11-05
1429

1530
- **No change to candor-ts.** The version moves with the 0.41.2 family patch (a candor-java fix).

0 commit comments

Comments
 (0)