Avoid deadlock when two threads call into Frame::close

Desktop / LibreOffice - Stephan Bergmann [redhat.com] - 6 April 2016 05:33 UTC

...as happened at least once in JunitTest_framework_copmlex with

> Thread 27 (Thread 0x2ac7e60d1700 (LWP 30831)): > #0 0x00002ac7b781c89d in __lll_lock_wait () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135 > #1 0x00002ac7b7816a36 in __GI___pthread_mutex_lock (mutex=0x1ce1720) at ../nptl/pthread_mutex_lock.c:116 > #2 0x00002ac7b6e6b257 in osl_acquireMutex(oslMutexImpl*) (pMutex=0x1ce1720) at sal/osl/unx/mutex.cxx:99 > #3 0x00002ac7bf928098 in osl::Mutex::acquire() (this=0x1ce16f8) at include/osl/mutex.hxx:56 > #4 0x00002ac7c022d123 in SalYieldMutex::acquire() (this=0x1ce16f0) at vcl/unx/generic/app/geninst.cxx:54 > #5 0x00002ac7e48442ab in SolarMutexGuard::SolarMutexGuard() (this=0x2ac7e60cedb0) at include/vcl/svapp.hxx:1476 > #6 0x00002ac7e4aa7747 in framework::AddonsToolBarWrapper::dispose() (this=0x2ac7e7fbcd50) at framework/source/uielement/addonstoolbarwrapper.cxx:73 > #7 0x00002ac7e4947503 in framework::ToolbarLayoutManager::destroyToolbars() (this=0x2ac7dbf88018) at framework/source/layoutmanager/toolbarlayoutmanager.cxx:654 > #8 0x00002ac7e494364c in framework::ToolbarLayoutManager::reset() (this=0x2ac7dbf88018) at framework/source/layoutmanager/toolbarlayoutmanager.cxx:363 > #9 0x00002ac7e492a1d6 in framework::LayoutManager::implts_reset(bool) (this=0x2ac7dbfbcc40, bAttached=false) at framework/source/layoutmanager/layoutmanager.cxx:414 > #10 0x00002ac7e493a404 in framework::LayoutManager::frameAction(com::sun::star::frame::FrameActionEvent const&) (this=0x2ac7dbfbcc40, aEvent=...) at framework/source/layoutmanager/layoutmanager.cxx:2807 > #11 0x00002ac7e49e57dc in (anonymous namespace)::Frame::implts_sendFrameActionEvent(com::sun::star::frame::FrameAction const&) (this=0x2ac7e7fb2050, aAction=@0x2ac7e60cf73c: com::sun::star::frame::FrameAction_COMPONENT_DETACHING) at framework/source/services/frame.cxx:2845 > #12 0x00002ac7e49ded07 in (anonymous namespace)::Frame::setComponent(com::sun::star::uno::Reference const&, com::sun::star::uno::Reference const&) (this=0x2ac7e7fb2050, xComponentWindow=empty uno::Reference, xController=empty uno::Reference) at framework/source/services/frame.cxx:1509 > #13 0x00002ac7e49e293b in (anonymous namespace)::Frame::close(unsigned char) (this=0x2ac7e7fb2050, bDeliverOwnership=0 '\000') at framework/source/services/frame.cxx:1770 > #14 0x00002ac7e49ce635 in framework::Desktop::impl_closeFrames(bool) (this=0x2ac7daf2f430, bAllowUI=true) at framework/source/services/desktop.cxx:1674 > #15 0x00002ac7e49cd6ee in framework::Desktop::terminate() (this=0x2ac7daf2f430) at framework/source/services/desktop.cxx:238 > #16 0x00002ac7da45deb4 in gcc3::callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, double*) (pThis=0x2ac7daf2f4a0, nVtableIndex=3, pRegisterReturn=0x2ac7f41b36d0, pReturnTypeRef=0x1ce84c0, bSimpleReturn=true, pStack=0x2ac7e60cfd00, nStack=0, pGPR=0x2ac7e60cffc0, pFPR=0x2ac7e60cff80) at bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:77 > #17 0x00002ac7da45cccf in cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**) (pThis=0x2ac7f40f0ea0, aVtableSlot=..., pReturnTypeRef=0x1ce84c0, nParams=0, pParams=0x0, pUnoReturn=0x2ac7f41b36d0, pUnoArgs=0x0, ppUnoExc=0x2ac7e60d0560) at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:241 > #18 0x00002ac7da45c459 in bridges::cpp_uno::shared::unoInterfaceProxyDispatch(_uno_Interface*, _typelib_TypeDescription const*, void*, void**, _uno_Any**) (pUnoI=0x2ac7f40f0ea0, pMemberDescr=0x2ac7f00027c0, pReturn=0x2ac7f41b36d0, pArgs=0x0, ppException=0x2ac7e60d0560) at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:430 > #19 0x00002ac7e40401ea in binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::__debug::vector >*) const (this=0x2ac7f0002870, returnValue=0x2ac7e60d09d0, outArguments=0x2ac7e60d0998) at binaryurp/source/incomingrequest.cxx:239 > #20 0x00002ac7e403e88b in binaryurp::IncomingRequest::execute() const (this=0x2ac7f0002870) at binaryurp/source/incomingrequest.cxx:73 > #21 0x00002ac7e406927d in request(void*) (pThreadSpecificData=0x2ac7f0002870) at binaryurp/source/reader.cxx:83 > #22 0x00002ac7b998953b in cppu_threadpool::JobQueue::enter(long, bool) (this=0x2ac7f0002d30, nDisposeId=47038213394384, bReturnWhenNoJob=true) at cppu/source/threadpool/jobqueue.cxx:107 > #23 0x00002ac7b998dc25 in cppu_threadpool::ORequestThread::run() (this=0x2ac7f0000fd0) at cppu/source/threadpool/thread.cxx:165 > #24 0x00002ac7b998fb0e in threadFunc(void*) (param=0x2ac7f0000fe0) at include/osl/thread.hxx:185 > #25 0x00002ac7b6e8190b in osl_thread_start_Impl(void*) (pData=0x2ac7f0001020) at sal/osl/unx/thread.cxx:240 > #26 0x00002ac7b781460a in start_thread (arg=0x2ac7e60d1700) at pthread_create.c:334 > #27 0x00002ac7b754ea4d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

