Closed Bug 1034321 Opened 10 years ago Closed 10 years ago

Printing a remote tab hangs the browser

Categories

(Core :: Printing: Output, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla33
Tracking Status
e10s + ---

People

(Reporter: jimm, Assigned: bjacob)

References

Details

Attachments

(1 file, 1 obsolete file)

STR:

1) open a remote tab and surf to a site
2) print the tab via the file menu

result: browser hangs
See Also: → 927188
Assignee: nobody → bjacob
Blocks: e10s-m1
The hang happens when the parent and child processes are both waiting for a response from each other.

Parent process main thread call stack (also see JS Stack at the bottom, showing we're acting on the JS print function)

(gdb) bt
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f07184dcb01 in PR_WaitCondVar (cvar=0x7f06f264d900, timeout=4294967295) at /home/bjacob/hack/mozilla-central/nsprpub/pr/src/pthreads/ptsynch.c:385
#2  0x00007f070f48e9af in mozilla::CondVar::Wait (this=0x7f06f264d8d8, aInterval=4294967295) at /home/bjacob/hack/mozilla-central/xpcom/glue/BlockingResourceBase.cpp:352
#3  0x00007f070f5b7462 in mozilla::Monitor::Wait (this=0x7f06f264d8c0, aInterval=4294967295) at ../../dist/include/mozilla/Monitor.h:40
#4  0x00007f070fb88408 in mozilla::ipc::MessageChannel::WaitForSyncNotify (this=0x7f06f28de860) at /home/bjacob/hack/mozilla-central/ipc/glue/MessageChannel.cpp:1350
#5  0x00007f070fb87cb0 in mozilla::ipc::MessageChannel::SendAndWait (this=0x7f06f28de860, aMsg=0x7f06f1f95510, aReply=0x7fff0ce79990)
    at /home/bjacob/hack/mozilla-central/ipc/glue/MessageChannel.cpp:674
#6  0x00007f070fb8814e in mozilla::ipc::MessageChannel::UrgentCall (this=0x7f06f28de860, aMsg=0x7f06f1f95510, aReply=0x7fff0ce79990)
    at /home/bjacob/hack/mozilla-central/ipc/glue/MessageChannel.cpp:616
#7  0x00007f070fb88a33 in mozilla::ipc::MessageChannel::Call (this=0x7f06f28de860, aMsg=0x7f06f1f95510, aReply=0x7fff0ce79990)
    at /home/bjacob/hack/mozilla-central/ipc/glue/MessageChannel.cpp:715
#8  0x00007f070fe36129 in mozilla::jsipc::PJavaScriptParent::CallCallOrConstruct (this=0x7f06f2439248, objId=@0x7fff0ce79da8: 45, argv=..., 
    construct=@0x7fff0ce79db7: false, rs=0x7fff0ce79bf8, result=0x7fff0ce79c10, outparams=0x7fff0ce79bf0) at ./PJavaScriptParent.cpp:569
#9  0x00007f07100125be in mozilla::jsipc::JavaScriptBase<mozilla::jsipc::PJavaScriptParent>::CallCallOrConstruct (this=0x7f06f2439230, objId=@0x7fff0ce79da8: 45, 
    argv=..., construct=@0x7fff0ce79db7: false, rs=0x7fff0ce79bf8, result=0x7fff0ce79c10, outparams=0x7fff0ce79bf0)
    at /home/bjacob/hack/mozilla-central/js/ipc/JavaScriptBase.h:170
#10 0x00007f0710009504 in mozilla::jsipc::WrapperOwner::callOrConstruct (this=0x7f06f2439230, cx=0x7f070603c870, proxy=..., args=..., construct=false)
    at /home/bjacob/hack/mozilla-central/js/ipc/WrapperOwner.cpp:539
#11 0x00007f071000a27f in CPOWProxyHandler::call (this=0x7f07170e9ae8 <CPOWProxyHandler::singleton>, cx=0x7f070603c870, proxy=..., args=...)
    at /home/bjacob/hack/mozilla-central/js/ipc/WrapperOwner.cpp:486
#12 0x00007f071441258d in js::Proxy::call (cx=0x7f070603c870, proxy=..., args=...) at /home/bjacob/hack/mozilla-central/js/src/jsproxy.cpp:2425
#13 0x00007f071441496a in js::proxy_Call (cx=0x7f070603c870, argc=2, vp=0x7fff0ce7a698) at /home/bjacob/hack/mozilla-central/js/src/jsproxy.cpp:2812
#14 0x00007f0714555405 in js::CallJSNative (cx=0x7f070603c870, native=0x7f0714414870 <js::proxy_Call(JSContext*, unsigned int, JS::Value*)>, args=...)
    at /home/bjacob/hack/mozilla-central/js/src/jscntxtinlines.h:230
#15 0x00007f071451ba40 in js::Invoke (cx=0x7f070603c870, args=..., construct=js::NO_CONSTRUCT) at /home/bjacob/hack/mozilla-central/js/src/vm/Interpreter.cpp:448
#16 0x00007f07144e6164 in js::Invoke (cx=0x7f070603c870, thisv=..., fval=..., argc=2, argv=0x7f06ffd7d170, rval=...)
    at /home/bjacob/hack/mozilla-central/js/src/vm/Interpreter.cpp:511
