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

Nuno Santos nuno.santos at imaginando.pt
Thu Jul 18 17:48:26 CEST 2024


Robert,

Thanks for your reply. I’m on MacOS and strace does not seem to be available.

This deadlocks are very rare on MacOS and more frequent on iOS but this is mostly reported by our users. When developing we are rarely faced with this dead locks and when they happen I find myself wondering why they happen. And since they are so rare to reproduce it becomes even more difficult to find a solution.

That is why I’m looking for tools that could help me identify the problem in a more sistematic way.

Thank you!

Regards,

Nuno

> On 18 Jul 2024, at 16:41, coroberti <coroberti at gmail.com> wrote:
> 
> Nuno,
> if you are on linux, strace command could be helpful to see and analyse all system calls.
> Thus, you could see how you are coming to a deadlock, if any.
> 
> Kind regards,
> Robert Iakobashvili
> ............................
> 
> 
> On Thu, Jul 18, 2024 at 6:31 PM Nuno Santos via Interest <interest at qt-project.org <mailto:interest at qt-project.org>> wrote:
>> Hi,
>> 
>> Thanks for your reply.
>> 
>> I’ve compiled Qt with -sanitize thread and I’m trying to find deadlock on my application.
>> 
>> Regards,
>> 
>> Nuno
>> 
>> > On 18 Jul 2024, at 16:15, Dennis Luehring via Interest <interest at qt-project.org <mailto:interest at qt-project.org>> wrote:
>> > 
>> > Am 18.07.2024 um 17:07 schrieb Nuno Santos via Interest:
>> >> https://github.com/google/sanitizers/wiki/ThreadSanitizerDeadlockDetector
>> >> 
>> >> "Just use TSAN_OPTIONS=detect_deadlocks=1 when running your tsan-instrumented program.”
>> >> 
>> > 
>> > this document is from 2015 - lock order inversion aka Deadlock detection
>> > is a feature that is active per default
>> > or better said i've used TSAN many times to find deadlocks - maybe its a
>> > special feature but seems to be the default now
>> > 
>> > beware: you should always use recent gcc or clang for TSAN/ASAN as they
>> > evolve permanently - older compiler instrumentation just don't be that good
>> > in detecting - im normaly using SUSE Tumbleweed with latest available
>> > gcc/clang for a my "bug hunting" environment
>> > 
>> > do you try to find a Deadlock inside Qt code or inside your application
>> > - for the first a TSAN build of Qt would be better to prevent false
>> > positives
>> > 
>> > 
>> > 
>> > _______________________________________________
>> > Interest mailing list
>> > Interest at qt-project.org <mailto:Interest at qt-project.org>
>> > https://lists.qt-project.org/listinfo/interest
>> 
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org <mailto:Interest at qt-project.org>
>> https://lists.qt-project.org/listinfo/interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20240718/d303291a/attachment.htm>


More information about the Interest mailing list