Enabling Thread Sanitizer causes build to fail

When I enabled Thread Sanitizer runtime checking, my macOS app fails to build - despite compiling successfully when this diagnostic is disabled.

I get several Uncategorized errors when compiling three Swift packages (AXSwift, Cryptor and Socket) that I have imported using SwiftPM.

Uncategorized: Command CompileSwift failed with a nonzero exit code.


Any ideas on what is going wrong?

I'm on macOS Catalina 10.15.7 (19H2) using Xcode 11.3.1 (11C505).

We are seeing a similar problem (different SPM dependencies fail to compile) with Adress Sanitizer enabled. Any help would be appreciated.

I can also confirm this issue – it happens for SPM dependencies, seemingly at random, when either address or thread sanitization is enabled. For the time being, I've moved almost all my dependencies back to CocoaPods and everything builds fine. Filed https://bugs.swift.org/browse/SR-14863 to help track this issue. Hopefully there's a fix!

Enabling Thread Sanitizer causes build to fail
 
 
Q