#17 0x00007f0714408989 in js::DirectProxyHandler::call (this=0x7f0717212fb0 <js::CrossCompartmentWrapper::singleton>, cx=0x7f070603c870, proxy=..., args=...)
    at /home/bjacob/hack/mozilla-central/js/src/jsproxy.cpp:458
#18 0x00007f071443544e in js::CrossCompartmentWrapper::call (this=0x7f0717212fb0 <js::CrossCompartmentWrapper::singleton>, cx=0x7f070603c870, wrapper=..., args=...)
    at /home/bjacob/hack/mozilla-central/js/src/jswrapper.cpp:449
#19 0x00007f071441258d in js::Proxy::call (cx=0x7f070603c870, proxy=..., args=...) at /home/bjacob/hack/mozilla-central/js/src/jsproxy.cpp:2425
#20 0x00007f071441496a in js::proxy_Call (cx=0x7f070603c870, argc=2, vp=0x7f06ffd7d160) at /home/bjacob/hack/mozilla-central/js/src/jsproxy.cpp:2812
#21 0x00007f0714555405 in js::CallJSNative (cx=0x7f070603c870, native=0x7f0714414870 <js::proxy_Call(JSContext*, unsigned int, JS::Value*)>, args=...)
    at /home/bjacob/hack/mozilla-central/js/src/jscntxtinlines.h:230
#22 0x00007f071451ba40 in js::Invoke (cx=0x7f070603c870, args=..., construct=js::NO_CONSTRUCT) at /home/bjacob/hack/mozilla-central/js/src/vm/Interpreter.cpp:448
#23 0x00007f07145119e3 in Interpret (cx=0x7f070603c870, state=...) at /home/bjacob/hack/mozilla-central/js/src/vm/Interpreter.cpp:2551
#24 0x00007f071450497a in js::RunScript (cx=0x7f070603c870, state=...) at /home/bjacob/hack/mozilla-central/js/src/vm/Interpreter.cpp:402
#25 0x00007f071451bc43 in js::Invoke (cx=0x7f070603c870, args=..., construct=js::NO_CONSTRUCT) at /home/bjacob/hack/mozilla-central/js/src/vm/Interpreter.cpp:474
#26 0x00007f07144e6164 in js::Invoke (cx=0x7f070603c870, thisv=..., fval=..., argc=1, argv=0x7fff0ce7e320, rval=...)
    at /home/bjacob/hack/mozilla-central/js/src/vm/Interpreter.cpp:511
#27 0x00007f0714304e76 in JS::Call (cx=0x7f070603c870, thisv=..., fval=..., args=..., rval=...) at /home/bjacob/hack/mozilla-central/js/src/jsapi.cpp:5078
#28 0x00007f0710a129fb in mozilla::dom::EventHandlerNonNull::Call (this=0x7f06f7186b80, cx=0x7f070603c870, aThisVal=..., event=..., aRetVal=..., aRv=...)
    at ./EventHandlerBinding.cpp:35
#29 0x00007f07116e15ee in mozilla::dom::EventHandlerNonNull::Call<nsISupports*> (this=0x7f06f7186b80, thisObjPtr=@0x7f06f706a658: 0x7f06f7099ce0, event=..., aRetVal=..., 
    aRv=..., aExceptionHandling=mozilla::dom::CallbackObject::eReportExceptions) at ../../dist/include/mozilla/dom/EventHandlerBinding.h:62
#30 0x00007f07116d2d3f in mozilla::JSEventHandler::HandleEvent (this=0x7f06f706a640, aEvent=0x7f06e82515b0)
    at /home/bjacob/hack/mozilla-central/dom/events/JSEventHandler.cpp:215
#31 0x00007f07116b15c3 in mozilla::EventListenerManager::HandleEventSubType (this=0x7f06f7099d70, aListener=0x7f06f7099da0, aDOMEvent=0x7f06e82515b0, 
    aCurrentTarget=0x7f06f7099ce0) at /home/bjacob/hack/mozilla-central/dom/events/EventListenerManager.cpp:950
#32 0x00007f07116b18e6 in mozilla::EventListenerManager::HandleEventInternal (this=0x7f06f7099d70, aPresContext=0x7f06f7c46800, aEvent=0x7f06e5aae700, 
    aDOMEvent=0x7fff0ce7ee90, aCurrentTarget=0x7f06f7099ce0, aEventStatus=0x7fff0ce7ee98) at /home/bjacob/hack/mozilla-central/dom/events/EventListenerManager.cpp:1011
#33 0x00007f07116c9be9 in mozilla::EventListenerManager::HandleEvent (this=0x7f06f7099d70, aPresContext=0x7f06f7c46800, aEvent=0x7f06e5aae700, aDOMEvent=0x7fff0ce7ee90, 
    aCurrentTarget=0x7f06f7099ce0, aEventStatus=0x7fff0ce7ee98) at ../../dist/include/mozilla/EventListenerManager.h:328
#34 0x00007f07116b87ff in mozilla::EventTargetChainItem::HandleEvent (this=0x7f06f807b008, aVisitor=..., aCd=...)
    at /home/bjacob/hack/mozilla-central/dom/events/EventDispatcher.cpp:199
#35 0x00007f07116ab7cb in mozilla::EventTargetChainItem::HandleEventTargetChain (aChain=..., aVisitor=..., aCallback=0x0, aCd=...)
    at /home/bjacob/hack/mozilla-central/dom/events/EventDispatcher.cpp:292
