diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-06-24 15:44:40 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-06-24 21:45:30 +0200 |
commit | 328b7a34255ed1ffb0029fa1f247d16ba92f18cd (patch) | |
tree | 15a58ecb12b7c0e2e7030ade693013c69c96889a /vcl/inc/dndeventdispatcher.hxx | |
parent | 3f17a643d0f943d02c7cb2b5d8e702fe0e63e38d (diff) |
tdf#149626 use recursive_mutex to fix hang in macro callback during dnd
See frame #5 and frame #45 where
both the same DNDEventDispatcher object and both functions lock m_aMutex which is a std::mutex since
commit 8de81db4e3fca488d50db2d74734109b31541a6f
Date: Mon Aug 2 09:21:17 2021 +0200
osl::Mutex->std::mutex in DNDEventDispatcher
#0 0x00007ff094530c40 in __lll_lock_wait () at /lib64/libc.so.6
#1 0x00007ff0945371d2 in pthread_mutex_lock@@GLIBC_2.2.5 () at /lib64/libc.so.6
#2 0x00007ff08b901663 in __gthread_mutex_lock(pthread_mutex_t*) (__mutex=0x1a32c60)
at /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/x86_64-redhat-linux/bits/gthr-default.h:749
#3 0x00007ff08b9024d5 in std::mutex::lock() (this=0x1a32c60) at /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/std_mutex.h:100
#4 0x00007ff08b9018f3 in std::scoped_lock<std::mutex>::scoped_lock(std::mutex&) (this=0x7ffdd0d79240, __m=...)
at /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/mutex:731
#5 0x00007ff08b9006a8 in DNDEventDispatcher::dragOver(com::sun::star::datatransfer::dnd::DropTargetDragEvent const&) (this=0x1a32c10, dtde=...)
at vcl/source/window/dndeventdispatcher.cxx:156
#6 0x00007ff075f47658 in GtkInstDropTarget::fire_dragOver(com::sun::star::datatransfer::dnd::DropTargetDragEvent const&) (this=0x199eb40, dtde=...)
at vcl/unx/gtk3/gtkinst.cxx:1710
#7 0x00007ff0760a7010 in GtkInstDropTarget::signalDragMotion(_GtkWidget*, _GdkDragContext*, int, int, unsigned int)
(this=0x199eb40, pWidget=0x1c67e40, context=0x1957450, x=89, y=175, time=0) at vcl/unx/gtk3/gtkframe.cxx:5026
#8 0x00007ff07609bb77 in GtkSalFrame::signalDragMotion(_GtkWidget*, _GdkDragContext*, int, int, unsigned int, void*)
(pWidget=0x1c67e40, context=0x1957450, x=89, y=175, time=0, frame=0x19b7d70) at vcl/unx/gtk3/gtkframe.cxx:4922
#9 0x00007ff075649527 in _gtk_marshal_BOOLEAN__OBJECT_INT_INT_UINTv () at /lib64/libgtk-3.so.0
#10 0x00007ff0865dcd5b in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
#11 0x00007ff0865ddeb8 in g_signal_emit_by_name () at /lib64/libgobject-2.0.so.0
#12 0x00007ff07595b491 in gtk_drag_dest_motion.lto_priv () at /lib64/libgtk-3.so.0
#13 0x00007ff0757b8f7d in gtk_main_do_event () at /lib64/libgtk-3.so.0
#14 0x00007ff0754e5463 in _gdk_event_emit () at /lib64/libgdk-3.so.0
#15 0x00007ff075518056 in gdk_event_source_dispatch () at /lib64/libgdk-3.so.0
#16 0x00007ff0864c3faf in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#17 0x00007ff0865192c8 in g_main_context_iterate.constprop () at /lib64/libglib-2.0.so.0
#18 0x00007ff0864c1940 in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#19 0x00007ff075f3e60f in GtkSalData::Yield(bool, bool) (this=0x952930, bWait=false, bHandleAllCurrentEvents=false) at vcl/unx/gtk3/gtkdata.cxx:405
#20 0x00007ff075f43e43 in GtkInstance::DoYield(bool, bool) (this=0x9527e0, bWait=false, bHandleAllCurrentEvents=false) at vcl/unx/gtk3/gtkinst.cxx:428
#21 0x00007ff08c2dc5df in ImplYield(bool, bool) (i_bWait=false, i_bAllEvents=false) at vcl/source/app/svapp.cxx:474
#22 0x00007ff08c2dc24d in Application::Reschedule(bool) (i_bAllEvents=false) at vcl/source/app/svapp.cxx:493
#23 0x00007ff091eeeb55 in SbiRuntime::Step() (this=0xa21eb20) at basic/source/runtime/runtime.cxx:801
#24 0x00007ff091e0e659 in (anonymous namespace)::RunInitGuard::run() (this=0x76a6290) at basic/source/classes/sbxmod.cxx:1015
#25 0x00007ff091e0d135 in SbModule::Run(SbMethod*) (this=0xa0ada00, pMeth=0xa16d7e0) at basic/source/classes/sbxmod.cxx:1176
#26 0x00007ff091e0c503 in SbModule::Notify(SfxBroadcaster&, SfxHint const&) (this=0xa0ada00, rBC=..., rHint=...) at basic/source/classes/sbxmod.cxx:775
#27 0x00007ff090b3ee6e in SfxBroadcaster::Broadcast(SfxHint const&) (this=0xa231de0, rHint=...) at svl/source/notify/SfxBroadcaster.cxx:39
#28 0x00007ff091e1372e in SbMethod::Broadcast(SfxHintId) (this=0xa231ca0, nHintId=SfxHintId::BasicDataWanted) at basic/source/classes/sbxmod.cxx:2113
#29 0x00007ff091f6ddfa in SbxObject::Call(rtl::OUString const&, SbxArray*) (this=0xa258670, rName="DTL_dragOver", pParam=0xa1e47d0)
at basic/source/sbx/sbxobj.cxx:274
#30 0x00007ff091d9dd76 in StarBASIC::Call(rtl::OUString const&, SbxArray*) (this=0xa258670, rName="DTL_dragOver", pParam=0xa1e47d0)
at basic/source/classes/sb.cxx:1324
#31 0x00007ff091dd7127 in (anonymous namespace)::BasicAllListener_Impl::firing_impl(com::sun::star::script::AllEventObject const&, com::sun::star::uno::Any*)
(this=0xa2344a0, Event=..., pRet=0x0) at basic/source/classes/sbunoobj.cxx:3831
#32 0x00007ff091dd6ba1 in (anonymous namespace)::BasicAllListener_Impl::firing(com::sun::star::script::AllEventObject const&) (this=0xa2344a0, Event=...)
at basic/source/classes/sbunoobj.cxx:3855
#33 0x00007ff091dd792f in (anonymous namespace)::InvocationToAllListenerMapper::invoke(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&, com::sun::star::uno::Sequence<short>&, com::sun::star::uno::Sequence<com::sun::star::uno::Any>&)
(this=0xa110b70, FunctionName="dragOver", Params=uno::Sequence of length 1 = {...}) at basic/source/classes/sbunoobj.cxx:3983
#34 0x00007ff091dd7be7 in non-virtual thunk to (anonymous namespace)::InvocationToAllListenerMapper::invoke(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&, com::sun::star::uno::Sequence<short>&, com::sun::star::uno::Sequence<com::sun::star::uno::Any>&) ()
at /home/caolan/LibreOffice/core/instdir/program/libsblo.so
#35 0x00007ff072d19921 in gcc3::callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, double*)
(pThis=0xa110b98, nVtableIndex=4, pRegisterReturn=0x7ffdd0d7b5c0, pReturnTypeRef=0xa875c0, bSimpleReturn=false, pStack=0x7ffdd0d7b5e0, nStack=0, pGPR=0x7ffdd0d7b900, pFPR=0x7ffdd0d7b8c0) at bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:77
#36 0x00007ff072d184fc in cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**)
(pThis=0xa238bb0, aVtableSlot=..., pReturnTypeRef=0xa875c0, nParams=4, pParams=0x2470e40, pUnoReturn=0x7ffdd0d7bb80, pUnoArgs=0x7ffdd0d7bbb0, ppUnoExc=0x7ffdd0d7bb60) at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:233
#37 0x00007ff072d17c58 in unoInterfaceProxyDispatch(uno_Interface*, typelib_TypeDescription const*, void*, void**, uno_Any**)
(pUnoI=0xa238bb0, pMemberDescr=0x24c98c0, pReturn=0x7ffdd0d7bb80, pArgs=0x7ffdd0d7bbb0, ppException=0x7ffdd0d7bb60)
at bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:413
#38 0x00007ff0472645ca in stoc_invadp::(anonymous namespace)::AdapterImpl::invoke(_typelib_TypeDescription const*, void*, void**, _uno_Any**)
(this=0xa112060, pMemberType=0xa11be80, pReturn=0x7ffdd0d7c4f0, pArgs=0x7ffdd0d7bca0, ppException=0x7ffdd0d7bde0)
at stoc/source/invocation_adapterfactory/iafactory.cxx:457
#39 0x00007ff04726379d in stoc_invadp::adapter_dispatch(_uno_Interface*, _typelib_TypeDescription const*, void*, void**, _uno_Any**)
(pUnoI=0xa118a50, pMemberType=0xa11be80, pReturn=0x7ffdd0d7c4f0, pArgs=0x7ffdd0d7bca0, ppException=0x7ffdd0d7bde0)
at stoc/source/invocation_adapterfactory/iafactory.cxx:605
#40 0x00007ff072d04e95 in cpp2uno_call(bridges::cpp_uno::shared::CppInterfaceProxy*, _typelib_TypeDescription const*, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void**, void**, void**, unsigned long*)
(pThis=0xa11b350, pMemberTypeDescr=0xa11be80, pReturnTypeRef=0x939280, nParams=1, pParams=0xa112460, gpreg=0x7ffdd0d7c520, fpreg=0x7ffdd0d7c540, ovrflw=0x7ffdd0d7c590, pRegisterReturn=0x7ffdd0d7c4f0) at bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx:191
#41 0x00007ff072d04611 in cpp_vtable_call(sal_Int32, sal_Int32, void**, void**, void**, sal_uInt64*)
(nFunctionIndex=7, nVtableOffset=0, gpreg=0x7ffdd0d7c510, fpreg=0x7ffdd0d7c540, ovrflw=0x7ffdd0d7c590, pRegisterReturn=0x7ffdd0d7c4f0)
at bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx:389
#42 0x00007ff072d29836 in privateSnippetExecutor () at /home/caolan/LibreOffice/core/instdir/program/libgcc3_uno.so
#43 0x00007ff08b903787 in DNDListenerContainer::fireDragOverEvent(com::sun::star::uno::Reference<com::sun::star::datatransfer::dnd::XDropTargetDragContext> const&, signed char, int, int, signed char)
(this=0x5a444c0, context=uno::Reference to ((anonymous namespace)::GtkDropTargetDragContext *) 0xa1dda68, dropAction=1 '\001', locationX=89, locationY=33, sourceActions=3 '\003') at vcl/source/window/dndlistenercontainer.cxx:224
#44 0x00007ff08b900b7d in DNDEventDispatcher::fireDragOverEvent(vcl::Window*, com::sun::star::uno::Reference<com::sun::star::datatransfer::dnd::XDropTargetDragContext> const&, signed char, Point const&, signed char)
(pWindow=0x5a27060, xContext=uno::Reference to ((anonymous namespace)::GtkDropTargetDragContext *) 0xa1dda68, nDropAction=1 '\001', rLocation=Point = {...}, nSourceActions=3 '\003') at vcl/source/window/dndeventdispatcher.cxx:297
#45 0x00007ff08b9007f5 in DNDEventDispatcher::dragOver(com::sun::star::datatransfer::dnd::DropTargetDragEvent const&) (this=0x1a32c10, dtde=...)
at vcl/source/window/dndeventdispatcher.cxx:178
#46 0x00007ff075f47658 in GtkInstDropTarget::fire_dragOver(com::sun::star::datatransfer::dnd::DropTargetDragEvent const&) (this=0x199eb40, dtde=...)
at vcl/unx/gtk3/gtkinst.cxx:1710
Change-Id: I06f24ac50d6d029803d46974162e1afec898d866
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136401
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/inc/dndeventdispatcher.hxx')
-rw-r--r-- | vcl/inc/dndeventdispatcher.hxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/vcl/inc/dndeventdispatcher.hxx b/vcl/inc/dndeventdispatcher.hxx index e29e76a7d039..9756056da3bd 100644 --- a/vcl/inc/dndeventdispatcher.hxx +++ b/vcl/inc/dndeventdispatcher.hxx @@ -39,7 +39,7 @@ class DNDEventDispatcher final : public ::cppu::WeakImplHelper< void designate_currentwindow(vcl::Window *pWindow); DECL_LINK(WindowEventListener, VclWindowEvent&, void); - std::mutex m_aMutex; + std::recursive_mutex m_aMutex; css::uno::Sequence< css::datatransfer::DataFlavor > m_aDataFlavorList; vcl::Window* findTopLevelWindow(Point location); |