Recursive use of non-recursive std::mtuex in Scheduler::ProcessTaskScheduling?

Stephan Bergmann sbergman at redhat.com
Tue Feb 9 14:56:05 UTC 2021


I occasionally see soffice.bin crash during `make check` tests on 
Windows, and now building with --enable-breakpad, 
JunitTest_forms_unoapi_1 failed with

[...]
> LOG> up(): COMPLETED.OK

> 

> LOG> Execute: down()

> LOG> starting required method: addSpinListener()

> warn:desktop:23856:19364:desktop/source/app/crashreport.cxx:73: minidump generated: C:\lo-clang\core\workdir\JunitTest\forms_unoapi_1\user\crash\05aab6e1-a92d-4bfe-8563-0bfd0dc85d65.dmp
> com.sun.star.lang.DisposedException

[...]

and inspecting that .dmp (with VS, as documented in 
external/breakpad/README) shows an uncaught std::system_error at 
(annotations inline):

> KERNELBASE.dll!RaiseException
()
> VCRUNTIME140D.dll!_CxxThrowException(void * pExceptionObject, const _s__ThrowInfo * pThrowInfo) Line 75
> 	at D:\a01\_work\6\s\src\vctools\crt\vcruntime\src\eh\throw.cpp(75)
> MSVCP140D.dll!std::_Throw_Cpp_error(int code) Line 38
> 	at D:\a01\_work\6\s\src\vctools\crt\github\stl\src\thread0.cpp(38)
> MSVCP140D.dll!std::_Throw_C_error(int code) Line 50
> 	at D:\a01\_work\6\s\src\vctools\crt\github\stl\src\thread0.cpp(50)
> vcllo.dll!std::_Check_C_return(int _Res) Line 134
> 	at C:\PROGRA~2\MIB055~1\2019\COMMUN~1\VC\Tools\MSVC\1428~1.293\Include\xthreads.h(134)

^ that's

> enum { _Thrd_success, _Thrd_nomem, _Thrd_timedout, _Thrd_busy, _Thrd_error };

> inline int _Check_C_return(int _Res) { // throw exception on failure
>     if (_Res != _Thrd_success) {
>         _Throw_C_error(_Res);
>     }
> 
>     return _Res;
> }

with _Res = 3 (aka _Thrd_busy, presumably representing an attempt to 
recursively lock a non-recursive std::mutex)

> vcllo.dll!std::_Mutex_base::lock() Line 52
> 	at C:\PROGRA~2\MIB055~1\2019\COMMUN~1\VC\Tools\MSVC\1428~1.293\Include\mutex(52)

^ that's

>     void lock() {
>        _Check_C_return(_Mtx_lock(_Mymtx()));
>     }