#36 0x00007f07116ad031 in mozilla::EventDispatcher::Dispatch (aTarget=0x7f06f7099ce0, aPresContext=0x7f06f7c46800, aEvent=0x7f06e5aae700, aDOMEvent=0x7f06e82515b0, 
    aEventStatus=0x7fff0ce7f11c, aCallback=0x0, aTargets=0x0) at /home/bjacob/hack/mozilla-central/dom/events/EventDispatcher.cpp:604
#37 0x00007f07116924fa in mozilla::EventDispatcher::DispatchDOMEvent (aTarget=0x7f06f7099ce0, aEvent=0x0, aDOMEvent=0x7f06e82515b0, aPresContext=0x7f06f7c46800, 
    aEventStatus=0x7fff0ce7f11c) at /home/bjacob/hack/mozilla-central/dom/events/EventDispatcher.cpp:668
#38 0x00007f0711c4bad2 in nsINode::DispatchEvent (this=0x7f06f7099ce0, aEvent=0x7f06e82515b0, aRetVal=0x7fff0ce7f227)
    at /home/bjacob/hack/mozilla-central/content/base/src/nsINode.cpp:1282
#39 0x00007f0711b15f6d in nsContentUtils::DispatchXULCommand (aTarget=0x7f06f7099ce0, aTrusted=true, aSourceEvent=0x7f06e77dcd40, aShell=0x0, aCtrl=false, aAlt=false, 
    aShift=false, aMeta=false) at /home/bjacob/hack/mozilla-central/content/base/src/nsContentUtils.cpp:5907
#40 0x00007f071216efd2 in nsXULElement::PreHandleEvent (this=0x7f06f7126b80, aVisitor=...)
    at /home/bjacob/hack/mozilla-central/content/xul/content/src/nsXULElement.cpp:1312
#41 0x00007f07116ab433 in mozilla::EventTargetChainItem::PreHandleEvent (this=0x7f06f8484008, aVisitor=...)
    at /home/bjacob/hack/mozilla-central/dom/events/EventDispatcher.cpp:235
#42 0x00007f07116aca87 in mozilla::EventDispatcher::Dispatch (aTarget=0x7f06f7126b80, aPresContext=0x7f06f7c46800, aEvent=0x7f06e55bd500, aDOMEvent=0x7f06e77dcd40, 
    aEventStatus=0x7fff0ce7fa14, aCallback=0x0, aTargets=0x0) at /home/bjacob/hack/mozilla-central/dom/events/EventDispatcher.cpp:532
#43 0x00007f07116924fa in mozilla::EventDispatcher::DispatchDOMEvent (aTarget=0x7f06f7126b80, aEvent=0x0, aDOMEvent=0x7f06e77dcd40, aPresContext=0x7f06f7c46800, 
    aEventStatus=0x7fff0ce7fa14) at /home/bjacob/hack/mozilla-central/dom/events/EventDispatcher.cpp:668
#44 0x00007f07124d33d4 in PresShell::HandleDOMEventWithTarget (this=0x7f06f7ca7000, aTargetContent=0x7f06f7126b80, aEvent=0x7f06e77dcd40, aStatus=0x7fff0ce7fa14)
    at /home/bjacob/hack/mozilla-central/layout/base/nsPresShell.cpp:7928
#45 0x00007f0711b15e6e in nsContentUtils::DispatchXULCommand (aTarget=0x7f06f7126b80, aTrusted=true, aSourceEvent=0x0, aShell=0x7f06f7ca7000, aCtrl=false, aAlt=false, 
    aShift=false, aMeta=false) at /home/bjacob/hack/mozilla-central/content/base/src/nsContentUtils.cpp:5901
#46 0x00007f07127fc688 in nsXULMenuCommandEvent::Run (this=0x7f06e58dc9d0) at /home/bjacob/hack/mozilla-central/layout/xul/nsXULPopupManager.cpp:2519
#47 0x00007f070f5afe02 in nsThread::ProcessNextEvent (this=0x7f0718739aa0, aMayWait=false, aResult=0x7fff0ce7fdde)
    at /home/bjacob/hack/mozilla-central/xpcom/threads/nsThread.cpp:766
#48 0x00007f070f4a39d7 in NS_ProcessNextEvent (aThread=0x7f0718739aa0, aMayWait=false) at /home/bjacob/hack/mozilla-central/xpcom/glue/nsThreadUtils.cpp:256
#49 0x00007f070fb8c83f in mozilla::ipc::MessagePump::Run (this=0x7f0718736a00, aDelegate=0x7f0718769500) at /home/bjacob/hack/mozilla-central/ipc/glue/MessagePump.cpp:95
#50 0x00007f070fb20b06 in MessageLoop::RunInternal (this=0x7f0718769500) at /home/bjacob/hack/mozilla-central/ipc/chromium/src/base/message_loop.cc:229
#51 0x00007f070fb20a35 in MessageLoop::RunHandler (this=0x7f0718769500) at /home/bjacob/hack/mozilla-central/ipc/chromium/src/base/message_loop.cc:222
#52 0x00007f070fb20a0d in MessageLoop::Run (this=0x7f0718769500) at /home/bjacob/hack/mozilla-central/ipc/chromium/src/base/message_loop.cc:196
#53 0x00007f071127f0c3 in nsBaseAppShell::Run (this=0x7f0706055240) at /home/bjacob/hack/mozilla-central/widget/xpwidgets/nsBaseAppShell.cpp:164
#54 0x00007f0712f5a752 in nsAppStartup::Run (this=0x7f06ffc39060) at /home/bjacob/hack/mozilla-central/toolkit/components/startup/nsAppStartup.cpp:278
#55 0x00007f0712e22297 in XREMain::XRE_mainRun (this=0x7fff0ce80668) at /home/bjacob/hack/mozilla-central/toolkit/xre/nsAppRunner.cpp:4013
#56 0x00007f0712e22af6 in XREMain::XRE_main (this=0x7fff0ce80668, argc=4, argv=0x7fff0ce81c38, aAppData=0x7fff0ce80908)
    at /home/bjacob/hack/mozilla-central/toolkit/xre/nsAppRunner.cpp:4084
