Crash in [@ mozilla::ipc::PortLink::SendMessage | IPC_Message_Name=PBackgroundIDBRequest::Msg___delete__]
Categories
(Core :: Storage: IndexedDB, defect)
Tracking
()
People
(Reporter: mccr8, Unassigned, NeedInfo)
References
Details
(Keywords: crash, Whiteboard: dom-lws-bugdash-triage)
Crash Data
Crash report: https://crash-stats.mozilla.org/report/index/1e7a896d-5eef-43ac-b890-9b7660211117
MOZ_CRASH Reason: MOZ_CRASH(IPC message size is too large)
Top 10 frames of crashing thread:
0 xul.dll mozilla::ipc::PortLink::SendMessage ipc/glue/MessageLink.cpp:98
1 xul.dll mozilla::ipc::MessageChannel::DispatchMessage ipc/glue/MessageChannel.cpp:1987
2 xul.dll mozilla::ipc::MessageChannel::MessageTask::Run ipc/glue/MessageChannel.cpp:1855
3 xul.dll nsThread::ProcessNextEvent xpcom/threads/nsThread.cpp:1142
4 xul.dll mozilla::ipc::MessagePumpForNonMainThreads::Run ipc/glue/MessagePump.cpp:330
5 xul.dll MessageLoop::RunHandler ipc/chromium/src/base/message_loop.cc:324
6 xul.dll MessageLoop::Run ipc/chromium/src/base/message_loop.cc:306
7 xul.dll static nsThread::ThreadFunc xpcom/threads/nsThread.cpp:390
8 nss3.dll _PR_NativeRunThread nsprpub/pr/src/threads/combined/pruthr.c:399
9 nss3.dll pr_root nsprpub/pr/src/md/windows/w95thred.c:139
Comment 2•4 years ago
|
||
Since the crash volume is low (less than 5 per week), the severity is downgraded to S3. Feel free to change it back if you think the bug is still critical.
For more information, please visit auto_nag documentation.
Comment 3•2 years ago
|
||
(In reply to Jens Stutte [:jstutte] from comment #1)
I assume this is somehow related to bug 1706036.
This bug seems to be about trying to send too big messages from parent to child.
After a quick look, Reply_LoadKeys can end up doing this only when mOrderedItems is too large. Maybe there's a place where it's not properly synchronized with mValues.
Updated•2 years ago
|
Comment 4•10 days ago
|
||
This bug has had no comment from a person since 2024-09-13. Clouseau analysed a recent crash report on its signature; the analysis is below.
Crash report: https://crash-stats.mozilla.org/report/index/d1e30385-8414-426a-b89a-d84a50261119
MOZ_CRASH Reason:
MOZ_CRASH(IPC message size is too large)
Top 10 frames:
0 libxul.so mozilla::ipc::MessageChannel::Send(std::unique_ptr<IPC::Message, std::default_de... ipc/glue/MessageChannel.cpp:729
1 libxul.so mozilla::dom::indexedDB::PBackgroundIDBRequestParent::Send__delete__(mozilla::do... ipc/ipdl/PBackgroundIDBRequestParent.cpp:117
2 libxul.so mozilla::dom::indexedDB::(anonymous namespace)::NormalTransactionOp::SendSuccess... dom/indexedDB/ActorsParent.cpp:19044
3 libxul.so mozilla::dom::indexedDB::(anonymous namespace)::TransactionDatabaseOperationBase... dom/indexedDB/ActorsParent.cpp:17612
4 libxul.so mozilla::dom::indexedDB::(anonymous namespace)::TransactionDatabaseOperationBase... dom/indexedDB/ActorsParent.cpp
5 libxul.so NS_ProcessNextEvent(nsIThread*, bool) xpcom/threads/nsThreadUtils.cpp:471
6 libxul.so mozilla::ipc::MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate*) ipc/glue/MessagePump.cpp:327
7 libxul.so nsThread::ThreadFunc(void*) xpcom/threads/nsThread.cpp:436
8 libnspr4.so _pt_root nsprpub/pr/src/pthreads/ptthread.c:198
9 firefox-nightly-bin
There is 1 crash in nightly 162 with buildid 20261115213519.
In the last 30 days, Firefox has 75 crashes (from 50 installations) on esr, 23 crashes (from 21 installations) on release, 8 crashes (from 3 installations) on nightly and 4 crashes (from 3 installations) on beta/DevEdition with this signature.
This signature has been reported since build 20220220190121 (2022-02-20), 1729 days before the build above.
This bug looks actionable because:
-
The parent-process IndexedDB
NormalTransactionOp::SendSuccessResultsends aPBackgroundIDBRequest::__delete__response that is larger thanIPC::Channel::kMaximumMessageSize, soPortLink::SendMessagehitsMOZ_CRASH("IPC message size is too large").SendSuccessResultsetskMaxMessageSizetoIndexedDatabaseManager::MaxSerializedMsgSize()minus a fixed 10 MB overhead; that pref defaults toIPC::Channel::kMaximumMessageSize.GetResponsefillsresponseSizefrom the structured-clone data length (info.Size()) or key buffer length of each entry only, without per-record serialization overhead; the in-codeTODO(bug 1945040) says this does not reflect the real IPC message size.- When the estimate stays below
kMaxMessageSizebut the serialized response does not, probably for a largegetAll-style result, the guard lets it through andSend__delete__is called. PortLink::SendMessagefindsaMessage->size() > IPC::Channel::kMaximumMessageSizeand crashes.
The crash reason, the IPC message name in the signature, and frames 0-2 (
MessageChannel::SendfromSend__delete__atActorsParent.cpp:19044) fit this chain. WhichGetResponseran and the actual message size are not in this report. The owner should first look at making theGetResponsesize estimates, or the 10 MB margin, cover the real serialized size, so that the existing error path is used instead of a crash. -
The failing code comes from ca73f9471ede (bug 1275062) by :baku.
-
A second, independent analysis found the same failing line but traced it to 64361ca94917 (bug 1943951), so who owns this code is not settled.
Impact
The parent process crashes, so the whole browser closes.
Possible fixes
- Make each
GetResponsesize estimate include per-record serialization overhead (key buffers, file/blob arrays, per-entry headers), as the bug 1945040TODOdescribes, so thatresponseSize >= kMaxMessageSizecatches these responses and returnsNS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERRinstead of crashing. - Possibly measure the real serialized size before sending, or check it against
IPC::Channel::kMaximumMessageSizewith the same error path; callers already handle a failedTransactionOpResult, so the contract does not change. - Possibly widen the 10 MB
kMaxIDBMsgOverheadmargin forgetAll-style responses with many records.
How to confirm
Read the IPCMessageSize and IPCMessageLargeBufferShmemFailureSize annotations in this and sibling reports to see how far over the limit the message is and whether a shmem spill failed. An xpcshell test like test_response_too_large.js doing getAll over many records whose clone sizes add up to just under kMaxMessageSize should reproduce the crash instead of the expected error.
Code references:
- mozilla::ipc::PortLink::SendMessage
- mozilla::dom::indexedDB::(anonymous namespace)::NormalTransactionOp::SendSuccessResult
- kDefaultMaxSerializedMsgSize
- mozilla::dom::indexedDB::(anonymous namespace)::ObjectStoreGetRequestOp::GetResponse
:abienner, 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.
Posted here because mozilla::ipc::PortLink::SendMessage | IPC_Message_Name=PBackgroundIDBRequest::Msg___delete__ is another spelling of this bug's signature mozilla::ipc::PortLink::SendMessage | IPC_Message_Name=PBackgroundLSSnapshot::Reply_LoadKeys (frame IPC_Message_Name=PBackgroundLSSnapshot::Reply_LoadKeys became IPC_Message_Name=PBackgroundIDBRequest::Msg___delete__); [@ mozilla::ipc::PortLink::SendMessage | IPC_Message_Name=PBackgroundIDBRequest::Msg___delete__] has been added to its crash signatures.
Updated•10 days ago
|
Comment 5•9 days ago
|
||
(In reply to Clouseau (:calixte) from comment #4)
Posted here because
mozilla::ipc::PortLink::SendMessage | IPC_Message_Name=PBackgroundIDBRequest::Msg___delete__is another spelling of this bug's signaturemozilla::ipc::PortLink::SendMessage | IPC_Message_Name=PBackgroundLSSnapshot::Reply_LoadKeys(frameIPC_Message_Name=PBackgroundLSSnapshot::Reply_LoadKeysbecameIPC_Message_Name=PBackgroundIDBRequest::Msg___delete__);[@ mozilla::ipc::PortLink::SendMessage | IPC_Message_Name=PBackgroundIDBRequest::Msg___delete__]has been added to its crash signatures.
Haha, so I think the "another spelling" heuristic is very wrong here, but since IDB does already try and compensate for this and has mechanisms we can easily adjust and therefore is more actionable, and now there's also a quite long comment about the IDB situation, I'm morphing this bug to be about IDB. I'll ping :calixte on slack to tighten up the heuristic / make it more deterministic.
Description
•