https://bugs.documentfoundation.org/show_bug.cgi?id=103852

            Bug ID: 103852
           Summary: win32: clipboard deadlock.
           Product: LibreOffice
           Version: unspecified
          Hardware: All
                OS: Windows (All)
            Status: UNCONFIRMED
          Severity: critical
          Priority: medium
         Component: LibreOffice
          Assignee: [email protected]
          Reporter: [email protected]

When running on Windows for long periods - after say 40+ runs of a test we have
at Collabora - we get a deadlock like this:

ChildEBP RetAddr  
0175f1a4 7570112f ntdll!NtWaitForMultipleObjects+0xc
0175f330 7557d433 KERNELBASE!WaitForMultipleObjectsEx+0xcc
0175f394 7557d17f USER32!MsgWaitForMultipleObjectsEx+0x163
0175f3b0 6430949e USER32!MsgWaitForMultipleObjects+0x1f
0175f41c 64303bf2 sysdtrans!CMtaOleClipboard::getClipboard+0xbe
[c:\lo\libo-core\dtrans\source\win32\clipb\mtaoleclipb.cxx @ 379]
0175f45c 6430728a sysdtrans!CWinClipbImpl::getContents+0xd2
[c:\lo\libo-core\dtrans\source\win32\clipb\winclipbimpl.cxx @ 101]
0175f498 6e84b784 sysdtrans!CWinClipboard::getContents+0xba
[c:\lo\libo-core\dtrans\source\win32\clipb\winclipboard.cxx @ 80]
0175f4f8 64b392d6
mergedlo!TransferableDataHelper::CreateFromSystemClipboard+0x94
[c:\lo\libo-core\svtools\source\misc\transfer.cxx @ 2114]
0175f564 64b3919e swlo!SwBaseShell::StateClpbrd+0x116
[c:\lo\libo-core\sw\source\uibase\shells\basesh.cxx @ 462]
0175f570 6e388ca4 swlo!SfxStubSwBaseShellStateClpbrd+0xe
[c:\lo\libo-core\workdir\sditarget\sw\sdi\swslots.hxx @ 2073]
0175f584 6e37db93 mergedlo!SfxDispatcher::FillState_+0x44
[c:\lo\libo-core\sfx2\source\control\dispatch.cxx @ 1908]
0175f5d4 6e37c26f mergedlo!SfxBindings::Update_Impl+0x103
[c:\lo\libo-core\sfx2\source\control\bindings.cxx @ 326]
0175f604 6e37c0ae mergedlo!SfxBindings::NextJob_Impl+0x1af
[c:\lo\libo-core\sfx2\source\control\bindings.cxx @ 1502]
0175f610 6f4866ad mergedlo!SfxBindings::LinkStubNextJob+0xe
[c:\lo\libo-core\sfx2\source\control\bindings.cxx @ 1435]
0175f61c 6f46b822 mergedlo!Timer::Invoke+0xd
[c:\lo\libo-core\vcl\source\app\timer.cxx @ 88]
0175f630 6f46b597 mergedlo!Scheduler::ProcessTaskScheduling+0x62
[c:\lo\libo-core\vcl\source\app\scheduler.cxx @ 177]
0175f638 6f540eb2 mergedlo!Scheduler::CallbackTaskScheduling+0x7
[c:\lo\libo-core\vcl\source\app\scheduler.cxx @ 165]
0175f648 6f53f466 mergedlo!EmitTimerCallback+0x32
[c:\lo\libo-core\vcl\win\app\saltimer.cxx @ 173]
0175f674 6f53f570 mergedlo!SalComWndProc+0x196
[c:\lo\libo-core\vcl\win\app\salinst.cxx @ 733]
0175f6c0 75578e71 mergedlo!SalComWndProcW+0x60
[c:\lo\libo-core\vcl\win\app\salinst.cxx @ 766]
0175f6ec 755790d1 USER32!_InternalCallWinProc+0x2b
0175f780 7557a66f USER32!UserCallWinProcCheckWow+0x18e
0175f7ec 7557a6e0 USER32!DispatchMessageWorker+0x208
0175f7f8 6f53efd4 USER32!DispatchMessageW+0x10
0175f82c 6f53ee2a mergedlo!ImplSalYield+0x64
[c:\lo\libo-core\vcl\win\app\salinst.cxx @ 589]
0175f854 6f480d16 mergedlo!WinSalInstance::DoYield+0xca
[c:\lo\libo-core\vcl\win\app\salinst.cxx @ 654]
0175f878 6f47e015 mergedlo!Application::Yield+0x56
[c:\lo\libo-core\vcl\source\app\svapp.cxx @ 556]
0175f8a8 6e5be1b9 mergedlo!Application::Execute+0x145
[c:\lo\libo-core\vcl\source\app\svapp.cxx @ 473]
0175fa1c 6f4856b3 mergedlo!desktop::Desktop::Main+0xcd9
[c:\lo\libo-core\desktop\source\app\app.cxx @ 16707566]
0175fa44 6f485a79 mergedlo!ImplSVMain+0x63
[c:\lo\libo-core\vcl\source\app\svmain.cxx @ 185]
0175fa50 6e5d86d9 mergedlo!SVMain+0x29
[c:\lo\libo-core\vcl\source\app\svmain.cxx @ 224]
0175fac0 00d2101e mergedlo!soffice_main+0x79
[c:\lo\libo-core\desktop\source\app\sofficemain.cxx @ 165]