#57 0x00007f0712e2331f in XRE_main (argc=4, argv=0x7fff0ce81c38, aAppData=0x7fff0ce80908, aFlags=0) at /home/bjacob/hack/mozilla-central/toolkit/xre/nsAppRunner.cpp:4298
#58 0x0000000000404cf1 in do_main (argc=4, argv=0x7fff0ce81c38, xreDirectory=0x7f07187526c0) at /home/bjacob/hack/mozilla-central/browser/app/nsBrowserApp.cpp:282
#59 0x00000000004043ae in main (argc=4, argv=0x7fff0ce81c38) at /home/bjacob/hack/mozilla-central/browser/app/nsBrowserApp.cpp:643
(gdb) p PrintJSStack()
$2 = 0x7f06f385a970 "0 anonymous() [\"chrome://global/content/printUtils.js\":38]\n    this = [object Object]\n1 oncommand(event = [object XULCommandEvent]) [\"chrome://browser/content/browser.xul\":1]\n    this = [object XULElement]\n"


Child process main thread call stack, showing we're in a gfx/layers IPC sync message:


(gdb) bt
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007fa3c92e8b01 in PR_WaitCondVar (cvar=0x7fa3b876bac0, timeout=4294967295) at /home/bjacob/hack/mozilla-central/nsprpub/pr/src/pthreads/ptsynch.c:385
#2  0x00007fa3c9f099af in mozilla::CondVar::Wait (this=0x7fa3b876ba98, aInterval=4294967295) at /home/bjacob/hack/mozilla-central/xpcom/glue/BlockingResourceBase.cpp:352
#3  0x00007fa3ca032462 in mozilla::Monitor::Wait (this=0x7fa3b876ba80, aInterval=4294967295) at ../../dist/include/mozilla/Monitor.h:40
#4  0x00007fa3ca603408 in mozilla::ipc::MessageChannel::WaitForSyncNotify (this=0x7fa3b889e460) at /home/bjacob/hack/mozilla-central/ipc/glue/MessageChannel.cpp:1350
#5  0x00007fa3ca602cb0 in mozilla::ipc::MessageChannel::SendAndWait (this=0x7fa3b889e460, aMsg=0x7fa3ad318330, aReply=0x7ffff50e6498)
    at /home/bjacob/hack/mozilla-central/ipc/glue/MessageChannel.cpp:674
#6  0x00007fa3ca602a88 in mozilla::ipc::MessageChannel::Send (this=0x7fa3b889e460, aMsg=0x7fa3ad318330, aReply=0x7ffff50e6498)
    at /home/bjacob/hack/mozilla-central/ipc/glue/MessageChannel.cpp:587
#7  0x00007fa3ca8d4ac6 in mozilla::layers::PLayerTransactionChild::SendUpdate (this=0x7fa3b733eab0, cset=..., id=@0x7ffff50e87b8: 51, targetConfig=..., 
    isFirstPaint=@0x7fa3b736d159: false, scheduleComposite=@0x7ffff50e87b7: true, paintSequenceNumber=@0x7ffff50e87b0: 89, reply=0x7ffff50e88d8)
    at ./PLayerTransactionChild.cpp:235
#8  0x00007fa3cb0dfee2 in mozilla::layers::ShadowLayerForwarder::EndTransaction (this=0x7fa3b736d0c0, aReplies=0x7ffff50e88d8, aRegionToClear=..., aId=51, 
    aScheduleComposite=true, aPaintSequenceNumber=89, aSent=0x7ffff50e8b96) at /home/bjacob/hack/mozilla-central/gfx/layers/ipc/ShadowLayers.cpp:583
#9  0x00007fa3cb06d60a in mozilla::layers::ClientLayerManager::ForwardTransaction (this=0x7fa3bb3bcb80, aScheduleComposite=true)
    at /home/bjacob/hack/mozilla-central/gfx/layers/client/ClientLayerManager.cpp:445
#10 0x00007fa3cb06d447 in mozilla::layers::ClientLayerManager::EndTransaction (this=0x7fa3bb3bcb80, aCallback=
    0x7fa3ccf7a490 <mozilla::FrameLayerBuilder::DrawThebesLayer(mozilla::layers::ThebesLayer*, gfxContext*, nsIntRegion const&, mozilla::layers::DrawRegionClip, nsIntRegion const&, void*)>, aCallbackData=0x7ffff50e9918, aFlags=mozilla::layers::LayerManager::END_DEFAULT)
    at /home/bjacob/hack/mozilla-central/gfx/layers/client/ClientLayerManager.cpp:238
#11 0x00007fa3ccfef1a4 in nsDisplayList::PaintForFrame (this=0x7ffff50e9870, aBuilder=0x7ffff50e9918, aCtx=0x0, aForFrame=0x7fa3b3d3d450, aFlags=13)
    at /home/bjacob/hack/mozilla-central/layout/base/nsDisplayList.cpp:1392
