Skip to content

test(javascript): two release tests accept the engine's own crash on a Node without the fix; the guide says what a release can cost - #1382

Merged
debugmcpdev merged 3 commits into
mainfrom
test/released-child-engine-crash
Nov 29, 2026
Merged

debugmcpdev merged 3 commits into
mainfrom
test/released-child-engine-crash

Conversation

@debugmcpdev

@debugmcpdev debugmcpdev commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #1119.

A fork released with the child-session cap at 0 sometimes died with an access violation, and the test expected a clean exit. The crash is Node's: its inspector can write to a socket that a detach has just closed (nodejs/node#64209, fixed in 24.19.0 and 26.5.0, and in no 22.x release). Three server-side workarounds were built or designed and none was safe (the record is in #1119), so the server does not change. The tests and the guide now say what is true.

What this changes

  • Five tests accept the engine's own crash, and nothing else, on a Node without the fix. They are the cap-0 release test; the test that closes a paused, adopted fork, which met the same crash while this change was being verified; closing one of two forks; and detaching and closing an attached root with a paused fork. One shared check serves all five, with the exit code tied to what the fixture saw. On a Node with the fix both still require the fork to run to its end. On one without it, either the fork ran to its end, or the fixture saw it die of the access violation (Windows) or of a memory-fault signal (elsewhere). A fork ended from outside does not pass. A tolerated crash prints a warning.
  • The fixtures name the signal when a fork was killed by one.
  • The JavaScript guide no longer says that a cap of 0 leaves child processes untouched. It says what a release can cost on which Node, who releases what (the cap, close_debug_session on a child, detach_from_process and a close on an attached root), and how to avoid releases.

No product code.

Evidence

  • CI at 8c3d9f89: 18 checks green.
  • On Node 24.14.1, which lacks the fix (Windows): the three test files twelve times, four at a time: 12 passed, no crash met. The tree file's two release tests thirty times, six at a time: 30 passed, 1 of them on the crash branch (the launch's exit code was -1073741819). Earlier on this branch, before the check was shared: 2 of 30 and 1 of 12 on the crash branch.
  • On Node 22.22.3, which lacks the fix (a two-core Ubuntu machine): the three files five times: 5 passed, no crash met. The whole JavaScript adapter suite: 11 files, 67 passed.
  • What running it corrected: the first version accepted only the unsigned form of the Windows code and would have failed on the real crash, and the test that closes a paused fork failed once in three runs of its file before it was covered.
  • Not met for real: a crash on Linux or macOS, and a crash in the cascade test or in the two attach tests. Their line shapes are held by the helper's unit table (62 cases).

Review

  • Written by a GPT model in two turns. Between them the manager session (a Claude model) corrected the Windows exit code, covered the second test and made the fixture name the signal; the second turn moved that into the shared helper and covered three more tests.
  • Reviewed by a Gemini model twice: at 56076068, merge with three changes (three more tests with the same exposure, the exit code tied to the outcome, and exact wording about who releases what); at 8c3d9f89, merge.
  • Not read by a second Claude model: after the second turn the manager's own lines are one fixture line and sentences of the changelog entry.

Not in this change

🤖 Generated with Claude Code

https://claude.ai/code/session_015BDrn82vMcRzWFDD9aUbZs

cynarlab and others added 2 commits November 29, 2026 05:06
…sh on a Node without the fix; the guide says what a release can cost

Issue #1119: a fork released with the child-session cap at 0 sometimes died with an access violation, and the test expected a clean exit. The crash is Node's (nodejs/node#64209: the inspector writes to a socket the release's detach has just closed), fixed in 24.19.0 and 26.5.0 and in no 22.x release. Three server-side workarounds were built or designed and none was safe, so the server does not change.

- The test requires exit 0 on a Node with the fix. On one without it, it accepts 0 or exactly the engine's crash: the launch's exit code for an access violation on Windows (0xC0000005, unsigned or signed), or 1 elsewhere with the fixture naming a memory-fault signal for its fork. A tolerated crash prints a warning.
- The fixture names the signal when its fork was killed by one.
- The JavaScript guide no longer says a cap of 0 leaves children untouched, and says what a release can cost on which Node and how to avoid releases.

Measured here on Node 24.14.1, six runs at a time: 30 runs, 2 crashes (launch exit code -1073741819), all 30 passed. Helper, test and guide written by a GPT model; the signed exit code, the signal check and the changelog entry are the manager session's.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015BDrn82vMcRzWFDD9aUbZs
…one check for a released fork's outcome

With the first commit in place the whole file failed once in three runs: the test that closes a paused, adopted fork saw the fork die with 3221225477 where it expected it to finish. close_debug_session on a child releases it by a detach, and the engine's crash follows that detach too.

Both tests now share one check: the fork ran to its end, or, only on a Node without the fix, parent.js saw it die of the access violation or of a memory-fault signal. The guide and the changelog entry say that closing a child session releases it the same way.

Measured on Node 24.14.1: the whole file twelve times, four at a time: 12 passed, 1 tolerated crash. Mine (the manager session).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015BDrn82vMcRzWFDD9aUbZs
@codecov

codecov Bot commented Nov 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

…e more tests covered; the guide says exactly who releases what

From the review of this branch: the cascade test (closing one of two forks) and the two attach tests (detaching and closing an attached root with a paused fork) release the same fixture and still required a clean end, so they had the same exposure to the engine's crash. The shared check moves to tests/test-utils/helpers/released-fork-outcome.ts with a table of unit cases; it also ties the launch's or the target's exit code to what the fixture saw, in every test that uses it. SIGTRAP joins the accepted signals; SIGKILL, SIGTERM and SIGINT do not pass. The other two fixtures name the signal too.

The guide and the changelog entry no longer say that closing a child releases it 'the same way' as the throwaway attach: it detaches the child's existing connection. They say on which sessions detach_from_process releases a tree's children and on which it is refused.

Run by the manager session on Node 24.14.1: the three files twelve times four at a time, 12 passed; the tree file's two release tests thirty times six at a time, 30 passed, 1 on the crash branch (exit code -1073741819). The cascade and attach crash branches have met no real crash; their line shapes are held by the helper's unit cases. Written by a GPT model.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015BDrn82vMcRzWFDD9aUbZs
@debugmcpdev
debugmcpdev marked this pull request as ready for review November 29, 2026 12:07
@debugmcpdev
debugmcpdev merged commit f08a515 into main Nov 29, 2026
18 checks passed
@debugmcpdev
debugmcpdev deleted the test/released-child-engine-crash branch November 29, 2026 12:08
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.

Flaky: javascript-subprocess-tree cap-0 case, the debuggee exits 0xC0000005 once under the pre-push integration run (Windows)

2 participants