1.5-dev: (Windows) Deadlock on quit, process not exiting sometimes
On master, sometimes quitting will result in the Inkscape process still lingering in the background. <details> <summary>Backtrace</summary> ``` #0 0x00007ffb5d00e0f4 in ntdll!ZwWaitForMultipleObjects () from C:\WINDOWS\SYSTEM32\ntdll.dll #1 0x00007ffb5a870d00 in WaitForMultipleObjectsEx () from C:\WINDOWS\System32\KernelBase.dll #2 0x00007ffb5a870bfe in WaitForMultipleObjects () from C:\WINDOWS\System32\KernelBase.dll #3 0x00007ffb35a7239a in ?? () from D:\dev\inkscape\inkscape-install\bin\libwinpthread-1.dll #4 0x00007ffb35a7264d in ?? () from D:\dev\inkscape\inkscape-install\bin\libwinpthread-1.dll #5 0x00007ffb35a726e6 in ?? () from D:\dev\inkscape\inkscape-install\bin\libwinpthread-1.dll #6 0x00007ffb2dc1a469 in ?? () from D:\dev\inkscape\inkscape-install\bin\libstdc++-6.dll #7 0x00007ffa6cdf6e2a in Inkscape::dispatch_pool::~dispatch_pool (this=0x251f8610) at D:/dev/inkscape/inkscape-src/src/display/dispatch-pool.cpp:39 #8 0x00007ffa6ce37f7b in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x251f8600) at C:/msys64/ucrt64/include/c++/15.2.0/bits/shared_ptr_base.h:345 #9 std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x251f8600) at C:/msys64/ucrt64/include/c++/15.2.0/bits/shared_ptr_base.h:316 #10 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count ( this=0x7ffa6e45cb48 <Inkscape::(anonymous namespace)::g_dispatch_pool+8>) at C:/msys64/ucrt64/include/c++/15.2.0/bits/shared_ptr_base.h:1069 #11 std::__shared_ptr<Inkscape::dispatch_pool, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr ( this=0x7ffa6e45cb40 <Inkscape::(anonymous namespace)::g_dispatch_pool>) at C:/msys64/ucrt64/include/c++/15.2.0/bits/shared_ptr_base.h:1531 #12 std::shared_ptr<Inkscape::dispatch_pool>::~shared_ptr ( this=0x7ffa6e45cb40 <Inkscape::(anonymous namespace)::g_dispatch_pool>) at C:/msys64/ucrt64/include/c++/15.2.0/bits/shared_ptr.h:175 #13 __tcf_ZN8Inkscape12_GLOBAL__N_1L15g_dispatch_poolE () at D:/dev/inkscape/inkscape-src/src/display/threading.cpp:21 #14 0x00007ffb5a7042d6 in ucrtbase!_execute_onexit_table () from C:\WINDOWS\System32\ucrtbase.dll #15 0x00007ffb5a7041fb in ucrtbase!_execute_onexit_table () from C:\WINDOWS\System32\ucrtbase.dll #16 0x00007ffb5a7041b4 in ucrtbase!_execute_onexit_table () from C:\WINDOWS\System32\ucrtbase.dll #17 0x00007ffa6cbf1092 in _CRT_INIT (hDllHandle=hDllHandle@entry=0x7ffa6cbf0000, dwReason=<optimized out>, lpreserved=lpreserved@entry=0x1) at D:/W/B/src/mingw-w64/mingw-w64-crt/crt/crtdll.c:126 #18 0x00007ffa6cbf123b in DllMainCRTStartup (hDllHandle=0x7ffa6cbf0000, dwReason=0, lpreserved=0x1) at D:/W/B/src/mingw-w64/mingw-w64-crt/crt/crtdll.c:174 #19 0x00007ffb5cf89a1d in ntdll!RtlActivateActivationContextUnsafeFast () from C:\WINDOWS\SYSTEM32\ntdll.dll #20 0x00007ffb5cfcf1ca in ntdll!LdrShutdownProcess () from C:\WINDOWS\SYSTEM32\ntdll.dll #21 0x00007ffb5cfcef7d in ntdll!RtlExitUserProcess () from C:\WINDOWS\SYSTEM32\ntdll.dll #22 0x00007ffb5b28e3eb in KERNEL32!FatalExit () from C:\WINDOWS\System32\kernel32.dll #23 0x00007ffb5a7105bc in ucrtbase!exit () from C:\WINDOWS\System32\ucrtbase.dll #24 0x00007ffb5a71045f in ucrtbase!exit () from C:\WINDOWS\System32\ucrtbase.dll #25 0x00007ff621c813d9 in __tmainCRTStartup () at D:/W/B/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:238 #26 0x00007ff621c813f6 in WinMainCRTStartup () at D:/W/B/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:91 ``` </details> Stepping through shows the deadlock happening in the `std::condition_variable` dtor of `dispatch_pool::_available_cv`. (At this point there are no other threads running though, so maybe it's not really a deadlock?) Something weird is that if I try to use Sysinternals Process Monitor to view the thread list of Inkscape, the process will resume and exit normally.
issue





