#12 0x00007fa3ccfee638 in nsDisplayList::PaintRoot (this=0x7ffff50e9870, aBuilder=0x7ffff50e9918, aCtx=0x0, aFlags=13)
    at /home/bjacob/hack/mozilla-central/layout/base/nsDisplayList.cpp:1232
#13 0x00007fa3cd00c3d6 in nsLayoutUtils::PaintFrame (aRenderingContext=0x0, aFrame=0x7fa3b3d3d450, aDirtyRegion=..., aBackstop=0, aFlags=772)
    at /home/bjacob/hack/mozilla-central/layout/base/nsLayoutUtils.cpp:2965
#14 0x00007fa3ccf47418 in PresShell::Paint (this=0x7fa3b3eeb800, aViewToPaint=0x7fa3b3d208d0, aDirtyRegion=..., aFlags=1)
    at /home/bjacob/hack/mozilla-central/layout/base/nsPresShell.cpp:6222
#15 0x00007fa3cc51029e in nsViewManager::ProcessPendingUpdatesPaint (this=0x7fa3b556a4c0, aWidget=0x7fa3bb3bc700)
    at /home/bjacob/hack/mozilla-central/view/src/nsViewManager.cpp:443
#16 0x00007fa3cc50ff4e in nsViewManager::ProcessPendingUpdatesForView (this=0x7fa3b556a4c0, aView=0x7fa3b3d208d0, aFlushDirtyRegion=true)
    at /home/bjacob/hack/mozilla-central/view/src/nsViewManager.cpp:384
#17 0x00007fa3cc511094 in nsViewManager::ProcessPendingUpdates (this=0x7fa3b556a4c0) at /home/bjacob/hack/mozilla-central/view/src/nsViewManager.cpp:1075
#18 0x00007fa3ccf64592 in nsRefreshDriver::Tick (this=0x7fa3b3eea000, aNowEpoch=1404770143500797, aNowTime=...)
    at /home/bjacob/hack/mozilla-central/layout/base/nsRefreshDriver.cpp:1278
#19 0x00007fa3ccf69f2c in mozilla::RefreshDriverTimer::TickDriver (driver=0x7fa3b3eea000, jsnow=1404770143500797, now=...)
    at /home/bjacob/hack/mozilla-central/layout/base/nsRefreshDriver.cpp:171
#20 0x00007fa3ccf69e02 in mozilla::RefreshDriverTimer::Tick (this=0x7fa3b556a9c0) at /home/bjacob/hack/mozilla-central/layout/base/nsRefreshDriver.cpp:162
#21 0x00007fa3ccf69cb1 in mozilla::RefreshDriverTimer::TimerTick (aTimer=0x7fa3b555a640, aClosure=0x7fa3b556a9c0)
    at /home/bjacob/hack/mozilla-central/layout/base/nsRefreshDriver.cpp:188
#22 0x00007fa3ca02fea2 in nsTimerImpl::Fire (this=0x7fa3b555a640) at /home/bjacob/hack/mozilla-central/xpcom/threads/nsTimerImpl.cpp:618
#23 0x00007fa3ca030301 in nsTimerEvent::Run (this=0x7fa3b3d074a0) at /home/bjacob/hack/mozilla-central/xpcom/threads/nsTimerImpl.cpp:711
#24 0x00007fa3ca02ae02 in nsThread::ProcessNextEvent (this=0x7fa3c02872c0, aMayWait=true, aResult=0x7ffff50eabe8)
    at /home/bjacob/hack/mozilla-central/xpcom/threads/nsThread.cpp:766
#25 0x00007fa3ca04772c in NS_InvokeByIndex (that=0x7fa3c02872c0, methodIndex=8, paramCount=2, params=0x7ffff50eabd0)
    at /home/bjacob/hack/mozilla-central/xpcom/reflect/xptcall/md/unix/xptcinvoke_x86_64_unix.cpp:162
#26 0x00007fa3cbe7d4b8 in CallMethodHelper::Invoke (this=0x7ffff50eab88) at /home/bjacob/hack/mozilla-central/js/xpconnect/src/XPCWrappedNative.cpp:2395
#27 0x00007fa3cbe72407 in CallMethodHelper::Call (this=0x7ffff50eab88) at /home/bjacob/hack/mozilla-central/js/xpconnect/src/XPCWrappedNative.cpp:1736
#28 0x00007fa3cbe507cd in XPCWrappedNative::CallMethod (ccx=..., mode=XPCWrappedNative::CALL_METHOD)
    at /home/bjacob/hack/mozilla-central/js/xpconnect/src/XPCWrappedNative.cpp:1703
#29 0x00007fa3cbe52c9d in XPC_WN_CallMethod (cx=0x7fa3c02f4340, argc=1, vp=0x7ffff50eaf10)
    at /home/bjacob/hack/mozilla-central/js/xpconnect/src/XPCWrappedNativeJSOps.cpp:1272
#30 0x00007fa3b401ec10 in ?? ()
#31 0x00007fa3ad33f8c8 in ?? ()
#32 0x00007ffff50eaee8 in ?? ()
#33 0x00007fa3c02f4340 in ?? ()
#34 0x0000000000000000 in ?? ()