> vcllo.dll!Scheduler::Lock() Line 215
> 	at C:\lo-clang\core\vcl\source\app\scheduler.cxx(215)
> vcllo.dll!SchedulerGuard::SchedulerGuard() Line 57
> 	at C:\lo-clang\core\vcl\inc\schedulerimpl.hxx(57)
> vcllo.dll!Scheduler::ProcessTaskScheduling() Line 344
> 	at C:\lo-clang\core\vcl\source\app\scheduler.cxx(344)
> vcllo.dll!Scheduler::CallbackTaskScheduling() Line 267
> 	at C:\lo-clang\core\vcl\source\app\scheduler.cxx(267)
> vcllo.dll!SalTimer::CallCallback() Line 55
> 	at C:\lo-clang\core\vcl\inc\saltimer.hxx(55)
> vclplug_winlo.dll!WinSalTimer::ImplHandleElapsedTimer() Line 166
> 	at C:\lo-clang\core\vcl\win\app\saltimer.cxx(166)
> vclplug_winlo.dll!ImplSalYield(const bool bWait, const bool bHandleAllCurrentEvents) Line 456
> 	at C:\lo-clang\core\vcl\win\app\salinst.cxx(456)
> vclplug_winlo.dll!SalComWndProc(HWND__ *, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam, bool & rDef) Line 570
> 	at C:\lo-clang\core\vcl\win\app\salinst.cxx(570)
> vclplug_winlo.dll!SalComWndProcW(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 655
> 	at C:\lo-clang\core\vcl\win\app\salinst.cxx(655)
> user32.dll!UserCallWinProcCheckWow()
> user32.dll!DispatchClientMessage
()
> user32.dll!__fnDWORD
()
> ntdll.dll!KiUserCallbackDispatcherContinue
()
> user32.dll!NtUserPeekMessage
()
> user32.dll!PeekMessageW
()
> vclplug_winlo.dll!WinSalInstance::AnyInput(VclInputFlags nType) Line 801
> 	at C:\lo-clang\core\vcl\win\app\salinst.cxx(801)
> vcllo.dll!Application::AnyInput(VclInputFlags nType) Line 590
> 	at C:\lo-clang\core\vcl\source\app\svapp.cxx(590)
> vcllo.dll!Scheduler::ProcessTaskScheduling() Line 436
> 	at C:\lo-clang\core\vcl\source\app\scheduler.cxx(436)

^ that frame has the same SchedulerGuard locked that the other 
Scheduler::ProcessTaskScheduling frame further up wants to lock

> vcllo.dll!Scheduler::CallbackTaskScheduling() Line 267
> 	at C:\lo-clang\core\vcl\source\app\scheduler.cxx(267)
> vcllo.dll!SalTimer::CallCallback() Line 55
> 	at C:\lo-clang\core\vcl\inc\saltimer.hxx(55)
> vclplug_winlo.dll!WinSalTimer::ImplHandleElapsedTimer() Line 166
> 	at C:\lo-clang\core\vcl\win\app\saltimer.cxx(166)
> vclplug_winlo.dll!ImplSalYield(const bool bWait, const bool bHandleAllCurrentEvents) Line 456
> 	at C:\lo-clang\core\vcl\win\app\salinst.cxx(456)
> vclplug_winlo.dll!WinSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents) Line 512
> 	at C:\lo-clang\core\vcl\win\app\salinst.cxx(512)
> vcllo.dll!ImplYield(bool i_bWait, bool i_bAllEvents) Line 463
> 	at C:\lo-clang\core\vcl\source\app\svapp.cxx(463)
> vcllo.dll!Application::Yield() Line 531
> 	at C:\lo-clang\core\vcl\source\app\svapp.cxx(531)
> vcllo.dll!Application::Execute() Line 441
> 	at C:\lo-clang\core\vcl\source\app\svapp.cxx(441)
> sofficeapp.dll!desktop::Desktop::Main() Line 1586
> 	at C:\lo-clang\core\desktop\source\app\app.cxx(1586)
> vcllo.dll!ImplSVMain() Line 196
> 	at C:\lo-clang\core\vcl\source\app\svmain.cxx(196)
> vcllo.dll!SVMain() Line 228
> 	at C:\lo-clang\core\vcl\source\app\svmain.cxx(228)
> sofficeapp.dll!soffice_main() Line 98
> 	at C:\lo-clang\core\desktop\source\app\sofficemain.cxx(98)
> soffice.bin!sal_main() Line 49
> 	at C:\lo-clang\core\desktop\source\app\main.c(49)
> soffice.bin!main(int argc, char * * argv) Line 47
> 	at C:\lo-clang\core\desktop\source\app\main.c(47)
> soffice.bin!invoke_main() Line 79
> 	at d:\agent\_work\63\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(79)
> soffice.bin!__scrt_common_main_seh() Line 288
> 	at d:\agent\_work\63\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(288)
> soffice.bin!__scrt_common_main() Line 331
> 	at d:\agent\_work\63\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(331)
> soffice.bin!mainCRTStartup() Line 17
> 	at d:\agent\_work\63\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp(17)
> kernel32.dll!BaseThreadInitThunk
()
> ntdll.dll!RtlUserThreadStart
()



More information about the LibreOffice mailing list