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-14260] Concurrency: Compiler crash while compiling release build #56620

Closed
adam-fowler opened this issue Feb 19, 2021 · 3 comments
Closed
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. concurrency Feature: umbrella label for concurrency language features

Comments

@adam-fowler
Copy link

Previous ID SR-14260
Radar rdar://problem/74522006
Original Reporter @adam-fowler
Type Bug
Status Closed
Resolution Done
Environment

Using Swift Dev Snapshot 10/02/2021

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

md5: dee18a2ba549fa6426935f307c9f0852

Issue Description:

If using the compiler flag -enable-experimental-concurrency the following code will cause the compiler to crash with an Abort trap:6 when compiling release

public protocol ResponseBodyStreamer { }
public enum ResponseBody {
    case stream(ResponseBodyStreamer)
    case empty
}

public final class Response {
    public var body: ResponseBody
    public init(body: ResponseBody) {
        self.body = body
    }
}

public func apply() async throws -> Response {
    return Response(body: .empty)
}

The callstack is as follows

1.  Apple Swift version 5.4-dev (LLVM 1e4181b99f530d2, Swift 842cc9c88f5463b)
2.  While emitting IR SIL function "@$s11Hummingbird5applyAA8ResponseCyYKF".
 for 'apply()' (at /Users/adamfowler/Developer/server/hummingbird/hummingbird/Sources/Hummingbird/File.swift:16:8)
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  swift-frontend           0x0000000113964857 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 39
1  swift-frontend           0x0000000113963a15 llvm::sys::RunSignalHandlers() + 85
2  swift-frontend           0x0000000113964e76 SignalHandler(int) + 262
3  libsystem_platform.dylib 0x00007fff20373d7d _sigtramp + 29
4  libsystem_platform.dylib 000000000000000000 _sigtramp + 18446603339975672480
5  libsystem_c.dylib        0x00007fff20282720 abort + 120
6  libsystem_c.dylib        0x00007fff202819d6 err + 0
7  swift-frontend           0x0000000113a810b3 swift::SILInstructionVisitor<(anonymous namespace)::IRGenSILFunction, void>::visit(swift::SILInstruction*) (.cold.744) + 35
8  swift-frontend           0x000000010f33d737 swift::SILInstructionVisitor<(anonymous namespace)::IRGenSILFunction, void>::visit(swift::SILInstruction*) + 76631
9  swift-frontend           0x000000010f32621f (anonymous namespace)::IRGenSILFunction::emitSILFunction() + 8063
10 swift-frontend           0x000000010f323d36 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 1542
11 swift-frontend           0x000000010f1f5c32 swift::irgen::IRGenerator::emitGlobalTopLevel(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) + 818
12 swift-frontend           0x000000010f2e86f7 swift::performIRGeneration(swift::ModuleDecl*, swift::IRGenOptions const&, swift::TBDGenOptions const&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::ArrayRef<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, llvm::GlobalVariable**) + 1431
13 swift-frontend           0x000000010effbb62 performCompileStepsPostSILGen(swift::CompilerInstance&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) + 2386
14 swift-frontend           0x000000010effafec performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 636
15 swift-frontend           0x000000010eff0028 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 5016
16 swift-frontend           0x000000010ef8a566 main + 566
17 libdyld.dylib            0x00007fff2034a621 start + 1
@ktoso
Copy link
Member

ktoso commented Feb 19, 2021

@swift-ci create

@DougGregor
Copy link
Member

This is fixed on "main"; tested against db7ee5f.

@adam-fowler
Copy link
Author

yep fixed

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 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. concurrency Feature: umbrella label for concurrency language features
Projects
None yet
Development

No branches or pull requests

3 participants