Closed Bug 2084553 Opened 27 days ago Closed 4 days ago

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)

Firefox 158
Unspecified
Windows 11
defect

Tracking

()

RESOLVED FIXED
162 Branch
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):

  1. 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)
  2. HTTP/3 is not retried over IPv4. It is excluded for the origin:
    AllowToRetryDifferentIPFamilyForHttp3 ... allowToRetryWithDifferentIPFamily=0
    nsHttpConnectionMgr::ExcludeHttp3
  3. The page loads over HTTP/2 (IPv4).
  4. 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
  5. 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).

Crash Signature: [@ mozilla::net::WebTransportSessionProxy::OnDataAvailable ]
Has STR: --- → yes
Keywords: crash
See Also: → 1895535, 2047344

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.

The bug has a crash signature, thus the bug will be considered confirmed.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Severity: -- → S3
Priority: -- → P3
Whiteboard: [necko-triaged][necko-priority-next]

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 unconditional MOZ_RELEASE_ASSERT(false)) when the WebTransport session's HTTP channel delivers response body data to the proxy.

    1. WebTransportSessionProxy::OnStartRequest, in the NEGOTIATING or CLOSE_CALLBACK_PENDING state, clears mChannel, changes the state to DONE and reports OnSessionClosed to the listener.
    2. It returns NS_OK without cancelling the channel, so the channel stays alive and keeps reading.
    3. If the response carries a body, for example a 200 text/html page from a plain HTTP/1.1 fallback as described in bug 2084553 comment 0, nsHttpChannel::OnDataAvailable passes it through nsStreamListenerTee to the proxy.
    4. WebTransportSessionProxy::OnDataAvailable hits MOZ_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 (or OnStartRequest does 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 from OnStartRequest) when the proxy leaves NEGOTIATING without a session, so no body is pumped.
  • Make OnDataAvailable drain or discard the stream and fail the session instead of release-asserting, keeping a MOZ_ASSERT for 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.

Flags: needinfo?(mail)

This is likely a recent regression, so I think we should fix this.

Assignee: nobody → kershaw
Flags: needinfo?(mail)
Priority: P3 → P2
Whiteboard: [necko-triaged][necko-priority-next] → [necko-triaged][necko-priority-queue]
Pushed by kjang@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/32ad7ce07394 https://hg.mozilla.org/integration/autoland/rev/121e18ebeb9c Fail the WebTransport request when no session is established, r=necko-reviewers,jesup https://github.com/mozilla-firefox/firefox/commit/541bba92fbe3 https://hg.mozilla.org/integration/autoland/rev/f7e3538133d2 Only accept WebTransport sessions over HTTP/3 unless network.webtransport.http2.enabled is set, r=necko-reviewers,jesup
Status: NEW → RESOLVED
Closed: 4 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: