Skip to content

node:http: test-http-response-setheaders.js SIGSEGVs nondeterministically (res.setHeaders + assert.throws path) #4965

Closed

Description

@proggeramlug

Found while re-measuring the #4909 bucket for PR #4964: test-http-response-setheaders.js (staged with the node-core shim) exits with SIGSEGV (139) in ~6/8 runs and exit 1 ("Missing expected exception") otherwise — identical behavior on origin/main baseline and the PR branch, so it is pre-existing and unrelated to the #4909 client fixes.

Repro:

# stage common/ shim next to the test per scripts/node_core_subset.py
perry compile parallel/test-http-response-setheaders.js -o rsh.out   # PERRY_ALLOW_UNIMPLEMENTED=1
for i in 1 2 3 4 5 6 7 8; do ./rsh.out >/dev/null 2>&1; echo -n "$? "; done
# → 139 1 139 139 139 139 1 139

The test exercises res.setHeaders(new globalThis.Headers({...})) after writeHead (expects ERR_HTTP_HEADERS_SENT) and a series of assert.throws(() => res.setHeaders(<bad arg>), { code: 'ERR_INVALID_ARG_TYPE' }) calls inside the request handler. The nondeterminism suggests a GC/longjmp interaction on the throw path rather than a plain logic bug.

Part of the #4909 triage residue (#2132 umbrella).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions