Crash in mozilla::ipc::ProcessLink::SendMessage | IPC_Message_Name=PContent::Msg_SetClipboard on attempt to copy much text into the clipboard
Categories
(Core :: DOM: Copy & Paste and Drag & Drop, defect)
Tracking
()
People
(Reporter: aryx, Assigned: edgar)
References
(Regression)
Details
(Keywords: crash, regression, reproducible, Whiteboard: widget-next)
Crash Data
Attachments
(1 file)
This bug is for crash report bp-5e257e8c-18d7-4fa1-84c0-f112b0190131.
Top 10 frames of crashing thread:
0 xul.dll mozilla::ipc::ProcessLink::SendMessage ipc/glue/MessageLink.cpp:152
1 xul.dll mozilla::ipc::MessageChannel::Send ipc/glue/MessageChannel.cpp:995
2 xul.dll mozilla::dom::PContentChild::SendSetClipboard ipc/ipdl/PContentChild.cpp:2711
3 xul.dll nsClipboardProxy::SetData widget/nsClipboardProxy.cpp:36
4 xul.dll static nsresult SelectionCopyHelper dom/base/nsCopySupport.cpp:269
5 xul.dll nsCopySupport::FireClipboardEvent dom/base/nsCopySupport.cpp:801
6 xul.dll nsClipboardCommand::DoCommand dom/base/nsGlobalWindowCommands.cpp:525
7 xul.dll nsControllerCommandTable::DoCommand dom/commandhandler/nsControllerCommandTable.cpp:140
8 xul.dll nsBaseCommandController::DoCommand dom/commandhandler/nsBaseCommandController.cpp:123
9 xul.dll nsresult nsXBLPrototypeHandler::DispatchXBLCommand dom/xbl/nsXBLPrototypeHandler.cpp:541
Reproduces on Ubuntu 16.10 (tested with 64.0 64-bit) and Windows 8.1 (latest Nightly 67.0a1 32-bit and 65.0 64-bit)
Steps to reproduce:
- Open https://taskcluster-artifacts.net/HYfODDPwRwqqFSFf1QzG2w/0/public/logs/live_backing.log
- Hit Ctrl+A (crashes on Linux, auto copy?)
- Hit Ctrl+C
Linux crash report: bp-1f114fb3-f707-4239-8622-3a3ac0190131
![]() |
||
Updated•6 years ago
|
Comment 1•6 years ago
|
||
str |
I reproduced this with bp-d1490658-2ef2-434a-8982-3cede0190629
STR:
- Create a 64 MB file, e.g.
python -c 'print("x x "*16777216)' > /tmp/quitebig.txt
- Hit Ctrl-A. On Linux, selecting text puts the text on the primary clipboard.
- If not on Linux, press Ctrl-C to put the text on the clipboard.
Expected:
- Text is selected, and put on the clipboard.
- Alternatively, the text is not put on the clipboard, but an error is reported to the global JS console / stderr.
Actual:
- Tab crashes.
Updated•5 years ago
|
Comment 3•5 years ago
|
||
The issue is that there is an attempt to serialize the whole nsTransferable to send it over IPC. There used to be a file-based cache for large clipboard data (which results in a reasonably-sized IPC message), but that was disabled for content processes because opening files is not allowed in the content process (bug 1482540).
There is some more context on this cache and its behavior at https://bugzilla.mozilla.org/show_bug.cgi?id=1433030#c20 and the linked bugs.
To fix this bug without regressing on behavior (i.e. still being able to copy lots of data), the clipboard content should be shared separately from the main IPC message when it's too large.
Updated•5 years ago
|
Comment 5•4 years ago
|
||
Bug 1564196 comment 1 says this may be a regression from 2015 bug 1071562.
The 67 MB log file that crashed Firefox can be selected and copied in Chrome. Safari, however, won't even select the text.
Updated•4 years ago
|
Updated•4 years ago
|
Comment 7•4 years ago
|
||
Added a signature
Updated•3 years ago
|
Comment 8•3 years ago
|
||
Gian-Carlo, this is a P1 bug but currently doesn't have an owner. From what I can tell based on the crash reports, it affects all platforms. Would you be able to assign this to someone, or lower the priority to a P2? Thank you!
Comment 9•3 years ago
|
||
We won't get to this right away, but it definitely looks like something that should be on our radar.
Updated•3 years ago
|
Updated•3 years ago
|
Comment 11•3 years ago
|
||
This is a copy-paste issue caused by the message size limitation in IPC.
A fix for this could use Shmems to pass the data instead of strings in IPCDataTransferData
. The right nexus point for this decision appears to be nsContentUtils::TransferableToIPCTransferable
, which already "promotes" C-strings to Shmems but uses nsStrings for wide strings. It could use the same "Shmem promotion" for wide-strings, and the other data types. In all cases, the decision should be based on message size, since allocating and copying to Shmem uses resources and time and is used to avoid this failure.
Updated•3 years ago
|
Comment 12•3 years ago
|
||
Edgar, this may be interesting to you to consider for other recent related clipboard work.
(And I think we need to assess the severity/priority as well.)
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Comment 13•3 years ago
|
||
Edgar, given the low volume, should this be S3 instead of S2?
Assignee | ||
Comment 14•3 years ago
|
||
(In reply to Marco Castelluccio [:marco] from comment #13)
Edgar, given the low volume, should this be S3 instead of S2?
The volume is low, but quite easy to reproduce, so I am inclined to keep this S2.
Assignee | ||
Comment 15•3 years ago
|
||
Depends on D146074
Assignee | ||
Comment 16•3 years ago
|
||
Assignee | ||
Updated•3 years ago
|
Comment 18•3 years ago
|
||
Comment 19•3 years ago
|
||
bugherder |
Updated•3 years ago
|
Updated•3 years ago
|
Comment 20•3 years ago
|
||
I’ve reproduced this signature crash with Fx 97.0a1 (2022-01-01) on Windows 10.
Verified fixed with Fx 103.0a1 (2022-06-07) and Fx 102.0b5 on Windows 10, macOS 12.1 and Ubuntu 20.04.
Description
•