Bill, what is the general philosophy on how to avoid such deadlocks?
Flags: needinfo?(wmccloskey)
[18:19] <billm> bjacob: the child is waiting here: http://mxr.mozilla.org/mozilla-central/source/ipc/glue/MessageChannel.cpp#650
[18:19] <billm> bjacob: it's inside the WaitForSyncNotify() call
[18:19] <billm> bjacob: that's waiting on a condvar
[18:20] <billm> bjacob: when the urgent message comes in, we run this code on the IO thread: http://mxr.mozilla.org/mozilla-central/source/ipc/glue/MessageChannel.cpp#452
[18:20] <billm> bjacob: it should take this branch: http://mxr.mozilla.org/mozilla-central/source/ipc/glue/MessageChannel.cpp#539
[18:20] <-- mt_ (mt@moz-62518563.mtv2.mozilla.com) has left this server (Quit: Leaving.).
[18:20] <billm> bjacob: and shouldWakeUp should be true, so we should notify the condvar
[18:21] <billm> bjacob: so the main thread should wake up and process the urgent message in mPendingUrgentRequest
[
Flags: needinfo?(wmccloskey)
With the patch from bug 950745 I get this assertion failure in the child process:

(gdb) bt
#0  0x00007f54a204dd7d in nanosleep () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f54a204dc14 in __sleep (seconds=0) at ../sysdeps/unix/sysv/linux/sleep.c:137
#2  0x00007f54a758edad in ah_crap_handler (signum=11) at /home/bjacob/hack/mozilla-central/toolkit/xre/nsSigHandlers.cpp:88
#3  0x00007f54a758ee8b in child_ah_crap_handler (signum=11) at /home/bjacob/hack/mozilla-central/toolkit/xre/nsSigHandlers.cpp:100
#4  0x00007f54a864dd39 in AsmJSFaultHandler (signum=11, info=0x7fff0b0026f0, context=0x7fff0b0025c0)
    at /home/bjacob/hack/mozilla-central/js/src/jit/AsmJSSignalHandlers.cpp:983
#5  <signal handler called>
#6  mozilla::EventDispatcher::Dispatch (aTarget=0x7f549102cc20, aPresContext=0x7f548f0ad800, aEvent=0x7f5487e39820, 
    aDOMEvent=0x7f54877838c0, aEventStatus=0x7fff0b002f0c, aCallback=0x0, aTargets=0x0)
    at /home/bjacob/hack/mozilla-central/dom/events/EventDispatcher.cpp:405
#7  0x00007f54a5df09ba in mozilla::EventDispatcher::DispatchDOMEvent (aTarget=0x7f549102cc20, aEvent=0x0, aDOMEvent=0x7f54877838c0, 
    aPresContext=0x7f548f0ad800, aEventStatus=0x7fff0b002f0c) at /home/bjacob/hack/mozilla-central/dom/events/EventDispatcher.cpp:673
#8  0x00007f54a5c7f9d4 in nsGlobalWindow::DispatchEvent (this=0x7f549102c800, aEvent=0x7f54877838c0, aRetVal=0x7fff0b00303b)
    at /home/bjacob/hack/mozilla-central/dom/base/nsGlobalWindow.cpp:9467
#9  0x00007f54a5c7f8a9 in nsGlobalWindow::DispatchEvent (this=0x7f549102cc00, aEvent=0x7f54877838c0, aRetVal=0x7fff0b00303b)
    at /home/bjacob/hack/mozilla-central/dom/base/nsGlobalWindow.cpp:9445
#10 0x00007f54a626be47 in nsContentUtils::DispatchEvent (aDoc=0x7f548f0ac000, aTarget=0x7f549102cc20, aEventName=..., aCanBubble=false, 
    aCancelable=false, aTrusted=true, aDefaultAction=0x0) at /home/bjacob/hack/mozilla-central/content/base/src/nsContentUtils.cpp:3646
#11 0x00007f54a626bbd4 in nsContentUtils::DispatchTrustedEvent (aDoc=0x7f548f0ac000, aTarget=0x7f549102cc20, aEventName=..., 
    aCanBubble=false, aCancelable=false, aDefaultAction=0x0) at /home/bjacob/hack/mozilla-central/content/base/src/nsContentUtils.cpp:3616
#12 0x00007f54a6c0f2e0 in nsDocumentViewer::DispatchEventToWindowTree (aDoc=0x7f548f0ac000, aEvent=...)
    at /home/bjacob/hack/mozilla-central/layout/base/nsDocumentViewer.cpp:4173
#13 0x00007f54a6c12bf7 in nsDocumentViewer::DispatchBeforePrint (aTop=0x7f548f0ac000)
    at /home/bjacob/hack/mozilla-central/layout/base/nsDocumentViewer.cpp:271
#14 0x00007f54a6c119a0 in nsPrintEventDispatcher::nsPrintEventDispatcher (this=0x7f54877285a8, aTop=0x7f548f0ac000)
    at /home/bjacob/hack/mozilla-central/layout/base/nsDocumentViewer.cpp:438
#15 0x00007f54a6c0cc34 in nsDocumentViewer::Print (this=0x7f549762dc60, aPrintSettings=0x7f5487e29d80, aWebProgressListener=0x0)
    at /home/bjacob/hack/mozilla-central/layout/base/nsDocumentViewer.cpp:3689
#16 0x00007f54a6c0d227 in non-virtual thunk to nsDocumentViewer::Print(nsIPrintSettings*, nsIWebProgressListener*) ()
    at /home/bjacob/hack/mozilla-central/layout/base/nsDocumentViewer.cpp:3733
