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-4434] Compiler crashes when set duplicate type constraints in specific case #47011

Open
swift-ci opened this issue Mar 30, 2017 · 2 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

@swift-ci
Copy link
Collaborator

Previous ID SR-4434
Radar None
Original Reporter tarunon (JIRA User)
Type Bug
Environment

Swift 3.1, Xcode 8.3

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

md5: 7cbd6fdaff3214815ec1a4152d61debe

Issue Description:

1. Make 2 file
2. In file A, make 1 class conform some protocol.
3. In file B, make Generics type that has the class, and constraints the protocol.
4. Add extension the Generics class, and write a function that return Self.
5. Compile there files, `swiftc B.swift A.swift`. file B is first.

I try it sometimes, 1 project is crashed, but other hand is not crashed.

Minimum code is here.

//File A
protocol A {}
class O {}
extension O: A {}
//File B
struct F<X: O> where X: A {

}
extension F {
    func f() -> F {
        return F()
    }
}

Crashes project is here
https://github.com/tarunon/SR-4434

Crash log is here

swiftc Function.swift Protocol.swift
0  swift                    0x000000010c7fbeb7 PrintStackTraceSignalHandler(void*) + 39
1  swift                    0x000000010c7fb366 SignalHandler(int) + 646
2  libsystem_platform.dylib 0x00007fff8f790b3a _sigtramp + 26
3  libsystem_platform.dylib 0x00007fff56658b40 _sigtramp + 3337388064
4  swift                    0x00000001097486a2 void llvm::function_ref<void (swift::irgen::GenericRequirement)>::callback_fn<(anonymous namespace)::PolymorphicConvention::enumerateUnfulfilledRequirements(llvm::function_ref<void (swift::irgen::GenericRequirement)> const&)::$_7>(long, swift::irgen::GenericRequirement) + 162
5  swift                    0x000000010973fced (anonymous namespace)::PolymorphicConvention::enumerateRequirements(llvm::function_ref<void (swift::irgen::GenericRequirement)> const&) + 253
6  swift                    0x000000010974a27f swift::irgen::emitPolymorphicArguments(swift::irgen::IRGenFunction&, swift::CanTypeWrapper<swift::SILFunctionType>, swift::CanTypeWrapper<swift::SILFunctionType>, llvm::ArrayRef<swift::Substitution>, swift::irgen::WitnessMetadata*, swift::irgen::Explosion&) + 431
7  swift                    0x00000001097ae7f5 (anonymous namespace)::IRGenSILFunction::visitFullApplySite(swift::FullApplySite) + 2453
8  swift                    0x000000010979638a swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 9626
9  swift                    0x00000001096ae7c1 swift::irgen::IRGenerator::emitGlobalTopLevel() + 1041
10 swift                    0x000000010977ce1f performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::StringRef, llvm::LLVMContext&, swift::SourceFile*, llvm::GlobalVariable**, unsigned int) + 1695
11 swift                    0x000000010961d1d9 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 50889
12 swift                    0x00000001095ca88c main + 9052
13 libdyld.dylib            0x00007fff8f581235 start + 1
Stack dump:
0.  Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file Function.swift Protocol.swift -target x86_64-apple-macosx10.9 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -color-diagnostics -module-name main -o /var/folders/cb/63g4zp997cjbrqh2ys_jv14w0000gp/T/Function-749046.o
1.  While emitting IR SIL function @_TFe4mainRxCS_1OrVS_1F1ffT_GS1_x_ for 'f' at Function.swift:16:5
@swift-ci
Copy link
Collaborator Author

Comment by Nobuo Saito (JIRA)

I'm sorry I cannot reproduce it now.
I'll submit the project has crash and crash log tomorrow.

@swift-ci
Copy link
Collaborator Author

Comment by Nobuo Saito (JIRA)

Submit them.

@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
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

2 participants