<div dir="ltr"><div>Hi,</div><div><br></div><div>I am trying to understand behavior of Swift test case Sanitizers/tsan.swift. When I run Swift test suite, this test case generates corresponding test script as follows:</div><div><br></div><div>set -o pipefail;{ /root/swift-source/buildbot_incremental/swift-linux-powerpc64le/bin/swiftc -target powerpc64le-unknown-linux-gnu  -module-cache-path &#39;/tmp/swift-testsuite-clang-module-cacheGEeVqc&#39; /root/swift-source/swift/test/Sanitizers/tsan.swift -target powerpc64le-unknown-linux-gnu -g -sanitize=thread -o /root/swift-source/buildbot_incremental/swift-linux-powerpc64le/test-linux-powerpc64le/Sanitizers/Output/tsan.swift.tmp_tsan-binary; } &amp;&amp;<br>{ not env TSAN_OPTIONS=&quot;abort_on_error=0&quot;  /root/swift-source/buildbot_incremental/swift-linux-powerpc64le/test-linux-powerpc64le/Sanitizers/Output/tsan.swift.tmp_tsan-binary 2&gt;&amp;1 | /root/swift-source/swift/utils/PathSanitizingFileCheck --sanitize &#39;BUILD_DIR=/root/swift-source/buildbot_incremental/swift-linux-powerpc64le&#39; --sanitize &#39;SOURCE_DIR=/root/swift-source/swift&#39; --use-filecheck &#39;/root/swift-source/buildbot_incremental/llvm-linux-powerpc64le/./bin/FileCheck&#39; /root/swift-source/swift/test/Sanitizers/tsan.swift; }<br></div><div><br></div><div>The first line in this script is failing (actually crashing) on my machine and I am trying to analyze it. What I have seen is this first line generates following command:</div><div><br></div><div>/root/swift-source/buildbot_incremental/swift-linux-powerpc64le/bin/swift -frontend -c -primary-file /root/swift-source/swift/test/Sanitizers/tsan.swift -target powerpc64le-unknown-linux-gnu -disable-objc-interop -g -module-cache-path /tmp/swift-testsuite-clang-module-cacheGEeVqc -sanitize=thread -emit-module-doc-path /tmp/tsan-d095e5.swiftdoc -color-diagnostics -module-name main -emit-module-path /tmp/tsan-d095e5.swiftmodule -o /tmp/tsan-d095e5.o</div><div><br></div><div>This crashes bitterly. Having extremely new with Swift, I was trying to toy with this command and found that if I omit &quot;-frontend -c -primary-file&quot; arguments and keep everything else same, it just works. So effectively I am using this &quot;modified&quot; command:</div><div><br></div><div>/root/swift-source/buildbot_incremental/swift-linux-powerpc64le/bin/swift /root/swift-source/swift/test/Sanitizers/tsan.swift -target powerpc64le-unknown-linux-gnu -disable-objc-interop -g -module-cache-path /tmp/swift-testsuite-clang-module-cacheGEeVqc -sanitize=thread -emit-module-doc-path /tmp/tsan-d095e5.swiftdoc -color-diagnostics -module-name main -emit-module-path /tmp/tsan-d095e5.swiftmodule -o /tmp/tsan-d095e5.o</div><div><br></div><div>As per my understanding so far, -frontend -c is invoking &quot;C&quot; frontend, I don&#39;t know much about the &quot;-primary_file&quot;. By removing &quot;-frontend -c&quot; I am probably suppressing invocation of &quot;C&quot; frontend. But they what is used to complete the execution?</div><div><br></div><div>I would like to know if tweaking makes any sense first of all, and if so, how can I go about debugging this issue?</div><div><br></div><div>Thanks,</div><div>Atul.</div></div>