> Thread 1 (Thread 0x2ac7b6cf7340 (LWP 30697)): > #0 0x00002ac7b7819b10 in pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185 > #1 0x00002ac7b6e5b316 in osl_waitCondition(oslCondition, TimeValue const*) (Condition=0x2ac7f41e10b0, pTimeout=0x0) at sal/osl/unx/conditn.cxx:228 > #2 0x00002ac7cca51370 in osl::Condition::wait(TimeValue const*) (this=0x2ac7e7fb20d8, pTimeout=0x0) at include/osl/conditn.hxx:84 > #3 0x00002ac7cca50f90 in framework::Gate::wait() (this=0x2ac7e7fb20d0) at framework/inc/threadhelp/gate.hxx:123 > #4 0x00002ac7cca50708 in framework::TransactionManager::setWorkingMode(framework::EWorkingMode) (this=0x2ac7e7fb20c8, eMode=framework::E_BEFORECLOSE) at framework/source/fwi/threadhelp/transactionmanager.cxx:98 > #5 0x00002ac7e49dfc3c in (anonymous namespace)::Frame::dispose() (this=0x2ac7e7fb2050) at framework/source/services/frame.cxx:2008 > #6 0x00002ac7e49e2cd3 in (anonymous namespace)::Frame::close(unsigned char) (this=0x2ac7e7fb2050, bDeliverOwnership=1 '\001') at framework/source/services/frame.cxx:1801 > #7 0x00002ac7bbbe25fe in SfxViewFrame::Exec_Impl(SfxRequest&) (this=0x2ac7f4691cd0, rReq=...) at sfx2/source/view/viewfrm2.cxx:260 > #8 0x00002ac7bbbcd658 in SfxStubSfxViewFrameExec_Impl(SfxShell*, SfxRequest&) (pShell=0x2ac7f4691cd0, rReq=...) at workdir/SdiTarget/sfx2/sdi/sfxslots.hxx:706 > #9 0x00002ac7bb71f792 in SfxShell::CallExec(void (*)(SfxShell*, SfxRequest&), SfxRequest&) (this=0x2ac7f4691cd0, pFunc=0x2ac7bbbcd630 , rReq=...) at include/sfx2/shell.hxx:204 > #10 0x00002ac7bb715e41 in SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, bool) (this=0x2ac7f40fe8e0, rShell=..., rSlot=..., rReq=..., bRecord=true) at sfx2/source/control/dispatch.cxx:262 > #11 0x00002ac7bb71b6fd in SfxDispatcher::PostMsgHandler(SfxRequest*) (this=0x2ac7f40fe8e0, pReq=0x2ac88c000cf0) at sfx2/source/control/dispatch.cxx:1085 > #12 0x00002ac7bb716698 in SfxDispatcher::LinkStubPostMsgHandler(void*, SfxRequest*) (instance=0x2ac7f40fe8e0, data=0x2ac88c000cf0) at sfx2/source/control/dispatch.cxx:1065 > #13 0x00002ac7bbabb3f8 in Link::Call(SfxRequest*) const (this=0x2ac7f48361f0, data=0x2ac88c000cf0) at include/tools/link.hxx:84 > #14 0x00002ac7bbabb37b in SfxHintPoster::DoEvent_Impl(void*) (this=0x2ac7f48361e0, pPostedHint=0x2ac88c000cf0) at sfx2/source/notify/hintpost.cxx:44 > #15 0x00002ac7bbabb348 in SfxHintPoster::LinkStubDoEvent_Impl(void*, void*) (instance=0x2ac7f48361e0, data=0x2ac88c000cf0) at sfx2/source/notify/hintpost.cxx:42 > #16 0x00002ac7bfaba968 in Link::Call(void*) const (this=0x2ac88c00b008, data=0x2ac88c000cf0) at include/tools/link.hxx:84 > #17 0x00002ac7bfab7adc in ImplHandleUserEvent(ImplSVEvent*) (pSVEvent=0x2ac88c00b000) at vcl/source/window/winproc.cxx:1956 > #18 0x00002ac7bfab4db7 in ImplWindowFrameProc(vcl::Window*, unsigned short, void const*) (_pWindow=0x2a43020, nEvent=22, pEvent=0x2ac88c00b000) at vcl/source/window/winproc.cxx:2524 > #19 0x00002ac7c01278c9 in SalFrame::CallCallback(unsigned short, void const*) const (this=0x2a43890, nEvent=22, pEvent=0x2ac88c00b000) at vcl/inc/salframe.hxx:273 > #20 0x00002ac7c0133999 in SvpSalInstance::DoYield(bool, bool, unsigned long) (this=0x1ce1640, bWait=false, bHandleAllCurrentEvents=false, nReleased=0) at vcl/headless/svpinst.cxx:293 > #21 0x00002ac7bffa63b5 in ImplYield(bool, bool, unsigned long) (i_bWait=false, i_bAllEvents=false, nReleased=0) at vcl/source/app/svapp.cxx:509 > #22 0x00002ac7bffa1148 in Application::Yield() () at vcl/source/app/svapp.cxx:553 > #23 0x00002ac7bffa10d3 in Application::Execute() () at vcl/source/app/svapp.cxx:473 > #24 0x00002ac7b70ee229 in desktop::Desktop::DoExecute() () at desktop/source/app/app.cxx:1322 > #25 0x00002ac7b70f0304 in desktop::Desktop::Main() (this=0x7ffefac27e38) at desktop/source/app/app.cxx:1647 > #26 0x00002ac7bffb3639 in ImplSVMain() () at vcl/source/app/svmain.cxx:172 > #27 0x00002ac7bffb4e18 in SVMain() () at vcl/source/app/svmain.cxx:210 > #28 0x00002ac7b714f3b5 in soffice_main() () at desktop/source/app/sofficemain.cxx:135 > #29 0x000000000040097d in sal_main () at desktop/source/app/main.c:48 > #30 0x0000000000400957 in main (argc=8, argv=0x7ffefac27fe8) at desktop/source/app/main.c:47

d2a59bb Avoid deadlock when two threads call into Frame::close
sfx2/source/view/viewfrm2.cxx | 1 +
1 file changed, 1 insertion(+)

Upstream: cgit.freedesktop.org


  • Share