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-4741] Crash: no other types should differ by abstraction #47318

Closed
dabrahams opened this issue Apr 29, 2017 · 6 comments
Closed

[SR-4741] Crash: no other types should differ by abstraction #47318

dabrahams opened this issue Apr 29, 2017 · 6 comments
Assignees
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 SILGen Area → compiler: The SIL generation stage

Comments

@dabrahams
Copy link
Collaborator

Previous ID SR-4741
Radar rdar://problem/31906258
Original Reporter @dabrahams
Type Bug
Status Resolved
Resolution Won't Do

Attachment: Download

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

md5: c32440f480f24c594b2c37b2a1acdc77

Issue Description:

Against 8ecc3e3 from github/master, build the attached for this assertion

xcrun --toolchain default --sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk /Users/Shared/dabrahams/s/build/Ninja-ReleaseAssert+stdlib-DebugAssert/swift-macosx-x86_64/./bin/swiftc -target x86_64-apple-macosx10.9  -module-cache-path '/var/folders/8v/9769m3ps7ds7h9pg23lzcls00000gn/T/swift-testsuite-clang-module-cacherClZu6' -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/../../../Developer/Library/Frameworks -Xlinker -rpath -Xlinker /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/../../../Developer/Library/Frameworks  -swift-version 3  /Users/Shared/dabrahams/s/swift/test/Prototypes/UnicodeDecoders.swift -swift-version 4 -g -Onone -o /Users/Shared/dabrahams/s/build/Ninja-ReleaseAssert+stdlib-DebugAssert/swift-macosx-x86_64/test-macosx-x86_64/Prototypes/Output/UnicodeDecoders && /Users/Shared/dabrahams/s/build/Ninja-ReleaseAssert+stdlib-DebugAssert/swift-macosx-x86_64/test-macosx-x86_64/Prototypes/Output/UnicodeDecoders
no other types should differ by abstraction
UNREACHABLE executed at /Users/Shared/dabrahams/s/swift/lib/SIL/SILType.cpp:692!
0  swift                    0x000000010bb8cab8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  swift                    0x000000010bb8d166 SignalHandler(int) + 454
2  libsystem_platform.dylib 0x00007fffc8943b3a _sigtramp + 26
3  libsystem_platform.dylib 0x00000000000002b4 _sigtramp + 929810324
4  libsystem_c.dylib        0x00007fffc87c8420 abort + 129
5  swift                    0x000000010bb2a107 llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) + 471
6  swift                    0x0000000109386a6c areOnlyAbstractionDifferent(swift::CanType, swift::CanType) + 764
7  swift                    0x00000001093866f4 swift::SILType::hasAbstractionDifference(swift::SILFunctionTypeRepresentation, swift::SILType) + 116
8  swift                    0x0000000108eafef9 (anonymous namespace)::ScalarResultPlan::finish(swift::Lowering::SILGenFunction&, swift::SILLocation, swift::CanType, llvm::ArrayRef<swift::Lowering::ManagedValue>&) + 329
9  swift                    0x0000000108ec7222 swift::Lowering::SILGenFunction::emitApply(std::__1::unique_ptr<swift::Lowering::ResultPlan, std::__1::default_delete<swift::Lowering::ResultPlan> >&&, swift::Lowering::ArgumentScope&&, swift::SILLocation, swift::Lowering::ManagedValue, llvm::ArrayRef<swift::Substitution>, llvm::ArrayRef<swift::Lowering::ManagedValue>, swift::Lowering::CalleeTypeInfo const&, swift::Lowering::ApplyOptions, swift::Lowering::SGFContext) + 4658
10 swift                    0x0000000108ec9a0d (anonymous namespace)::CallEmission::apply(swift::Lowering::SGFContext) + 3597
11 swift                    0x0000000108ed076d swift::Lowering::SILGenFunction::emitGetAccessor(swift::SILLocation, swift::SILDeclRef, llvm::ArrayRef<swift::Substitution>, swift::Lowering::ArgumentSource&&, bool, bool, swift::Lowering::RValue&&, swift::Lowering::SGFContext) + 685
12 swift                    0x0000000108f44776 (anonymous namespace)::GetterSetterComponent::get(swift::Lowering::SILGenFunction&, swift::SILLocation, swift::Lowering::ManagedValue, swift::Lowering::SGFContext) && + 310
13 swift                    0x0000000108f41d33 swift::Lowering::SILGenFunction::emitLoadOfLValue(swift::SILLocation, swift::Lowering::LValue&&, swift::Lowering::SGFContext, bool) + 483
14 swift                    0x0000000108f1fbbe swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 8478
15 swift                    0x0000000108f19839 swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 57
16 swift                    0x0000000108f3a8c3 SILGenLValue::visitRec(swift::Expr*, swift::AccessKind, swift::Lowering::AbstractionPattern) + 883
17 swift                    0x0000000108f3ce0f SILGenLValue::visitMemberRefExpr(swift::MemberRefExpr*, swift::AccessKind) + 223
18 swift                    0x0000000108f39ea5 swift::ASTVisitor<SILGenLValue, swift::Lowering::LValue, void, void, void, void, void, swift::AccessKind>::visit(swift::Expr*, swift::AccessKind) + 357
19 swift                    0x0000000108f39c45 swift::Lowering::SILGenFunction::emitLValue(swift::Expr*, swift::AccessKind) + 101
20 swift                    0x0000000108f22d7a swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 21210
21 swift                    0x0000000108f1e4b0 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 2576
22 swift                    0x0000000108f19839 swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 57
23 swift                    0x0000000108edd91f (anonymous namespace)::ArgEmitter::emit(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 2959
24 swift                    0x0000000108edc364 (anonymous namespace)::CallSite::emit(swift::Lowering::SILGenFunction&, swift::Lowering::AbstractionPattern, (anonymous namespace)::ParamLowering&, llvm::SmallVectorImpl<swift::Lowering::ManagedValue>&, llvm::SmallVectorImpl<(anonymous namespace)::DelayedArgument>&, llvm::Optional<swift::ForeignErrorConvention> const&, swift::ImportAsMemberStatus const&) && + 452
25 swift                    0x0000000108edbbb8 (anonymous namespace)::CallEmission::emitArgumentsForNormalApply(swift::CanTypeWrapper<swift::FunctionType>&, swift::Lowering::AbstractionPattern&, swift::CanTypeWrapper<swift::SILFunctionType>&, llvm::Optional<swift::ForeignErrorConvention>&, swift::ImportAsMemberStatus&, swift::Lowering::ApplyOptions&, llvm::SmallVectorImpl<swift::Lowering::ManagedValue>&, llvm::Optional<swift::SILLocation>&, swift::CanTypeWrapper<swift::FunctionType>&) + 2232
26 swift                    0x0000000108ec9935 (anonymous namespace)::CallEmission::apply(swift::Lowering::SGFContext) + 3381
27 swift                    0x0000000108ec86b3 swift::Lowering::SILGenFunction::emitApplyExpr(swift::Expr*, swift::Lowering::SGFContext) + 51
28 swift                    0x0000000108f1daf4 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 84
29 swift                    0x0000000108f19839 swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 57
30 swift                    0x0000000108edd91f (anonymous namespace)::ArgEmitter::emit(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 2959
31 swift                    0x0000000108edc364 (anonymous namespace)::CallSite::emit(swift::Lowering::SILGenFunction&, swift::Lowering::AbstractionPattern, (anonymous namespace)::ParamLowering&, llvm::SmallVectorImpl<swift::Lowering::ManagedValue>&, llvm::SmallVectorImpl<(anonymous namespace)::DelayedArgument>&, llvm::Optional<swift::ForeignErrorConvention> const&, swift::ImportAsMemberStatus const&) && + 452
32 swift                    0x0000000108edbbb8 (anonymous namespace)::CallEmission::emitArgumentsForNormalApply(swift::CanTypeWrapper<swift::FunctionType>&, swift::Lowering::AbstractionPattern&, swift::CanTypeWrapper<swift::SILFunctionType>&, llvm::Optional<swift::ForeignErrorConvention>&, swift::ImportAsMemberStatus&, swift::Lowering::ApplyOptions&, llvm::SmallVectorImpl<swift::Lowering::ManagedValue>&, llvm::Optional<swift::SILLocation>&, swift::CanTypeWrapper<swift::FunctionType>&) + 2232
33 swift                    0x0000000108ec9935 (anonymous namespace)::CallEmission::apply(swift::Lowering::SGFContext) + 3381
34 swift                    0x0000000108ec86b3 swift::Lowering::SILGenFunction::emitApplyExpr(swift::Expr*, swift::Lowering::SGFContext) + 51
35 swift                    0x0000000108f1daf4 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 84
36 swift                    0x0000000108f149f3 swift::Lowering::SILGenFunction::emitRValue(swift::Expr*, swift::Lowering::SGFContext) + 35
37 swift                    0x0000000108f0528b swift::Lowering::SILGenFunction::emitStmtCondition(llvm::MutableArrayRef<swift::StmtConditionElement>, swift::Lowering::JumpDest, swift::SILLocation) + 763
38 swift                    0x0000000108f789ec swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) + 6444
39 swift                    0x0000000108f77210 swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) + 336
40 swift                    0x0000000108f770b5 swift::Lowering::SILGenFunction::emitStmt(swift::Stmt*) + 21
41 swift                    0x0000000108f3289f swift::Lowering::SILGenFunction::emitFunction(swift::FuncDecl*) + 447
42 swift                    0x0000000108ec36df swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*)::$_1::operator()(swift::SILFunction*) const + 223
43 swift                    0x0000000108ebb79f swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*) + 607
44 swift                    0x0000000108f828a0 swift::ASTVisitor<SILGenExtension, void, void, void, void, void, void>::visit(swift::Decl*) + 224
45 swift                    0x0000000108f80d1b SILGenExtension::emitExtension(swift::ExtensionDecl*) + 59
46 swift                    0x0000000108f80cd5 swift::Lowering::SILGenModule::visitExtensionDecl(swift::ExtensionDecl*) + 21
47 swift                    0x0000000108ec015b swift::Lowering::SILGenModule::emitSourceFile(swift::SourceFile*, unsigned int) + 843
48 swift                    0x0000000108ec10de swift::SILModule::constructSIL(swift::ModuleDecl*, swift::SILOptions&, swift::FileUnit*, llvm::Optional<unsigned int>, bool, bool) + 958
49 swift                    0x0000000108ec1644 swift::performSILGeneration(swift::FileUnit&, swift::SILOptions&, llvm::Optional<unsigned int>, bool) + 116
50 swift                    0x00000001087ea25a performCompile(std::__1::unique_ptr<swift::CompilerInstance, std::__1::default_delete<swift::CompilerInstance> >&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 7626
51 swift                    0x00000001087e73c4 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3204
52 swift                    0x00000001087a3bb0 main + 3312
53 libdyld.dylib            0x00007fffc8734235 start + 1
54 libdyld.dylib            0x000000000000001a start + 931970534
Stack dump:
0.  Program arguments: /Users/Shared/dabrahams/s/build/Ninja-ReleaseAssert+stdlib-DebugAssert/swift-macosx-x86_64/bin/swift -frontend -c -primary-file /Users/Shared/dabrahams/s/swift/test/Prototypes/UnicodeDecoders.swift -target x86_64-apple-macosx10.9 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/../../../Developer/Library/Frameworks -g -module-cache-path /var/folders/8v/9769m3ps7ds7h9pg23lzcls00000gn/T/swift-testsuite-clang-module-cacherClZu6 -swift-version 4 -emit-module-doc-path /var/folders/8v/9769m3ps7ds7h9pg23lzcls00000gn/T/UnicodeDecoders-ed0ca3.swiftdoc -Onone -module-name UnicodeDecoders -emit-module-path /var/folders/8v/9769m3ps7ds7h9pg23lzcls00000gn/T/UnicodeDecoders-ed0ca3.swiftmodule -o /var/folders/8v/9769m3ps7ds7h9pg23lzcls00000gn/T/UnicodeDecoders-ed0ca3.o 
1.  While emitting SIL for 'parseScalar' at /Users/Shared/dabrahams/s/swift/test/Prototypes/UnicodeDecoders.swift:527:19

Other hashes

clang                              e6d55005e6 Merge remote-tracking branch 'origin/swift-4.0-branch' into stable
cmark                              d875488 Merge pull request #&#8203;4 from llvm-beanz/generate-cmark-exports
compiler-rt                        3acb58590 Merge remote-tracking branch 'origin/swift-4.0-branch' into stable
llbuild                            7853943 Merge pull request #&#8203;143 from neonichu/better-diagnostics-for-dependency-cycles
lldb                               6deeb29d5 Merge branch 'swift-4.0-branch' into stable
llvm                               8758fc3e9cc Merge remote-tracking branch 'origin/swift-4.0-branch' into stable
Traceback (most recent call last):
@dabrahams
Copy link
Collaborator Author

@swift-ci create

@dabrahams
Copy link
Collaborator Author

Upgrading to blocker 🙁

@dabrahams
Copy link
Collaborator Author

Downgrading from blocker 🙂

@dabrahams
Copy link
Collaborator Author

It's back, at least temporarily 🙁

@dabrahams
Copy link
Collaborator Author

It was temporary 🙂

@jckarter
Copy link
Member

With master, the attached file gives errors:

/Users/jgroff/Downloads/UnicodeDecoders-2.swift:224:13: error: '_Element' is not a member type of 'C'
  ) where C._Element == Element {
          ~ ^
Swift._IndexableBase:3:22: note: did you mean '_Element'?
    public typealias _Element = Self.Element
                     ^
Swift.Sequence:117:20: note: did you mean 'Element'?
    associatedtype Element where Self.Element == Self.Iterator.Element
                   ^
Swift._IndexableBase:28:20: note: did you mean 'Element'?
    associatedtype Element
                   ^
/Users/jgroff/Downloads/UnicodeDecoders-2.swift:229:36: error: missing argument label 'containing:' in call
    let replacement1 = _UIntBuffer(replacement)
                                   ^
                                   containing: 

Is this still relevant?

@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 SILGen Area → compiler: The SIL generation stage
Projects
None yet
Development

No branches or pull requests

3 participants