vs.

   8  Id: 8e0.ed8 Suspend: 1 Teb: 7edde000 Unfrozen
ChildEBP RetAddr  
11d7f90c 7779e4b7 ntdll!NtWaitForSingleObject+0xc
11d7f980 7779e33b ntdll!RtlpWaitOnCriticalSection+0xd0
11d7f9ac 7779e365 ntdll!RtlpEnterCriticalSectionContended+0xa0
11d7f9b4 6d7ba55c ntdll!RtlEnterCriticalSection+0x42
11d7f9c0 6f53fe6c sal3!osl_acquireMutex+0xc
[c:\lo\libo-core\sal\osl\w32\mutex.c @ 72]
11d7f9cc 64aa82d9 mergedlo!SalYieldMutex::acquire+0xc
[c:\lo\libo-core\vcl\win\app\salinst.cxx @ 140]
11d7f9f8 64aa8b52 swlo!SwTransferable::~SwTransferable+0x69
[c:\lo\libo-core\sw\source\uibase\dochdl\swdtflvr.cxx @ 244]
11d7fa08 6d696077 swlo!SwTransferable::`vector deleting destructor'+0x42
11d7fa18 64310713 cppuhelper3MSC!cppu::OWeakObject::release+0x27
[c:\lo\libo-core\cppuhelper\source\weak.cxx @ 231]
11d7fa48 643107bb sysdtrans!CXTDataObject::~CXTDataObject+0x103
[c:\lo\libo-core\dtrans\source\win32\dtobj\xtdataobject.hxx @ 67]
11d7fa54 64310ecf sysdtrans!CXTDataObject::`scalar deleting destructor'+0xb
11d7fa64 6430f92e sysdtrans!CXTDataObject::Release+0x1f
[c:\lo\libo-core\dtrans\source\win32\dtobj\xtdataobject.cxx @ 114]
11d7fa88 6430fb4f sysdtrans!CXNotifyingDataObject::`scalar deleting
destructor'+0x6e
11d7fa9c 753e5a06 sysdtrans!CXNotifyingDataObject::Release+0x2f
[c:\lo\libo-core\dtrans\source\win32\dtobj\xnotifyingdataobject.cxx @ 87]
11d7fac8 753e5a3e ole32!RemoveClipboardDataObject+0xdc3
[d:\9147\com\ole32\ole232\clipbrd\clipapi.cpp @ 3648]
11d7fadc 75578e71 ole32!ClipboardWndProc+0x11be
[d:\9147\com\ole32\ole232\clipbrd\clipapi.cpp @ 623]
11d7fb08 755790d1 USER32!_InternalCallWinProc+0x2b
11d7fb9c 7557932c USER32!UserCallWinProcCheckWow+0x18e
11d7fbfc 755a4560 USER32!DispatchClientMessage+0xdc
11d7fc40 777c0ca6 USER32!__fnINDESTROYCLIPBRD+0x40
11d7fc54 01e7ed90 ntdll!KiUserCallbackDispatcher+0x36
WARNING: Frame IP not in any known module. Following frames may be wrong.
11d7fc9c 64309d62 0x1e7ed90
11d7fcd8 64309739 sysdtrans!CMtaOleClipboard::run+0x62
[c:\lo\libo-core\dtrans\source\win32\clipb\mtaoleclipb.cxx @ 726]
11d7fce0 7199c01d sysdtrans!CMtaOleClipboard::oleThreadProc+0x19
[c:\lo\libo-core\dtrans\source\win32\clipb\mtaoleclipb.cxx @ 747]
11d7fd18 7199c001 MSVCR120!_callthreadstartex+0x1b
[f:\dd\vctools\crt\crtw32\startup\threadex.c @ 376]

It seems to me that one 'obvious' fix here is to post the destruction of the
XTransferrable from 

class CXTDataObject : public IDataObject
{
public:
...
    css::uno::Reference< css::datatransfer::XTransferable >     
m_XTransferable;

To the main thread with an Application::PostUserEvent - which is commonly
supposed to be thread-safe ;-)

Alternatively - presumably dropping the SolarMutex as we go down this path:

mergedlo!TransferableDataHelper::CreateFromSystemClipboard+0x94
[c:\lo\libo-core\svtools\source\misc\transfer.cxx @ 2114]

might work - at the cost of some significant re-enterancy hazard.

Thoughts appreciated.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to