Open Bug 2079816 Opened 1 month ago Updated 1 month ago

Crash in [@ mozilla::net::nsHttpConnectionMgr::EnsureSocketThreadTarget]

Categories

(Core :: Networking: HTTP, defect, P3)

defect

Tracking

()

Tracking Status
firefox159 --- affected

People

(Reporter: clouseau-bot, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: crash, Whiteboard: [necko-triaged])

Crash Data

Attachments

(1 external file)

Crash report: https://crash-stats.mozilla.org/report/index/b2708bf6-378b-4501-93f1-b76f10261002

Crash Reason:

EXCEPTION_ACCESS_VIOLATION_READ at 0x0000000000000000

Top 10 frames:

0  xul.dll  mozilla::net::nsHttpConnectionMgr::EnsureSocketThreadTarget()  netwerk/protocol/http/nsHttpConnectionMgr.cpp:118
1  xul.dll  mozilla::net::nsHttpConnectionMgr::PostEvent(void (mozilla::net::nsHttpConnectio...  netwerk/protocol/http/nsHttpConnectionMgr.cpp:252
2  xul.dll  mozilla::net::nsHttpConnectionMgr::StoreServerCertHashes(mozilla::net::nsHttpCon...  netwerk/protocol/http/nsHttpConnectionMgr.cpp:4158
3  xul.dll  mozilla::net::nsHttpChannel::ContinueOnBeforeConnect(bool, nsresult, bool)  netwerk/protocol/http/nsHttpChannel.cpp:1270
4  xul.dll  mozilla::net::nsHttpChannel::MaybeUseHTTPSRRForUpgrade(bool, nsresult)  netwerk/protocol/http/nsHttpChannel.cpp:1129
5  xul.dll  std::_Func_impl_no_alloc<`lambda at .\..\..\..\..\..\checkouts\gecko\netwerk\pro...
6  xul.dll  mozilla::net::nsHttpChannel::CallOrWaitForResume(std::function<nsresult (mozilla...  netwerk/protocol/http/nsHttpChannel.cpp:11925
7  xul.dll  mozilla::detail::RunnableFunction<`lambda at .\..\..\..\..\..\checkouts\gecko\ne...  xpcom/threads/nsThreadUtils.h:535
8  xul.dll  mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail...  xpcom/threads/TaskController.cpp:1367
9  xul.dll  NS_ProcessNextEvent(nsIThread*, bool)  xpcom/threads/nsThreadUtils.cpp:471

There is 1 crash in nightly 159 with buildid 20261001214112.

In the last 30 days, Firefox has 1 crash on nightly and 1 crash on release with this signature.

This signature has been reported since build 20141013200257 (2014-10-13), 4371 days before the build above.

This bug looks actionable because:

  • In the parent process, nsHttpChannel::ContinueOnBeforeConnect calls StoreServerCertHashes on a null nsHttpConnectionMgr for WebTransport channels when networking runs in the socket process, and the read of mIsShuttingDown faults.

    1. WebTransportSessionProxy::AsyncConnectWithClient sets mWebTransportSessionEventListener on every WebTransport channel it opens.
    2. nsHttpChannel::ContinueOnBeforeConnect sees that listener and calls gHttpHandler->ConnMgr()->StoreServerCertHashes(...) with no null check (nsHttpChannel.cpp:1270-1272).
    3. With the socket process in use, nsHttpHandler::InitConnectionMgr made mConnMgr an HttpConnectionMgrParent, whose AsHttpConnectionMgr() returns nullptr. ConnMgr() guards this only with a debug-only MOZ_ASSERT_IF(nsIOService::UseSocketProcess(), XRE_IsSocketProcess()).
    4. StoreServerCertHashes runs with this == nullptr, calls PostEvent, and EnsureSocketThreadTarget reads mIsShuttingDown from the null object (nsHttpConnectionMgr.cpp:118).

    The fault is a 4-byte read at 0x30 (mov eax, dword [rcx + 0x30]) inside the inlined Atomic<bool> load on frame 0, which fits a member read from a null this. A null mConnMgr would instead fault near 0x0 in the caller. The call site at nsHttpChannel.cpp:1271 is the only caller of StoreServerCertHashes. Look first at that call site: it should either skip or forward the server certificate hashes to the socket process through HttpConnectionMgrParent when ConnMgr() is null, rather than calling into it unconditionally.

  • The failing code comes from c508a42a91f6 (bug 1873263) by :marten.richter.

Code references:

:valentin, as triage owner, can you have a look please?

Filed automatically by Clouseau, which analyses nightly crashes with an LLM. Nothing above was written or checked by a human. Please close it as INVALID if it is wrong — that is useful feedback, not a nuisance.

This is not an independent Mozilla discovery: the crash is known here only because somebody submitted the crash report linked at the top. If this duplicates an existing report, please resolve THIS bug as the duplicate and leave the credit with the earlier reporter.

Flags: needinfo?(valentin.gosu)

When networking runs in the socket process, gHttpHandler->ConnMgr() returns null in the parent process (mConnMgr is an HttpConnectionMgrParent). nsHttpChannel::ContinueOnBeforeConnect unconditionally called ConnMgr()->StoreServerCertHashes() for WebTransport channels, causing a null-this crash in nsHttpConnectionMgr::EnsureSocketThreadTarget.

WebTransport is not implemented over the socket process yet (HttpTransactionParent::SetIsForWebTransport is a TODO, bug 1791727), so fail such channels with NS_ERROR_NOT_IMPLEMENTED instead. The WebTransport session is then rejected cleanly.

Severity: -- → S3
Depends on: 2077172
Flags: needinfo?(valentin.gosu)
Priority: -- → P3
Whiteboard: [necko-triaged]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: