Skip to content

Qt: (only gcc build) segmentation fault in render thread with independent window qt quick popup

This is really frustrating. This usually occurs when I switch pages (from player to media library and vice versa). The independent window has already been problematic there: #28919 (closed). It seems that disabling the independent window for quick popup feature (!6240 (merged)) no longer causes this, but the stack trace says it is more of a generic issue, so I'm not blaming the independent window feature at the moment:

Thread 244 "QSGRenderThread" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 6576.0xc04]
0x00007ffc4359b9f1 in std::unique_ptr<QUnifiedTimer, std::default_delete<QUnifiedTimer> >::~unique_ptr() ()
   from D:\vlc-4.0.0-dev-bettersynchnew2\plugins\gui\libqt_plugin.dll
(gdb) bt
#0  0x00007ffc4359b9f1 in std::unique_ptr<QUnifiedTimer, std::default_delete<QUnifiedTimer> >::~unique_ptr() ()
   from D:\vlc-4.0.0-dev-bettersynchnew2\plugins\gui\libqt_plugin.dll
#1  0x00007ffc422138d9 in (anonymous namespace)::run (p=<optimized out>)
    at /build/mingw-w64-gcc/src/gcc/libstdc++-v3/libsupc++/atexit_thread.cc:98
#2  0x00007ffc41c98650 in _pthread_cleanup_dest (t=<optimized out>)
    at /build/mingw-w64-winpthreads/src/mingw-w64-v12.0.0/mingw-w64-libraries/winpthreads/src/thread.c:999
#3  0x00007ffc41c988b2 in _pthread_cleanup_dest (t=<optimized out>)
    at /build/mingw-w64-winpthreads/src/mingw-w64-v12.0.0/mingw-w64-libraries/winpthreads/src/thread.c:975
#4  __dyn_tls_pthread (hDllHandle=<optimized out>, lpreserved=<optimized out>, dwReason=<optimized out>)
    at /build/mingw-w64-winpthreads/src/mingw-w64-v12.0.0/mingw-w64-libraries/winpthreads/src/thread.c:461
#5  __dyn_tls_pthread (hDllHandle=<optimized out>, dwReason=<optimized out>, lpreserved=<optimized out>)
    at /build/mingw-w64-winpthreads/src/mingw-w64-v12.0.0/mingw-w64-libraries/winpthreads/src/thread.c:428
#6  0x00007ffd38d72073 in ntdll!RtlDeactivateActivationContext () from C:\WINDOWS\SYSTEM32\ntdll.dll
#7  0x00007ffd38d78030 in ntdll!RtlVirtualUnwind () from C:\WINDOWS\SYSTEM32\ntdll.dll
#8  0x00007ffd38e1c6fa in ntdll!LdrShutdownThread () from C:\WINDOWS\SYSTEM32\ntdll.dll
#9  0x00007ffd38e1bfb6 in ntdll!RtlExitUserThread () from C:\WINDOWS\SYSTEM32\ntdll.dll
#10 0x00007ffd383ce8e0 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#11 0x00007ffd38e1bf2c in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#12 0x0000000000000000 in ?? ()

The unique pointer is thread_local: https://github.com/qt/qtbase/commit/4a93285b166ceceaea2e10c8fc6a254d2f7093b9

With independent window popups, each popup would have its own QQuickWindow. When we switch pages, I guess this occurs when the window and its associated render thread gets deleted.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information