#17 0x00007f54a3d1662c in NS_InvokeByIndex (that=0x7f549762dc88, methodIndex=13, paramCount=2, params=0x7fff0b003550)
    at /home/bjacob/hack/mozilla-central/xpcom/reflect/xptcall/md/unix/xptcinvoke_x86_64_unix.cpp:162
#18 0x00007f54a5b5de08 in CallMethodHelper::Invoke (this=0x7fff0b003508)
    at /home/bjacob/hack/mozilla-central/js/xpconnect/src/XPCWrappedNative.cpp:2395
#19 0x00007f54a5b52d57 in CallMethodHelper::Call (this=0x7fff0b003508)
    at /home/bjacob/hack/mozilla-central/js/xpconnect/src/XPCWrappedNative.cpp:1736
#20 0x00007f54a5b3111d in XPCWrappedNative::CallMethod (ccx=..., mode=XPCWrappedNative::CALL_METHOD)
    at /home/bjacob/hack/mozilla-central/js/xpconnect/src/XPCWrappedNative.cpp:1703
#21 0x00007f54a5b335ed in XPC_WN_CallMethod (cx=0x7f5499ff4340, argc=2, vp=0x7fff0b003f28)
    at /home/bjacob/hack/mozilla-central/js/xpconnect/src/XPCWrappedNativeJSOps.cpp:1272
#22 0x00007f54a8cb4ee5 in js::CallJSNative (cx=0x7f5499ff4340, 
    native=0x7f54a5b33250 <XPC_WN_CallMethod(JSContext*, unsigned int, JS::Value*)>, args=...)
    at /home/bjacob/hack/mozilla-central/js/src/jscntxtinlines.h:230
#23 0x00007f54a8c7b683 in js::Invoke (cx=0x7f5499ff4340, args=..., construct=js::NO_CONSTRUCT)
    at /home/bjacob/hack/mozilla-central/js/src/vm/Interpreter.cpp:460
#24 0x00007f54a8c45c24 in js::Invoke (cx=0x7f5499ff4340, thisv=..., fval=..., argc=2, argv=0x7fff0b004580, rval=...)
    at /home/bjacob/hack/mozilla-central/js/src/vm/Interpreter.cpp:516
#25 0x00007f54a8a64536 in JS::Call (cx=0x7f5499ff4340, thisv=..., fval=..., args=..., rval=...)
    at /home/bjacob/hack/mozilla-central/js/src/jsapi.cpp:5075
#26 0x00007f54a47605f0 in mozilla::jsipc::WrapperAnswer::AnswerCallOrConstruct (this=0x7f5499f62030, objId=@0x7fff0b004e10: 45, argv=..., 
    construct=@0x7fff0b004e07: false, rs=0x7fff0b004de0, result=0x7fff0b004dc8, outparams=0x7fff0b004dc0)
    at /home/bjacob/hack/mozilla-central/js/ipc/WrapperAnswer.cpp:445
#27 0x00007f54a476c47e in mozilla::jsipc::JavaScriptBase<mozilla::jsipc::PJavaScriptChild>::AnswerCallOrConstruct (this=0x7f5499f62020, 
    objId=@0x7fff0b004e10: 45, argv=..., construct=@0x7fff0b004e07: false, rs=0x7fff0b004de0, result=0x7fff0b004dc8, 
    outparams=0x7fff0b004dc0) at /home/bjacob/hack/mozilla-central/js/ipc/JavaScriptBase.h:88
#28 0x00007f54a476ce19 in non-virtual thunk to mozilla::jsipc::JavaScriptBase<mozilla::jsipc::PJavaScriptChild>::AnswerCallOrConstruct(unsigned long const&, nsTArray<mozilla::jsipc::JSParam> const&, bool const&, mozilla::jsipc::ReturnStatus*, mozilla::jsipc::JSVariant*, nsTArray<mozilla::jsipc::JSParam>*) () at Unified_cpp_js_ipc0.cpp:89
#29 0x00007f54a4583a99 in mozilla::jsipc::PJavaScriptChild::OnCallReceived (this=0x7f5499f62038, __msg=..., __reply=@0x7fff0b005510: 0x0)
    at ./PJavaScriptChild.cpp:1488
#30 0x00007f54a440d052 in mozilla::dom::PContentChild::OnCallReceived (this=0x7f5499f1c830, __msg=..., __reply=@0x7fff0b005510: 0x0)
    at ./PContentChild.cpp:5061
#31 0x00007f54a42d5d27 in mozilla::ipc::MessageChannel::DispatchUrgentMessage (this=0x7f5499f1c890, aMsg=...)
    at /home/bjacob/hack/mozilla-central/ipc/glue/MessageChannel.cpp:1108
#32 0x00007f54a42d56d3 in mozilla::ipc::MessageChannel::DispatchMessage (this=0x7f5499f1c890, aMsg=...)
    at /home/bjacob/hack/mozilla-central/ipc/glue/MessageChannel.cpp:1062
#33 0x00007f54a42d1a00 in mozilla::ipc::MessageChannel::OnMaybeDequeueOne (this=0x7f5499f1c890)
    at /home/bjacob/hack/mozilla-central/ipc/glue/MessageChannel.cpp:1051
