[e10s] Don't crash in the drag and drop code

RESOLVED DUPLICATE of bug 966467

Status

()

RESOLVED DUPLICATE of bug 966467
5 years ago
4 years ago

People

(Reporter: billm, Assigned: billm)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

It's pretty annoying when this happens. We should do this before we do bug 936092.
Created attachment 8363260 [details] [diff] [review]
disable-drag-and-drop

This stopped the crashes I was getting.
Assignee: nobody → wmccloskey
Status: NEW → ASSIGNED
Attachment #8363260 - Flags: review?(bugs)
Comment on attachment 8363260 [details] [diff] [review]
disable-drag-and-drop

Does this affect to b2g? Do we support in-one-process-dnd there?
Where do we actually crash?
(In reply to Olli Pettay [:smaug] from comment #2)
> Comment on attachment 8363260 [details] [diff] [review]
> disable-drag-and-drop
> 
> Does this affect to b2g? Do we support in-one-process-dnd there?

I was hoping you would know that :-). I'm pretty sure it doesn't though. In gonk/nsWidgetFactory.cpp, no drag service gets registered. Setting ni? Fabrice and Gregor just in case.

> Where do we actually crash?

Here's the stack. It's in some GTK widget code.

#0  0x00007fffecf5011e in gdk_window_get_user_data () from /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0
#1  0x00007ffff24d33bb in get_gtk_widget_for_gdk_window (window=0xa5a5a5a5a5a50101)
    at /home/billm/mozilla/in2/widget/gtk/nsWindow.cpp:4884
#2  0x00007ffff24d24e0 in nsWindow::GetMozContainerWidget (this=0x7fffe3d584e0)
    at /home/billm/mozilla/in2/widget/gtk/nsWindow.cpp:4472
#3  0x00007ffff24de5b8 in GetGtkWindow (aDocument=0x7fffe1268ad8)
    at /home/billm/mozilla/in2/widget/gtk/nsDragService.cpp:274
#4  0x00007ffff24de90b in nsDragService::InvokeDragSession (this=0x7fffdfc10480, aDOMNode=0x7fffdfcd7cd0, 
    aArrayTransferables=0x7fffdfdea780, aRegion=0x0, aActionType=7)
    at /home/billm/mozilla/in2/widget/gtk/nsDragService.cpp:348
#5  0x00007ffff251753e in nsBaseDragService::InvokeDragSessionWithSelection (this=0x7fffdfc10480, aSelection=
    0x7fffe31d1d80, aTransferableArray=0x7fffdfdea780, aActionType=7, aDragEvent=0x7fffe3df2860, aDataTransfer=
    0x7fffdf209980) at /home/billm/mozilla/in2/widget/xpwidgets/nsBaseDragService.cpp:279
#6  0x00007ffff27f38ea in nsEventStateManager::DoDefaultDragStart (this=0x7fffe8417890, aPresContext=
    0x7fffe12cc800, aDragEvent=0x7fffffffa9f0, aDataTransfer=0x7fffdf209980, aDragTarget=0x7fffdfcd7c50, aSelection=
    0x7fffe31d1d80) at /home/billm/mozilla/in2/dom/events/nsEventStateManager.cpp:2374
#7  0x00007ffff27f2f74 in nsEventStateManager::GenerateDragGesture (this=0x7fffe8417890, aPresContext=
    0x7fffe12cc800, aEvent=0x7fffffffb330) at /home/billm/mozilla/in2/dom/events/nsEventStateManager.cpp:2180
#8  0x00007ffff27efc90 in nsEventStateManager::PreHandleEvent (this=0x7fffe8417890, aPresContext=0x7fffe12cc800, 
    aEvent=0x7fffffffb330, aTargetFrame=0x7fffdf24dae0, aStatus=0x7fffffffb22c)
    at /home/billm/mozilla/in2/dom/events/nsEventStateManager.cpp:1118
#9  0x00007ffff32d2b69 in PresShell::HandleEventInternal (this=0x7fffe1251800, aEvent=0x7fffffffb330, aStatus=
    0x7fffffffb22c) at /home/billm/mozilla/in2/layout/base/nsPresShell.cpp:7028
#10 0x00007ffff32d1e82 in PresShell::HandlePositionedEvent (this=0x7fffe1251800, aTargetFrame=0x7fffdf24dae0, 
    aEvent=0x7fffffffb330, aEventStatus=0x7fffffffb22c) at /home/billm/mozilla/in2/layout/base/nsPresShell.cpp:6796
#11 0x00007ffff32d1449 in PresShell::HandleEvent (this=0x7fffe1251800, aFrame=0x7fffe12c9430, aEvent=
    0x7fffffffb330, aDontRetargetEvents=false, aEventStatus=0x7fffffffb22c)
    at /home/billm/mozilla/in2/layout/base/nsPresShell.cpp:6599
#12 0x00007ffff2b1b1f0 in nsViewManager::DispatchEvent (this=0x7fffe126fec0, aEvent=0x7fffffffb330, aView=
    0x7fffe12488d0, aStatus=0x7fffffffb22c) at /home/billm/mozilla/in2/view/src/nsViewManager.cpp:753
#13 0x00007ffff2b18846 in nsView::HandleEvent (this=0x7fffe12488d0, aEvent=0x7fffffffb330, aUseAttachedEvents=false)
    at /home/billm/mozilla/in2/view/src/nsView.cpp:1084
#14 0x00007ffff2513ba3 in mozilla::widget::PuppetWidget::DispatchEvent (this=0x7fffe3d584e0, event=0x7fffffffb330, 
    aStatus=@0x7fffffffb308: nsEventStatus_eIgnore) at /home/billm/mozilla/in2/widget/xpwidgets/PuppetWidget.cpp:300
#15 0x00007ffff24973fc in mozilla::dom::TabChild::DispatchWidgetEvent (this=0x7fffe3227400, event=...)
    at /home/billm/mozilla/in2/dom/ipc/TabChild.cpp:1984
Flags: needinfo?(fabrice)
Flags: needinfo?(anygregor)
Comment on attachment 8363260 [details] [diff] [review]
disable-drag-and-drop

Since this is about GetGtkWindow doing 
static_cast<nsWindow*>(widget.get()) for a puppet widget, I'd feel
much more comfortable if we disabled creating  dragservice on
content processes. We'll need anyway some content process specific service 
which disables OS specific stuff, so we could just disable OS specific services now.
Basically implement NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragService)
in a different way so that before calling nsDragService it checks the process type.

The patch isn't enough since we try to access dragservice in many places.
Attachment #8363260 - Flags: review?(bugs) → review-
OK. Now I'm thinking maybe we should have a better way to disable OS services across all operating systems. It's kind of annoying if all three platforms will need to have this code in nsWidgetFactory.cpp. Especially since we're going to have to do this for more than just drag and drop. I'll think about it some more.
Flags: needinfo?(fabrice)
Flags: needinfo?(anygregor)
I decided to take a different approach in bug 966467.
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 966467
You need to log in before you can comment on or make changes to this bug.