Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-10133] compiler crash when compiling SwiftNIO with TSan (swift-5.0-DEVELOPMENT-SNAPSHOT-2019-03-10) #52535

Closed
weissi opened this issue Mar 20, 2019 · 4 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software

Comments

@weissi
Copy link
Member

weissi commented Mar 20, 2019

Previous ID SR-10133
Radar rdar://49151041
Original Reporter @weissi
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash
Assignee None
Priority Medium

md5: 8fba9149acde8ac34aa8e2f68c89796e

Issue Description:

if you compile swift-nio git commit 164f9b12d616bfcbd13b6a89ce52099c815188d4 with a very recent Swift 5 compiler with TSan, the compiler crashes with:

$ /Library/Developer/Toolchains/swift-5.0-DEVELOPMENT-SNAPSHOT-2019-03-10-a.xctoolchain/usr/bin/swift build --sanitize=thread
Assertion failed: (isa<X>(Val) && "cast<Ty>() argument of incompatible type!"), function cast, file /Users/buildnode/jenkins/workspace/oss-swift-5.0-package-osx/llvm/include/llvm/Support/Casting.h, line 255.
Stack dump:
0.  Program arguments: /Library/Developer/Toolchains/swift-5.0-DEVELOPMENT-SNAPSHOT-2019-03-10-a.xctoolchain/usr/bin/swift -frontend -c /Users/johannes/devel/swift-nio/Sources/NIO/AddressedEnvelope.swift /Users/johannes/devel/swift-nio/Sources/NIO/BaseSocket.swift /Users/johannes/devel/swift-nio/Sources/NIO/BaseSocketChannel.swift /Users/johannes/devel/swift-nio/Sources/NIO/Bootstrap.swift /Users/johannes/devel/swift-nio/Sources/NIO/ByteBuffer-aux.swift /Users/johannes/devel/swift-nio/Sources/NIO/ByteBuffer-core.swift /Users/johannes/devel/swift-nio/Sources/NIO/ByteBuffer-int.swift /Users/johannes/devel/swift-nio/Sources/NIO/ByteBuffer-views.swift /Users/johannes/devel/swift-nio/Sources/NIO/Channel.swift /Users/johannes/devel/swift-nio/Sources/NIO/ChannelHandler.swift /Users/johannes/devel/swift-nio/Sources/NIO/ChannelHandlers.swift /Users/johannes/devel/swift-nio/Sources/NIO/ChannelInvoker.swift /Users/johannes/devel/swift-nio/Sources/NIO/ChannelOption.swift /Users/johannes/devel/swift-nio/Sources/NIO/ChannelPipeline.swift -primary-file /Users/johannes/devel/swift-nio/Sources/NIO/CircularBuffer.swift -primary-file /Users/johannes/devel/swift-nio/Sources/NIO/Codec.swift -primary-file /Users/johannes/devel/swift-nio/Sources/NIO/CompositeError.swift -primary-file /Users/johannes/devel/swift-nio/Sources/NIO/DatagramVectorReadManager.swift -primary-file /Users/johannes/devel/swift-nio/Sources/NIO/DeadChannel.swift -primary-file /Users/johannes/devel/swift-nio/Sources/NIO/Embedded.swift -primary-file /Users/johannes/devel/swift-nio/Sources/NIO/EventLoop.swift /Users/johannes/devel/swift-nio/Sources/NIO/EventLoopFuture.swift /Users/johannes/devel/swift-nio/Sources/NIO/FileDescriptor.swift /Users/johannes/devel/swift-nio/Sources/NIO/FileHandle.swift /Users/johannes/devel/swift-nio/Sources/NIO/FileRegion.swift /Users/johannes/devel/swift-nio/Sources/NIO/GetaddrinfoResolver.swift /Users/johannes/devel/swift-nio/Sources/NIO/HappyEyeballs.swift /Users/johannes/devel/swift-nio/Sources/NIO/Heap.swift /Users/johannes/devel/swift-nio/Sources/NIO/IO.swift /Users/johannes/devel/swift-nio/Sources/NIO/IOData.swift /Users/johannes/devel/swift-nio/Sources/NIO/IntegerTypes.swift /Users/johannes/devel/swift-nio/Sources/NIO/Interfaces.swift /Users/johannes/devel/swift-nio/Sources/NIO/Linux.swift /Users/johannes/devel/swift-nio/Sources/NIO/LinuxCPUSet.swift /Users/johannes/devel/swift-nio/Sources/NIO/MarkedCircularBuffer.swift /Users/johannes/devel/swift-nio/Sources/NIO/MulticastChannel.swift /Users/johannes/devel/swift-nio/Sources/NIO/NIOAny.swift /Users/johannes/devel/swift-nio/Sources/NIO/NIOThreadPool.swift /Users/johannes/devel/swift-nio/Sources/NIO/NonBlockingFileIO.swift /Users/johannes/devel/swift-nio/Sources/NIO/PendingDatagramWritesManager.swift /Users/johannes/devel/swift-nio/Sources/NIO/PendingWritesManager.swift /Users/johannes/devel/swift-nio/Sources/NIO/PriorityQueue.swift /Users/johannes/devel/swift-nio/Sources/NIO/RecvByteBufferAllocator.swift /Users/johannes/devel/swift-nio/Sources/NIO/Resolver.swift /Users/johannes/devel/swift-nio/Sources/NIO/Selectable.swift /Users/johannes/devel/swift-nio/Sources/NIO/Selector.swift /Users/johannes/devel/swift-nio/Sources/NIO/ServerSocket.swift /Users/johannes/devel/swift-nio/Sources/NIO/Socket.swift /Users/johannes/devel/swift-nio/Sources/NIO/SocketAddresses.swift /Users/johannes/devel/swift-nio/Sources/NIO/SocketChannel.swift /Users/johannes/devel/swift-nio/Sources/NIO/SocketOptionProvider.swift /Users/johannes/devel/swift-nio/Sources/NIO/System.swift /Users/johannes/devel/swift-nio/Sources/NIO/Thread.swift /Users/johannes/devel/swift-nio/Sources/NIO/TypeAssistedChannelHandler.swift /Users/johannes/devel/swift-nio/Sources/NIO/Utilities.swift -supplementary-output-file-map0.10 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I /Users/johannes/devel/swift-nio/.build/x86_64-apple-macosx/debug -I /Users/johannes/devel/swift-nio/Sources/CNIOSHA1/include -I /Users/johannes/devel/swift-nio/Sources/CNIOAtomics/include -I /Users/johannes/devel/swift-nio/Sources/CNIODarwin/include -I /Users/johannes/devel/swift-nio/Sources/CNIOLinux/include -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -enable-testing -g -module-cache-path /Users/johannes/devel/swift-nio/.build/x86_64-apple-macosx/debug/ModuleCache -sanitize=thread -swift-version 5 -Onone -D SWIFT_PACKAGE -D DEBUG -color-diagnostics -enable-anonymous-context-mangled-names -Xcc -fmodule-map-file=/Users/johannes/devel/swift-nio/.build/x86_64-apple-macosx/debug/CNIOSHA1.build/module.modulemap -Xcc -fmodule-map-file=/Users/johannes/devel/swift-nio/.build/x86_64-apple-macosx/debug/CNIOAtomics.build/module.modulemap -Xcc -fmodule-map-file=/Users/johannes/devel/swift-nio/.build/x86_64-apple-macosx/debug/CNIODarwin.build/module.modulemap -Xcc -fmodule-map-file=/Users/johannes/devel/swift-nio/.build/x86_64-apple-macosx/debug/CNIOLinux.build/module.modulemap -parse-as-library -module-name NIO -o /Users/johannes/devel/swift-nio/.build/x86_64-apple-macosx/debug/NIO.build/CircularBuffer.swift.o -o /Users/johannes/devel/swift-nio/.build/x86_64-apple-macosx/debug/NIO.build/Codec.swift.o -o /Users/johannes/devel/swift-nio/.build/x86_64-apple-macosx/debug/NIO.build/CompositeError.swift.o -o /Users/johannes/devel/swift-nio/.build/x86_64-apple-macosx/debug/NIO.build/DatagramVectorReadManager.swift.o -o /Users/johannes/devel/swift-nio/.build/x86_64-apple-macosx/debug/NIO.build/DeadChannel.swift.o -o /Users/johannes/devel/swift-nio/.build/x86_64-apple-macosx/debug/NIO.build/Embedded.swift.o -o /Users/johannes/devel/swift-nio/.build/x86_64-apple-macosx/debug/NIO.build/EventLoop.swift.o -index-store-path /Users/johannes/devel/swift-nio/.build/x86_64-apple-macosx/debug/index/store -index-system-modules 
1.  Running pass 'CallGraph Pass Manager' on module '/Users/johannes/devel/swift-nio/.build/x86_64-apple-macosx/debug/NIO.build/CompositeError.swift.o'.
2.  While splitting coroutine @"$s3NIO17NIOCompositeErrorVys0C0_pSicir"
0  swift                    0x0000000104d30bf5 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1  swift                    0x0000000104d2fe95 llvm::sys::RunSignalHandlers() + 85
2  swift                    0x0000000104d311e2 SignalHandler(int) + 258
3  libsystem_platform.dylib 0x00007fff7408849d _sigtramp + 29
4  swift                    0x0000000104c541ae llvm::ValueHandleBase::AddToUseList() + 302
5  libsystem_c.dylib        0x00007fff73f3faae abort + 120
6  libsystem_c.dylib        0x00007fff73f087d4 basename_r + 0
7  swift                    0x00000001031951ca (anonymous namespace)::CoroCloner::create() + 4618
8  swift                    0x0000000103192795 splitCoroutine(llvm::Function&, llvm::coro::Shape&, llvm::SmallVectorImpl<llvm::Function*>&) + 5733
9  swift                    0x00000001031906e7 (anonymous namespace)::CoroSplit::runOnSCC(llvm::CallGraphSCC&) + 5879
10 swift                    0x0000000103b1bfcf (anonymous namespace)::CGPassManager::runOnModule(llvm::Module&) + 1855
11 swift                    0x0000000104c01946 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 886
12 swift                    0x00000001012b0912 swift::performLLVMOptimizations(swift::IRGenOptions&, llvm::Module*, llvm::TargetMachine*) + 1730
13 swift                    0x00000001012b13a6 swift::performLLVM(swift::IRGenOptions&, swift::DiagnosticEngine*, llvm::sys::SmartMutex<false>*, llvm::GlobalVariable*, llvm::Module*, llvm::TargetMachine*, swift::version::Version const&, llvm::StringRef, swift::UnifiedStatsReporter*) + 1910
14 swift                    0x0000000101166534 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, r*) + 16004
15 swift                    0x0000000101161948 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3000
16 swift                    0x0000000101113782 main + 690
17 libdyld.dylib            0x00007fff73e9112d start + 1
<unknown>:0: error: unable to execute command: Abort trap: 6
<unknown>:0: error: compile command failed due to signal 6 (use -v to see invocation)

snapshot is

swift-5.0-DEVELOPMENT-SNAPSHOT-2019-03-10

repro

git clone https://github.com/apple/swift-nio
cd swift-nio
git fetch origin
git reset --hard 164f9b12d616bfcbd13b6a89ce52099c815188d4
swift build --sanitize=thread
@belkadan
Copy link
Contributor

cc @kubamracek, @rjmccall

@aschwaighofer
Copy link
Member

This looks like what we fixed in #23219

@weissi
Copy link
Member Author

weissi commented Mar 22, 2019

@swift-ci create

@weissi
Copy link
Member Author

weissi commented Aug 27, 2019

this is fixed

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software
Projects
None yet
Development

No branches or pull requests

4 participants