Crash in WebTransportSessionProxy::OnDataAvailable: WebTransport sent as GET over HTTP/1.1 after HTTP/3 to IPv6 fails with no IPv4 retry (regression of bug 1895535)
Categories
(Core :: Networking: HTTP, defect, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr115 | --- | unaffected |
| firefox-esr153 | --- | wontfix |
| firefox160 | --- | wontfix |
| firefox161 | --- | wontfix |
| firefox162 | --- | fixed |
People
(Reporter: colombia.cohen2, Assigned: kershaw)
References
(Regression, )
Details
(Keywords: crash, regression, Whiteboard: [necko-triaged][necko-priority-queue])
Crash Data
Attachments
(2 external files)
Firefox 158.0 (release, Windows 11, no IPv6 connectivity) aborts the parent process when a
page opens a WebTransport session to an origin that publishes an HTTPS RR.
Crash report: https://crash-stats.mozilla.org/report/index/e6cddbbc-bf18-42ff-95d9-adf760261021
MOZ_RELEASE_ASSERT(false) (WebTransportSessionProxy::OnDataAvailable should not be called)
Same signature as bug 1895535.
Origin: https://quicojs.dev
HTTPS RR: 1 . alpn=h3,h2 ipv4hint=62.164.223.12 ipv6hint=2a02:c202:2235:2979::1 ech=...
The origin has both A and AAAA records. The client machine has no IPv6 route.
What happens (from an nsHttp/neqo log):
- Firefox starts the HTTP/3 session from the HTTPS RR to the IPv6 address:
Http3Session::Init ... peerAddr=2a02:c202:2235:2979::1
neqo_transport::path: Failed to determine outbound interface for destination
2a02:c202:2235:2979::1: The network location cannot be reached (os error 1231) - HTTP/3 is not retried over IPv4. It is excluded for the origin:
AllowToRetryDifferentIPFamilyForHttp3 ... allowToRetryWithDifferentIPFamily=0
nsHttpConnectionMgr::ExcludeHttp3 - The page loads over HTTP/2 (IPv4).
- The page then opens a WebTransport session. Firefox sends it as a plain request on a
new HTTP/1.1 connection:
GET / HTTP/1.1
Sec-Webtransport-Http3-Draft02: 1
Sec-Fetch-Dest: webtransport - The server answered it as an ordinary page (200, text/html, content-encoding: br,
64299 bytes). The body reached WebTransportSessionProxy::OnDataAvailable, and the
release assert aborted the browser.
Workarounds that avoid the crash (each confirmed by toggling back and forth):
- network.dns.use_https_rr_as_altsvc = false
- network.dns.http3_echconfig.enabled = false (with use_https_rr_as_altsvc = true)
- network.dns.disableIPv6 = true → [RESULT]
There are two problems here:
(1) No IPv4 fallback for HTTP/3 when the IPv6 address is unreachable. Every Firefox user
without IPv6 loses HTTP/3 for such origins.
(2) A WebTransport session can go out as an HTTP/1.1 request, and any response body
aborts the whole browser. A response from a server should never crash the browser.
The session should simply fail.
Server-side mitigation (on our side): the server now answers any request with
Sec-Fetch-Dest: webtransport that arrives over HTTP/1.1 or HTTP/2 with
501 and no body. With that, the session fails cleanly (WebTransport.ready rejects),
the page falls back to WebSocket, and Firefox no longer crashes. The underlying
Firefox issues remain: an origin that answers such a request with content, as most
servers will, still crashes the browser.
I can provide the full HTTP log privately if needed.
See also bug 2047344 (WebRTC: same pattern — no IPv6 default route, no fallback to IPv4).
Note on how this relates to the fix in bug 1895535 ("Disable fast fallback and
connection coalescing for WebTransport"): that part still holds. The log shows
"Don't coalesce a WebTransport conn" for this session. The WebTransport
transaction was first queued on the h3 connection entry
(.SA......W. quicojs.dev:443 {NPN-TOKEN h3}). After the HTTPS RR arrived and
HTTP/3 had been excluded for the origin, it was re-dispatched to a TCP entry
(.SA......W. quicojs.dev:443, no h3 token). A new TCP connection was made, and
the session went out there as "GET / HTTP/1.1". So it is not coalescing: after
HTTP/3 is excluded, the WebTransport transaction falls back to a fresh HTTP/1.1
connection, where it should fail instead.
Comment 2•27 days ago
|
||
The bug has a crash signature, thus the bug will be considered confirmed.
Updated•26 days ago
|
Comment 3•5 days ago
|
||
This bug has had no comment from a person since 2026-10-21. Clouseau analysed a recent crash report on its signature; the analysis is below.
Crash report: https://crash-stats.mozilla.org/report/index/8a4ebe91-e1d4-420d-9f8f-506da0261111
MOZ_CRASH Reason:
MOZ_RELEASE_ASSERT(false) (WebTransportSessionProxy::OnDataAvailable should not be called)
Top 10 frames:
0 libxul.so mozilla::net::WebTransportSessionProxy::OnDataAvailable(nsIRequest*, nsIInputStr... netwerk/protocol/webtransport/WebTransportSessionProxy.cpp:1073
1 libxul.so nsIndexedToHTML::OnDataAvailable(nsIRequest*, nsIInputStream*, unsigned long, un... netwerk/streamconv/converters/nsIndexedToHTML.cpp:639
2 libxul.so mozilla::net::nsStreamListenerTee::OnDataAvailable(nsIRequest*, nsIInputStream*,... netwerk/base/nsStreamListenerTee.cpp:102
3 libxul.so mozilla::net::nsHttpChannel::OnDataAvailable(nsIRequest*, nsIInputStream*, unsig... netwerk/protocol/http/nsHttpChannel.cpp:10898
4 libxul.so nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream*) netwerk/base/nsInputStreamPump.cpp:440
5 libxul.so PipeCallbackRunnable::Run() xpcom/io/nsPipe3.cpp:75
6 libxul.so mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail... xpcom/threads/TaskController.cpp:1401
7 libxul.so NS_ProcessNextEvent(nsIThread*, bool) xpcom/threads/nsThreadUtils.cpp:471
8 libxul.so mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) ipc/glue/MessagePump.cpp:83
9 libxul.so nsAppShell::Run() widget/gtk/nsAppShell.cpp:581
There is 1 crash in nightly 162 with buildid 20261111091117.
In the last 30 days, Firefox has 15 crashes (from 10 installations) on nightly and 4 crashes (from 3 installations) on release with this signature.
This signature has been reported since build 20230112150232 (2023-01-12), 1399 days before the build above.
This bug looks actionable because:
-
The parent process aborts in
WebTransportSessionProxy::OnDataAvailable(WebTransportSessionProxy.cpp:1073, an unconditionalMOZ_RELEASE_ASSERT(false)) when the WebTransport session's HTTP channel delivers response body data to the proxy.WebTransportSessionProxy::OnStartRequest, in theNEGOTIATINGorCLOSE_CALLBACK_PENDINGstate, clearsmChannel, changes the state toDONEand reportsOnSessionClosedto the listener.- It returns
NS_OKwithout cancelling the channel, so the channel stays alive and keeps reading. - If the response carries a body, for example a 200
text/htmlpage from a plain HTTP/1.1 fallback as described in bug 2084553 comment 0,nsHttpChannel::OnDataAvailablepasses it throughnsStreamListenerTeeto the proxy. WebTransportSessionProxy::OnDataAvailablehitsMOZ_RELEASE_ASSERT(false, "WebTransportSessionProxy::OnDataAvailable should not be called").
The crash reason string and frames 0-4 (
nsInputStreamPump->nsHttpChannel->nsStreamListenerTee-> proxy) match this chain. Frame 1,nsIndexedToHTML::OnDataAvailable, is a pure forwarding function and is likely a mis-symbolised frame. Which upstream path produced a body-bearing response for this particular session is not established. The fallback described in bug 2084553 is the reported trigger, not a verified one. Look first at why the session channel is not cancelled (orOnStartRequestdoes not return a failure) once the session is closed, and at how a WebTransport transaction can be served over a non-HTTP/3 connection. -
The failing code comes from e9bf86398696 (bug 1790398) by :dragana.
Impact
The parent process crashes, so the whole browser closes.
Possible fixes
- Cancel the session channel (for example
mChannel->Cancel(NS_ERROR_WEBTRANSPORT_CODE_BASE), or return a failure fromOnStartRequest) when the proxy leavesNEGOTIATINGwithout a session, so no body is pumped. - Make
OnDataAvailabledrain or discard the stream and fail the session instead of release-asserting, keeping aMOZ_ASSERTfor debug builds. - Possibly prevent WebTransport transactions from being dispatched to a non-HTTP/3 (HTTP/1.1) connection after
nsHttpConnectionMgr::ExcludeHttp3, as bug 2084553 comment 1 suggests.
How to confirm
Reproduce the bug 2084553 setup: an origin whose HTTPS RR advertises alpn=h3,h2 with an IPv6 hint, on a client with no IPv6 route, serving a 200 HTML body. Run new WebTransport(url) with MOZ_LOG=nsHttp:5,WebTransport:5 and check that the request falls back to HTTP/1.1 and that OnDataAvailable is reached after OnStartRequest in the NEGOTIATING state.
:mail, as triage owner, can you have a look please?
Posted automatically by Clouseau, which analyses nightly crashes with an LLM. Nothing above was written or checked by a human.
| Assignee | ||
Comment 4•5 days ago
|
||
This is likely a recent regression, so I think we should fix this.
| Assignee | ||
Comment 5•5 days ago
|
||
| Assignee | ||
Comment 6•5 days ago
|
||
Depends on D342094
Comment 8•4 days ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/121e18ebeb9c
https://hg.mozilla.org/mozilla-central/rev/f7e3538133d2
Updated•1 day ago
|
Description
•