[swift-users] Need some help understanding test behavior.

Atul Sowani sowani at gmail.com
Thu Dec 14 05:25:11 CST 2017


Hi,

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:

set -o pipefail;{
/root/swift-source/buildbot_incremental/swift-linux-powerpc64le/bin/swiftc
-target powerpc64le-unknown-linux-gnu  -module-cache-path
'/tmp/swift-testsuite-clang-module-cacheGEeVqc'
/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;
} &&
{ not env TSAN_OPTIONS="abort_on_error=0"
/root/swift-source/buildbot_incremental/swift-linux-powerpc64le/test-linux-powerpc64le/Sanitizers/Output/tsan.swift.tmp_tsan-binary
2>&1 | /root/swift-source/swift/utils/PathSanitizingFileCheck --sanitize
'BUILD_DIR=/root/swift-source/buildbot_incremental/swift-linux-powerpc64le'
--sanitize 'SOURCE_DIR=/root/swift-source/swift' --use-filecheck
'/root/swift-source/buildbot_incremental/llvm-linux-powerpc64le/./bin/FileCheck'
/root/swift-source/swift/test/Sanitizers/tsan.swift; }

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:

/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

This crashes bitterly. Having extremely new with Swift, I was trying to toy
with this command and found that if I omit "-frontend -c -primary-file"
arguments and keep everything else same, it just works. So effectively I am
using this "modified" command:

/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

As per my understanding so far, -frontend -c is invoking "C" frontend, I
don't know much about the "-primary_file". By removing "-frontend -c" I am
probably suppressing invocation of "C" frontend. But they what is used to
complete the execution?

I would like to know if tweaking makes any sense first of all, and if so,
how can I go about debugging this issue?

Thanks,
Atul.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20171214/55bc0705/attachment.html>


More information about the swift-users mailing list