Closed Bug 1680977 Opened 3 years ago Closed 3 years ago

Crash in [@ mozilla::ipc::MessageChannel::Send | mozilla::dom::PContentChild::SendStartVisitedQueries | IPC_Message_Name=PContent::Msg_StartVisitedQueries]

Categories

(Toolkit :: Places, defect, P2)

Unspecified
Windows 10
defect

Tracking

()

VERIFIED FIXED
86 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox83 --- unaffected
firefox84 --- unaffected
firefox85 --- verified
firefox86 --- verified

People

(Reporter: sebo, Assigned: emilio)

Details

(Keywords: crash)

Crash Data

Attachments

(5 files)

Crash report: https://crash-stats.mozilla.org/report/index/1ef9719c-cbbc-4066-95f8-5f53f0201206

MOZ_CRASH Reason: MOZ_CRASH(IPC message size is too large)

Top 10 frames of crashing thread:

0 xul.dll mozilla::ipc::MessageChannel::Send ipc/glue/MessageChannel.cpp:968
1 xul.dll mozilla::dom::PContentChild::SendStartVisitedQueries ipc/ipdl/PContentChild.cpp:3267
2 xul.dll mozilla::places::History::StartPendingVisitedQueries toolkit/components/places/History.cpp:2168
3 xul.dll mozilla::detail::RunnableFunction<`lambda at /builds/worker/checkouts/gecko/docshell/base/BaseHistory.cpp:32:7'>::Run xpcom/threads/nsThreadUtils.h:534
4 xul.dll mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal xpcom/threads/TaskController.cpp:732
5 xul.dll nsThread::ProcessNextEvent xpcom/threads/nsThread.cpp:1200
6 xul.dll mozilla::ipc::MessagePump::Run ipc/glue/MessagePump.cpp:87
7 xul.dll MessageLoop::RunHandler ipc/chromium/src/base/message_loop.cc:327
8 xul.dll MessageLoop::Run ipc/chromium/src/base/message_loop.cc:309
9 xul.dll nsBaseAppShell::Run widget/nsBaseAppShell.cpp:137

Steps to reproduce the issue:

  1. Open https://api.csswg.org/bikeshed/
  2. Upload a CSS Bikeshed file (e.g. https://github.com/w3c/csswg-drafts/blob/master/css-syntax-3/Overview.bs)
  3. Wait a moment

Sebastian

I reproduced this under a debugger. The message contains 896 URLs; most of them appear to be copies of the same data URL with a 642771-byte path. The total message size is over half a gigabyte.

Component: IPC → Places
Product: Core → Toolkit

There's no reason to send a query to the parent process for the visited status of data URLs, as we will never store them in history. We should probably "fix" this by checking nsNavHistory::CanAddURIToHistory before starting any SQL queries or sending messages to the parent process.

Flags: needinfo?(emilio)
Assignee: nobody → emilio
Flags: needinfo?(emilio)

And do some minor improvements (use static prefs etc) while at it.

Depends on D99583

Keywords: leave-open
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2db8a64f71ba
Remove dead Database::MaxUrlLength(). r=mak
Attachment #9192831 - Attachment description: Bug 1680977 - Don't bother sending visited queries for non-visitable URIs. r=mak → Bug 1680977 - Don't bother sending visited queries for URIs that we never store in history. r=mak
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f74a9a5edbef
Move nsNavHistory::CanAddURIToHistory to BaseHistory. r=mak
https://hg.mozilla.org/integration/autoland/rev/2f43fcc8980c
Don't bother sending visited queries for URIs that we never store in history. r=mak

aLink might be null in the parent process, and even though it's only
null when getting URIs via IPC (which should never hit this code path in
a correct execution), we don't trust the child process so this is safer.

Severity: -- → S3
Priority: -- → P2
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch

The patch landed in nightly and beta is affected.
:emilio, is this bug important enough to require an uplift?
If not please set status_beta to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(emilio)

Comment on attachment 9193092 [details]
Bug 1680977 - Add a null-check.

Beta/Release Uplift Approval Request

  • User impact if declined: crashes when a page has lots of links with big data URIs.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: comment 0
  • List of other uplifts needed: none
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Doesn't seem like a common situation, but it's a relatively easy fix, so might be worth taking
  • String changes made/needed: none
Flags: needinfo?(emilio)
Attachment #9193092 - Flags: approval-mozilla-beta?
Attachment #9192829 - Flags: approval-mozilla-beta?
Attachment #9192830 - Flags: approval-mozilla-beta?
Attachment #9192831 - Flags: approval-mozilla-beta?
Flags: qe-verify+
QA Whiteboard: [qa-triaged]

Reproduced the crash on affected 85.0b4 (64-bit) on Windows 10, macOS 10.15 and Ubuntu 16.04.
Verified-fixed on the latest Firefox Nightly 86.0a1 (2020-12-21)(20201221155804) on the above mentioned OSes.
Waiting for the fix to be uplifted on Beta as well if approved.

Comment on attachment 9192829 [details]
Bug 1680977 - Remove dead Database::MaxUrlLength(). r=mak

approved for 85.0b5

Attachment #9192829 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9192830 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9192831 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9193092 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Pushed by jcristau@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/af9f27bb7080
stop defining now-unused PREF_HISTORY_MAXURLLEN* macros. r=emilio

Tested right now in 85.0b6 (64-Bit) and it works fine for me while it was still broken in 85.0b5. Thanks a lot for the quick fix! And a Happy New Year to you all!

Sebastian

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: