[Interest] Will TSAN_OPTIONS=detect_deadlocks=1 work when Qt is compiled with -sanitize thread?

Thiago Macieira thiago.macieira at intel.com
Fri Jul 19 17:56:25 CEST 2024


On Friday 19 July 2024 07:15:19 GMT-7 Nuno Santos via Interest wrote:
> (lldb) bt all
> * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
>   * frame #0: 0x00000001db7aa1cc libsystem_kernel.dylib`__psynch_cvwait + 8
>     frame #1: 0x00000001ef5096e4 libsystem_pthread.dylib`_pthread_cond_wait
> + 1228 
> frame #2: 0x0000000103e04bc4 
> BAM`QWaitConditionPrivate::wait(QDeadlineTimer) + 64 frame #3:
> 0x0000000103e04b18 BAM`QWaitCondition::wait(QMutex*, QDeadlineTimer) + 148
> frame #4: 0x000000010313a960
> BAM`QSGThreadedRenderLoop::polishAndSync(QSGThreadedRenderLoop::Window*,
> bool) + 1544 
> frame #5: 0x000000010313ae38
> BAM`QSGThreadedRenderLoop::handleUpdateRequest(QQuickWindow*) + 364

This is one of the frozen threads. It's inside the Scene Graph waiting on a 
QWaitCondition for an event notification. The question is what its partner 
thread, the one that is supposed to notify on this WC but isn't doing so?

The only one running SG code is thread 26:

>  thread #26, name = 'QSGRenderThread'
>     frame #0: 0x0000000103567f40
>     BAM`QRhiMetal::enqueueResourceUpdates(QRhiCommandBuffer*,
>     QRhiResourceUpdateBatch*) + 948 
>     frame #1: 0x0000000103007724
>     BAM`QSGBatchRenderer::Renderer::prepareRenderPass(QSGBatchRenderer::Ren
>     derer::RenderPassContext*) + 2264 
>     frame #2: 0x0000000103006dcc
>     BAM`QSGBatchRenderer::Renderer::render() + 36 
>     frame #3:
>     0x000000010301bb70 BAM`QSGRenderer::renderScene() + 344

But this thread isn't frozen: it's not stopped at a system call. If this is 
the thread that should have notified the WC, why didn't it? Or why hasn't it 
got to the notification yet (that would be a livelock, not a deadlock)?

Or has it notified by the other thread didn't get it?

Either way, I think you've found a Qt bug. Please test with 6.7 or 6.8 betas, 
and report it with the updated backtrace.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Principal Engineer - Intel DCAI Platform & System Engineering
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5152 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20240719/244369c5/attachment.bin>


More information about the Interest mailing list