-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of software
Description
Previous ID | SR-7097 |
Radar | rdar://problem/38001269 |
Original Reporter | calebkleveter (JIRA User) |
Type | Bug |
Status | Resolved |
Resolution | Done |
Attachment: Download
Environment
Apple Swift version 4.1-dev (LLVM 1c8b50929b, Clang 420ae40df6, Swift 6d0629e252)
Target: x86_64-apple-darwin17.4.0
Vapor Framework: 3.0.0-rc.1.1
Additional Detail from JIRA
Votes | 0 |
Component/s | Compiler |
Labels | Bug, CompilerCrash |
Assignee | None |
Priority | Medium |
md5: b93b4a3f0b16de9abdfd2d2df0216ce7
Issue Description:
I am getting a compiler crash that appears to be an issue with generics. I have a protocol that conforms to multiple other protocols, some coming from the Vapor framework, some I built:
protocol ProjectModel: Content, Model, Migration, Timestampable, SoftDeletable, FailableJSONRepresentable, Parameter, Publicizable, Updatable, ResponseDecodable
I then have a generic class that has some further restrictions:
final class ProjectController<M: CoreticsModel> where M.ResolvedParameter == Future<M>, M.Database: QuerySupporting
And then I have an extension method on a protocol that takes in a controller:
extension Router {
func controller<Model>(at path: PathComponent..., controller: ProjectController<Model>.Type)
}
This is the stack trace that I get from the compiler
Assertion failed: (hasVal), function operator*, file /Users/buildnode/jenkins/workspace/oss-swift-4.1-package-osx/llvm/include/llvm/ADT/Optional.h, line 146.
0 swift 0x000000010a90ebe8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1 swift 0x000000010a90f2f6 SignalHandler(int) + 694
2 libsystem_platform.dylib 0x00007fff7a6d4f5a _sigtramp + 26
3 libsystem_platform.dylib 0x0000000000003450 _sigtramp + 2240996624
4 libsystem_c.dylib 0x00007fff7a4ff312 abort + 127
5 libsystem_c.dylib 0x00007fff7a4c7368 basename_r + 0
6 swift 0x00000001074e2ddf swift::irgen::emitGenericRequirementFromSubstitutions(swift::irgen::IRGenFunction&, swift::CanGenericSignature, swift::ModuleDecl&, swift::irgen::GenericRequirement, swift::SubstitutionMap const&) + 255
7 swift 0x00000001074e8520 void llvm::function_ref<void (swift::irgen::GenericRequirement)>::callback_fn<(anonymous namespace)::EmitPolymorphicArguments::emit(swift::SubstitutionMap const&, swift::irgen::WitnessMetadata*, swift::irgen::Explosion&)::$_23>(long, swift::irgen::GenericRequirement) + 32
8 swift 0x00000001074e8677 void llvm::function_ref<void (swift::irgen::GenericRequirement)>::callback_fn<(anonymous namespace)::PolymorphicConvention::enumerateUnfulfilledRequirements(llvm::function_ref<void (swift::irgen::GenericRequirement)> const&)::$_9>(long, swift::irgen::GenericRequirement) + 215
9 swift 0x00000001074dbabc swift::irgen::enumerateGenericSignatureRequirements(swift::CanGenericSignature, llvm::function_ref<void (swift::irgen::GenericRequirement)> const&) + 332
10 swift 0x00000001074e2302 swift::irgen::emitPolymorphicArguments(swift::irgen::IRGenFunction&, swift::CanTypeWrapper<swift::SILFunctionType>, swift::SubstitutionMap const&, swift::irgen::WitnessMetadata*, swift::irgen::Explosion&) + 386
11 swift 0x000000010755c108 (anonymous namespace)::IRGenSILFunction::visitFullApplySite(swift::FullApplySite) + 1928
12 swift 0x0000000107543eef (anonymous namespace)::IRGenSILFunction::emitSILFunction() + 7151
13 swift 0x0000000107541e11 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 1361
14 swift 0x0000000107451055 swift::irgen::IRGenerator::emitGlobalTopLevel() + 485
15 swift 0x000000010751e774 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) + 1124
16 swift 0x000000010751ee06 swift::performIRGeneration(swift::IRGenOptions&, swift::SourceFile&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::StringRef, llvm::LLVMContext&, unsigned int, llvm::GlobalVariable**) + 86
17 swift 0x00000001073c7d8a performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 13786
18 swift 0x00000001073c37d0 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3376
19 swift 0x0000000107383083 main + 3075
20 libdyld.dylib 0x00007fff7a453115 start + 1
Stack dump:
Assertion failed: (hasVal), function operator*, file /Users/buildnode/jenkins/workspace/oss-swift-4.1-package-osx/llvm/include/llvm/ADT/Optional.h, line 146.
0 swift 0x000000010a90ebe8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1 swift 0x000000010a90f2f6 SignalHandler(int) + 694
2 libsystem_platform.dylib 0x00007fff7a6d4f5a _sigtramp + 26
3 libsystem_platform.dylib 0x0000000000003450 _sigtramp + 2240996624
4 libsystem_c.dylib 0x00007fff7a4ff312 abort + 127
5 libsystem_c.dylib 0x00007fff7a4c7368 basename_r + 0
6 swift 0x00000001074e2ddf swift::irgen::emitGenericRequirementFromSubstitutions(swift::irgen::IRGenFunction&, swift::CanGenericSignature, swift::ModuleDecl&, swift::irgen::GenericRequirement, swift::SubstitutionMap const&) + 255
7 swift 0x00000001074e8520 void llvm::function_ref<void (swift::irgen::GenericRequirement)>::callback_fn<(anonymous namespace)::EmitPolymorphicArguments::emit(swift::SubstitutionMap const&, swift::irgen::WitnessMetadata*, swift::irgen::Explosion&)::$_23>(long, swift::irgen::GenericRequirement) + 32
8 swift 0x00000001074e8677 void llvm::function_ref<void (swift::irgen::GenericRequirement)>::callback_fn<(anonymous namespace)::PolymorphicConvention::enumerateUnfulfilledRequirements(llvm::function_ref<void (swift::irgen::GenericRequirement)> const&)::$_9>(long, swift::irgen::GenericRequirement) + 215
9 swift 0x00000001074dbabc swift::irgen::enumerateGenericSignatureRequirements(swift::CanGenericSignature, llvm::function_ref<void (swift::irgen::GenericRequirement)> const&) + 332
10 swift 0x00000001074e2302 swift::irgen::emitPolymorphicArguments(swift::irgen::IRGenFunction&, swift::CanTypeWrapper<swift::SILFunctionType>, swift::SubstitutionMap const&, swift::irgen::WitnessMetadata*, swift::irgen::Explosion&) + 386
11 swift 0x000000010755c108 (anonymous namespace)::IRGenSILFunction::visitFullApplySite(swift::FullApplySite) + 1928
12 swift 0x0000000107543eef (anonymous namespace)::IRGenSILFunction::emitSILFunction() + 7151
13 swift 0x0000000107541e11 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 1361
14 swift 0x0000000107451055 swift::irgen::IRGenerator::emitGlobalTopLevel() + 485
15 swift 0x000000010751e774 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) + 1124
16 swift 0x000000010751ee06 swift::performIRGeneration(swift::IRGenOptions&, swift::SourceFile&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::StringRef, llvm::LLVMContext&, unsigned int, llvm::GlobalVariable**) + 86
17 swift 0x00000001073c7d8a performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 13786
18 swift 0x00000001073c37d0 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3376
19 swift 0x0000000107383083 main + 3075
20 libdyld.dylib 0x00007fff7a453115 start + 1
Stack dump:
0. Program arguments: /Library/Developer/Toolchains/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-02-27-a.xctoolchain/usr/bin/swift -frontend -c /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Configuration/Boot.swift /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Configuration/Configure.swift /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Configuration/Database.swift /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Configuration/Router.swift /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Controllers/Controllers.swift /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Controllers/ProjController.swift /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Controllers/SearchController.swift /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Models/Address/Address.swift /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Models/Company/Company+Updatable.swift /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Models/Company/Company.swift /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Models/Company/CompanyAddress.swift /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Models/Company/CompanyPerson.swift /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Models/Company/CompanyPersonType.swift /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Models/Company/CompanyType.swift /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Models/ProjModel.swift /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Models/Person/Person+Updatable.swift /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Models/Person/Person.swift /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Models/Person/PersonAddress.swift /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Models/Person/PersonChange.swift /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Models/Person/PersonConnection.swift /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Models/Source/Source.swift /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Models/SourcePivot/SourcePivot.swift /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Models/Sources.swift /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Models/User/User.swift -primary-file /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Routes/Routes.swift /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Utilities/ProjError.swift /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Utilities/JSON+Request.swift /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Utilities/Public.swift /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Utilities/Updatable.swift -target x86_64-apple-macosx10.10 -enable-objc-interop -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -I /Users/calebkleveter/Development/Skelpo/Proj/.build/x86_64-apple-macosx10.10/debug -I /Users/calebkleveter/Development/Skelpo/Proj/.build/checkouts/engine.git-3311994267206676365/Sources/CHTTP/include -F /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -enable-testing -g -module-cache-path /Users/calebkleveter/Development/Skelpo/Proj/.build/x86_64-apple-macosx10.10/debug/ModuleCache -swift-version 4 -Onone -D SWIFT_PACKAGE -color-diagnostics -Xcc -fmodule-map-file=/Users/calebkleveter/Development/Skelpo/Proj/.build/x86_64-apple-macosx10.10/debug/CHTTP.build/module.modulemap -emit-module-doc-path /Users/calebkleveter/Development/Skelpo/Proj/.build/x86_64-apple-macosx10.10/debug/App.build/Routes~partial.swiftdoc -parse-as-library -module-name App -emit-module-path /Users/calebkleveter/Development/Skelpo/Proj/.build/x86_64-apple-macosx10.10/debug/App.build/Routes~partial.swiftmodule -emit-dependencies-path /Users/calebkleveter/Development/Skelpo/Proj/.build/x86_64-apple-macosx10.10/debug/App.build/Routes.d -emit-reference-dependencies-path /Users/calebkleveter/Development/Skelpo/Proj/.build/x86_64-apple-macosx10.10/debug/App.build/Routes.swiftdeps -num-threads 4 -o /Users/calebkleveter/Development/Skelpo/Proj/.build/x86_64-apple-macosx10.10/debug/App.build/Routes/Routes.swift.o
1. While emitting IR SIL function "@_T05Vapor6RouterP3AppE15configureRoutesyyF".
for 'configureRoutes()' at /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Routes/Routes.swift:6:5
<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)1. While emitting IR SIL function "@_T05Vapor6RouterP3AppE15configureRoutesyyF".
for 'configureRoutes()' at /Users/calebkleveter/Development/Skelpo/Proj/Sources/App/Routes/Routes.swift:6:5
<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)// code placeholder
This code worked in the Swift snapshot that was released with Xcode 9.3 beta, build 9Q107o (if I remember the build number correctly).
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of software