#34 0x00007f54a42ec5c3 in DispatchToMethod<mozilla::ipc::MessageChannel, bool (mozilla::ipc::MessageChannel::*)()> (obj=0x7f5499f1c890, 
    method=(bool (mozilla::ipc::MessageChannel::*)(mozilla::ipc::MessageChannel * const)) 0x7f54a42d1800 <mozilla::ipc::MessageChannel::OnMaybeDequeueOne()>, arg=...) at /home/bjacob/hack/mozilla-central/ipc/chromium/src/base/tuple.h:383
#35 0x00007f54a42ec4be in RunnableMethod<mozilla::ipc::MessageChannel, bool (mozilla::ipc::MessageChannel::*)(), Tuple0>::Run (
    this=0x7f5499f07780) at /home/bjacob/hack/mozilla-central/ipc/chromium/src/base/task.h:307
#36 0x00007f54a42eda28 in mozilla::ipc::MessageChannel::RefCountedTask::Run (this=0x7f5499f50670)
    at ../../dist/include/mozilla/ipc/MessageChannel.h:390
#37 0x00007f54a42ed9f4 in mozilla::ipc::MessageChannel::DequeueTask::Run (this=0x7f5487e293c0)
---Type <return> to continue, or q <return> to quit---q
 at ../../dist/include/mozilla/ipc/MessageChannQuit
(gdb) frame 6
#6  mozilla::EventDispatcher::Dispatch (aTarget=0x7f549102cc20, aPresContext=0x7f548f0ad800, aEvent=0x7f5487e39820, 
    aDOMEvent=0x7f54877838c0, aEventStatus=0x7fff0b002f0c, aCallback=0x0, aTargets=0x0)
    at /home/bjacob/hack/mozilla-central/dom/events/EventDispatcher.cpp:405
405	  MOZ_RELEASE_ASSERT(!mozilla::ipc::ProcessingUrgentMessages());
(gdb) l
400	  NS_ENSURE_TRUE(!aEvent->mFlags.mIsBeingDispatched,
401	                 NS_ERROR_DOM_INVALID_STATE_ERR);
402	  NS_ASSERTION(!aTargets || !aEvent->message, "Wrong parameters!");
403	
404	#ifdef NIGHTLY_BUILD
405	  MOZ_RELEASE_ASSERT(!mozilla::ipc::ProcessingUrgentMessages());
406	#endif
407	
408	  // If we're dispatching an already created DOMEvent object, make
409	  // sure it is initialized!
Flags: needinfo?(wmccloskey)
Attachment #8453341 - Flags: review?(wmccloskey)
(This works for me locally; thanks to :mconley).
Flags: needinfo?(wmccloskey)
Comment on attachment 8453341 [details] [diff] [review]
Just alert and not attempt e10s printing

Review of attachment 8453341 [details] [diff] [review]:
-----------------------------------------------------------------

::: toolkit/components/printing/content/printUtils.js
@@ +32,5 @@
>  
>    print: function (aWindow)
>    {
>      var webBrowserPrint = this.getWebBrowserPrint(aWindow);
> +    if (Components.utils.isCrossProcessWrapper(webBrowserPrint)) {

This will use IPC. I'd rather do something local. Here's how you can do it:

let remote = window.QueryInterface(Ci.nsIInterfaceRequestor)
            .getInterface(Ci.nsIWebNavigation)
            .QueryInterface(Ci.nsILoadContext)
            .useRemoteTabs;

And then do the alert if remote is true. You can do that before the getWebBrowserPrint call.

Note: the aWindow parameter to this function is deceptive. It looks like it's always null. Just use |window| instead.

Also, please do the same thing in the other public functions here: showPageSetup and printPreview.
Attachment #8453341 - Flags: review?(wmccloskey)
Thanks for the helpful review!
Attachment #8453341 - Attachment is obsolete: true
Attachment #8453422 - Flags: review?(wmccloskey)
Comment on attachment 8453422 [details] [diff] [review]
Just alert and not attempt e10s printing (take 2)

Review of attachment 8453422 [details] [diff] [review]:
-----------------------------------------------------------------

::: toolkit/components/printing/content/printUtils.js
@@ +1,1 @@
> +

Nit: remove extra line.

@@ +10,5 @@
>  var gFocusedElement = null;
>  
>  var PrintUtils = {
>  
> +  bailOutBecauseE10s: function ()

Please call it "bailOutIfMultiprocess". I try to avoid using e10s in source code since it's just a codename.

@@ +11,5 @@
>  
>  var PrintUtils = {
>  
> +  bailOutBecauseE10s: function ()
> +  {

This should go up one line.
Attachment #8453422 - Flags: review?(wmccloskey) → review+
hm, if (bailOutIfMultiprocess) sounds bad because

 1) that's twice 'if'
 2) multiprocess is a general property of a browser, but here we want a specific property of a tab or window, which is: "remote process" rather than "multiprocess".

Anyway, how about just bailOut() ? The specifics are taken care of inside of that function anyway.
https://hg.mozilla.org/mozilla-central/rev/34c44a0bc706
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
Flags: qe-verify+
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0

Reproduced the hang using Nightly 2014-06-10 under Win 7 64-bit; the File menu list remains open and the browser can only be closed using Task Manager.

With Firefox 33 beta 2 (20140908190852), the pop-up "e10s printing is not implemented yet. Bug 927188" is displayed on the screen for both Print and Print Preview options. The browser doesn't hang, marking as verified.
Status: RESOLVED → VERIFIED
QA Contact: petruta.rasa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: