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

coroberti coroberti at gmail.com
Fri Jul 19 12:55:53 CEST 2024


Sorry, Nuno.
I've never tried thread-sanitizer.

Instead, strace on linux or connecting from a debugger on all platforms
were helpful.

Kind regards,
Robert Iakobashvili
............................


On Fri, Jul 19, 2024 at 1:52 PM Nuno Santos <nuno.santos at imaginando.pt>
wrote:

> Dennis,
> Robert,
>
> One more question.
>
> When using thread sanitiser in the MacOS version I can only see "SUMMARY:
> ThreadSanitizer: data race”. A lot of them.
>
> Can data race cause deadlocks?
>
> Or should I explicitly look for deadlock: "lock-order-inversion (potential
> deadlock)”
>
> Thanks!
>
> Regards,
>
> Nuno
>
> On 19 Jul 2024, at 11:41, Nuno Santos <nuno.santos at imaginando.pt> wrote:
>
> Dennis,
>
> I’m willing to try to run this on Linux and see if I can spot anything
> there. It might take me a while to setup though.
>
> I have built Qt with -sanitize thread.
>
> When using that kit, the -fsanitize=thread option is automatically applied
> to the program as well, manually applying:
>
> QMAKE_CXXFLAGS += -fsanitize=thread
>
> Makes that option appear two times in the compilation:
>
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
> -c -pipe -stdlib=libc++ -fsanitize=thread -O2 -std=gnu++1z  -arch arm64
> -isysroot
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk
> -mmacosx-version-min=11.0 -fsanitize=thread -fno-omit-frame-pointer -Wall
> -Wextra …
>
> Regarding compiler versions:
>
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
> --version
> Apple clang version 15.0.0 (clang-1500.1.0.2.5)
> Target: arm64-apple-darwin23.4.0
> Thread model: posix
>
> Regards,
>
> Nuno
>
> On 19 Jul 2024, at 11:34, Dennis Luehring <dl.soluz at gmx.net> wrote:
>
> Am 19.07.2024 um 12:30 schrieb Nuno Santos:
>
> That’s the biggest problem. It happens soooo RARELY.
>
> We can’t find a sistematic way of reproducing it. That is why I was trying
> to find a more analytical way of detecting it.
>
>
> can you're app be build and run on linux - sometimes the problems
> getting better detectable when switching OS - another time :)
>
>
> still not clear if you really build Qt AND your app with TSAN (i don't
> think so) and if you're using latest compilers available
>
>
>
>
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20240719/6ab403e7/attachment.htm>


More information about the Interest mailing list