You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{readFileSync}from'node:fs';import{createPrivateKey}from'node:crypto';import{listen,connect}from'node:quic';// in the repo, the keys are in test/fixtures/keysconstkey=createPrivateKey(readFileSync('/path/to/key.pem'));constcert=readFileSync('/path/to/cert.pem');// ALPN defaults to 'h3'.constendpoint=awaitlisten(()=>{},{sni: {'*': {keys: [key],certs: [cert]}}});constsession=awaitconnect(endpoint.address,{servername: 'localhost',verifyPeer: 'manual'});conststream=awaitsession.createUnidirectionalStream();stream.writer.writeSync('x');awaitendpoint.destroy();console.log('reached end of script');
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
exit code 0 with no crash.
The client opens a plain unidirectional stream on an HTTP/3 connection, which is not a valid h3 stream, so the server should treat it as a protocol error or discard it, and either way tear down cleanly.
What do you see instead?
reached end of scriptzsh: segmentation fault (core dumped) ../node/node --experimental-quic --no-warnings repro.js
The script runs to completion and prints reached end of script, then the process dies with SIGSEGV instead of exiting 0. The crash is therefore after endpoint.destroy() has resolved, during process teardown, not inside any QUIC call the script awaits. Nothing is reported on the JS side: no error, no rejection, no warning.
Additional information
Observations:
ALPN must be h3. With a custom ALPN (alpn: ['test-proto']) the same script exits cleanly, and the stream is delivered to onstream as expected.
The write is required. Dropping stream.writer.writeSync('x') makes it exit cleanly.
Teardown is what surfaces it. endpoint.destroy() alone is enough, and close() on both sides also crashes. With no teardown the process just hangs on open handles.
On h3 the stream never reaches JavaScript, since nghttp3 consumes non-request streams internally, so no JS-visible stream object is involved.
Version
main
Platform
Subsystem
quic
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
exit code 0 with no crash.
The client opens a plain unidirectional stream on an HTTP/3 connection, which is not a valid h3 stream, so the server should treat it as a protocol error or discard it, and either way tear down cleanly.
What do you see instead?
The script runs to completion and prints reached end of script, then the process dies with SIGSEGV instead of exiting 0. The crash is therefore after endpoint.destroy() has resolved, during process teardown, not inside any QUIC call the script awaits. Nothing is reported on the JS side: no error, no rejection, no warning.
Additional information
Observations:
alpn: ['test-proto']) the same script exits cleanly, and the stream is delivered toonstreamas expected.stream.writer.writeSync('x')makes it exit cleanly.onstreamis irrelevant: it crashes whether or not the server registers one. That distinguishes it from quic: crash when incoming unidirectional stream has no onstream handler #64030, which required noonstreamand a non-h3 ALPN, and was fixed in July.endpoint.destroy()alone is enough, andclose()on both sides also crashes. With no teardown the process just hangs on open handles.