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

Assertion failed: ((!F || opTI->isABICompatibleWith(resTI, *F).isCompatible()) && "Can not convert in between ABI incompatible function types"), function create, file SILInstructions.cpp, line 2649. #71798

Closed
vanvoorden opened this issue Feb 22, 2024 · 4 comments
Assignees
Labels
assertion failure Bug → crash: An assertion failure bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself crash Bug: A crash, i.e., an abnormal termination of software duplicate Resolution: Duplicates another issue function types Feature → types: function types generics Feature: generic declarations and types implicit conversions Feature: implicit conversions opaque result types Feature → types → opaque types: opaque result types opaque types Feature → types: opaque types SILGen Area → compiler: The SIL generation stage swift 5.10 types Feature: types

Comments

@vanvoorden
Copy link
Contributor

Description

No response

Reproduction

This code compiles on 5.9.2:

protocol P {
}

struct S: P{
}

extension S {
  static func f() -> (Self) -> (some P) {
    let fn: (Self) -> Self = { $0 }
    return fn
  }
}

This code crashes on 5.10:

Assertion failed: ((!F || opTI->isABICompatibleWith(resTI, *F).isCompatible()) && "Can not convert in between ABI incompatible function types"), function create, file SILInstructions.cpp, line 2649.
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0.	Program arguments: [...]
1.	Apple Swift version 5.10-dev (LLVM 7c3b53ecaad54fb, Swift d7111290a279135)
2.	Compiling with the current language version
3.	While evaluating request ASTLoweringRequest(Lowering AST to SIL for file "/Users/rick/Desktop/OpaqueDemo/Sources/main.swift")
4.	While silgen emitFunction SIL function "@$s10OpaqueDemo1SV1fQrACcyFZ".
 for 'f()' (at /Users/rick/Desktop/OpaqueDemo/Sources/main.swift:10:3)
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           0x0000000109b69528 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  swift-frontend           0x0000000109b68914 llvm::sys::RunSignalHandlers() + 112
2  swift-frontend           0x0000000109b69b64 SignalHandler(int) + 304
3  libsystem_platform.dylib 0x0000000182951a24 _sigtramp + 56
4  libsystem_pthread.dylib  0x0000000182921cc0 pthread_kill + 288
5  libsystem_c.dylib        0x000000018282da40 abort + 180
6  libsystem_c.dylib        0x000000018282cd30 err + 0
7  swift-frontend           0x0000000109e7c744 swift::ConvertFunctionInst::create(swift::SILDebugLocation, swift::SILValue, swift::SILType, swift::SILModule&, swift::SILFunction*, bool, swift::ValueOwnershipKind) (.cold.4) + 0
8  swift-frontend           0x0000000105ae5154 swift::ConvertFunctionInst::create(swift::SILDebugLocation, swift::SILValue, swift::SILType, swift::SILModule&, swift::SILFunction*, bool, swift::ValueOwnershipKind) + 440
9  swift-frontend           0x000000010549a180 swift::SILBuilder::createConvertFunction(swift::SILLocation, swift::SILValue, swift::SILType, bool) + 132
10 swift-frontend           0x0000000105a8db58 swift::SILBuilder::createUncheckedReinterpretCast(swift::SILLocation, swift::SILValue, swift::SILType) + 496
11 swift-frontend           0x000000010531e290 swift::Lowering::SILGenBuilder::createUncheckedBitCast(swift::SILLocation, swift::Lowering::ManagedValue, swift::SILType) + 84
12 swift-frontend           0x000000010535ced4 (anonymous namespace)::RValueEmitter::visitUnderlyingToOpaqueExpr(swift::UnderlyingToOpaqueExpr*, swift::Lowering::SGFContext) + 944
13 swift-frontend           0x00000001053483d8 swift::Lowering::SILGenFunction::emitRValue(swift::Expr*, swift::Lowering::SGFContext) + 40
14 swift-frontend           0x00000001053c6d70 swift::Lowering::SILGenFunction::emitReturnExpr(swift::SILLocation, swift::Expr*) + 496
15 swift-frontend           0x00000001053c5200 swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) + 5740
16 swift-frontend           0x00000001053c4c8c swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) + 4344
17 swift-frontend           0x00000001053c3b88 swift::Lowering::SILGenFunction::emitStmt(swift::Stmt*) + 24
18 swift-frontend           0x000000010536aca0 swift::Lowering::SILGenFunction::emitFunction(swift::FuncDecl*) + 380
19 swift-frontend           0x00000001052e9c7c swift::Lowering::SILGenModule::emitFunctionDefinition(swift::SILDeclRef, swift::SILFunction*) + 6064
20 swift-frontend           0x00000001052ea918 swift::Lowering::SILGenModule::emitOrDelayFunction(swift::SILDeclRef) + 204
21 swift-frontend           0x00000001052e84b4 swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*) + 164
22 swift-frontend           0x00000001053d4bb8 SILGenExtension::visitFuncDecl(swift::FuncDecl*) + 172
23 swift-frontend           0x00000001053d0ee8 SILGenExtension::emitExtension(swift::ExtensionDecl*) + 132
24 swift-frontend           0x00000001053d0e58 swift::Lowering::SILGenModule::visitExtensionDecl(swift::ExtensionDecl*) + 24
25 swift-frontend           0x00000001052ecf68 swift::ASTLoweringRequest::evaluate(swift::Evaluator&, swift::ASTLoweringDescriptor) const + 984
26 swift-frontend           0x00000001053c35e0 swift::SimpleRequest<swift::ASTLoweringRequest, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>> (swift::ASTLoweringDescriptor), (swift::RequestFlags)9>::evaluateRequest(swift::ASTLoweringRequest const&, swift::Evaluator&) + 148
27 swift-frontend           0x00000001052f02c8 llvm::Expected<swift::ASTLoweringRequest::OutputType> swift::Evaluator::getResultUncached<swift::ASTLoweringRequest>(swift::ASTLoweringRequest const&) + 396
28 swift-frontend           0x00000001052ed8bc swift::performASTLowering(swift::FileUnit&, swift::Lowering::TypeConverter&, swift::SILOptions const&, swift::IRGenOptions const*) + 92
29 swift-frontend           0x0000000104d3abd0 swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 572
30 swift-frontend           0x0000000104d4ad08 withSemanticAnalysis(swift::CompilerInstance&, swift::FrontendObserver*, llvm::function_ref<bool (swift::CompilerInstance&)>, bool) + 160
31 swift-frontend           0x0000000104d3d00c performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 748
32 swift-frontend           0x0000000104d3c07c swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2096
33 swift-frontend           0x0000000104c04498 swift::mainEntry(int, char const**) + 2160
34 dyld                     0x00000001825a10e0 start + 2360

And 5.11:

Assertion failed: ((!F || opTI->isABICompatibleWith(resTI, *F).isCompatible()) && "Can not convert in between ABI incompatible function types"), function create, file SILInstructions.cpp, line 2724.
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0.	Program arguments: [...]
1.	Apple Swift version 5.11-dev (LLVM 48dba337c6a2104, Swift 823db1fc0821481)
2.	Compiling with the current language version
3.	While evaluating request ASTLoweringRequest(Lowering AST to SIL for file "/Users/rick/Desktop/OpaqueDemo/Sources/main.swift")
4.	While silgen emitFunction SIL function "@$s10OpaqueDemo1SV1fQrACcyFZ".
 for 'f()' (at /Users/rick/Desktop/OpaqueDemo/Sources/main.swift:10:3)
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           0x0000000105b69420 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  swift-frontend           0x0000000105b67bec llvm::sys::RunSignalHandlers() + 112
2  swift-frontend           0x0000000105b69a68 SignalHandler(int) + 304
3  libsystem_platform.dylib 0x0000000182951a24 _sigtramp + 56
4  libsystem_pthread.dylib  0x0000000182921cc0 pthread_kill + 288
5  libsystem_c.dylib        0x000000018282da40 abort + 180
6  libsystem_c.dylib        0x000000018282cd30 err + 0
7  swift-frontend           0x0000000105e94e6c swift::ConvertFunctionInst::create(swift::SILDebugLocation, swift::SILValue, swift::SILType, swift::SILModule&, swift::SILFunction*, bool, swift::ValueOwnershipKind) (.cold.4) + 0
8  swift-frontend           0x00000001015d15cc swift::ConvertFunctionInst::create(swift::SILDebugLocation, swift::SILValue, swift::SILType, swift::SILModule&, swift::SILFunction*, bool, swift::ValueOwnershipKind) + 456
9  swift-frontend           0x0000000100f61758 swift::SILBuilder::createConvertFunction(swift::SILLocation, swift::SILValue, swift::SILType, bool) + 132
10 swift-frontend           0x0000000101573638 swift::SILBuilder::createUncheckedReinterpretCast(swift::SILLocation, swift::SILValue, swift::SILType) + 536
11 swift-frontend           0x0000000100db64ec swift::Lowering::SILGenBuilder::createUncheckedBitCast(swift::SILLocation, swift::Lowering::ManagedValue, swift::SILType) + 100
12 swift-frontend           0x0000000100df8e7c (anonymous namespace)::RValueEmitter::visitUnderlyingToOpaqueExpr(swift::UnderlyingToOpaqueExpr*, swift::Lowering::SGFContext) + 960
13 swift-frontend           0x0000000100de3404 swift::Lowering::SILGenFunction::emitRValue(swift::Expr*, swift::Lowering::SGFContext) + 40
14 swift-frontend           0x0000000100e69578 swift::Lowering::SILGenFunction::emitReturnExpr(swift::SILLocation, swift::Expr*) + 496
15 swift-frontend           0x0000000100e678dc swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) + 6244
16 swift-frontend           0x0000000100e671c8 swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) + 4432
17 swift-frontend           0x0000000100e6606c swift::Lowering::SILGenFunction::emitStmt(swift::Stmt*) + 24
18 swift-frontend           0x0000000100e07378 swift::Lowering::SILGenFunction::emitFunction(swift::FuncDecl*) + 460
19 swift-frontend           0x0000000100d7e1bc swift::Lowering::SILGenModule::emitFunctionDefinition(swift::SILDeclRef, swift::SILFunction*) + 6228
20 swift-frontend           0x0000000100d7eeb4 swift::Lowering::SILGenModule::emitOrDelayFunction(swift::SILDeclRef) + 252
21 swift-frontend           0x0000000100d7c930 swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*) + 196
22 swift-frontend           0x0000000100e7ba6c SILGenExtension::visitFuncDecl(swift::FuncDecl*) + 172
23 swift-frontend           0x0000000100e77d30 SILGenExtension::emitExtension(swift::ExtensionDecl*) + 120
24 swift-frontend           0x0000000100e77cac swift::Lowering::SILGenModule::visitExtensionDecl(swift::ExtensionDecl*) + 24
25 swift-frontend           0x0000000100d8183c swift::ASTLoweringRequest::evaluate(swift::Evaluator&, swift::ASTLoweringDescriptor) const + 904
26 swift-frontend           0x0000000100e65ac4 swift::SimpleRequest<swift::ASTLoweringRequest, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>> (swift::ASTLoweringDescriptor), (swift::RequestFlags)9>::evaluateRequest(swift::ASTLoweringRequest const&, swift::Evaluator&) + 148
27 swift-frontend           0x0000000100d86e30 swift::ASTLoweringRequest::OutputType swift::Evaluator::getResultUncached<swift::ASTLoweringRequest, swift::ASTLoweringRequest::OutputType swift::evaluateOrFatal<swift::ASTLoweringRequest>(swift::Evaluator&, swift::ASTLoweringRequest)::'lambda'()>(swift::ASTLoweringRequest const&, swift::ASTLoweringRequest::OutputType swift::evaluateOrFatal<swift::ASTLoweringRequest>(swift::Evaluator&, swift::ASTLoweringRequest)::'lambda'()) + 340
28 swift-frontend           0x0000000100d82140 swift::performASTLowering(swift::FileUnit&, swift::Lowering::TypeConverter&, swift::SILOptions const&, swift::IRGenOptions const*) + 96
29 swift-frontend           0x0000000100786eac swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 580
30 swift-frontend           0x0000000100797ad4 withSemanticAnalysis(swift::CompilerInstance&, swift::FrontendObserver*, llvm::function_ref<bool (swift::CompilerInstance&)>, bool) + 160
31 swift-frontend           0x00000001007893f8 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 708
32 swift-frontend           0x0000000100788454 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2336
33 swift-frontend           0x00000001005c21d0 swift::mainEntry(int, char const**) + 3096
34 dyld                     0x00000001825a10e0 start + 2360
Command SwiftCompile failed with a nonzero exit code

Stack dump

Assertion failed: ((!F || opTI->isABICompatibleWith(resTI, *F).isCompatible()) && "Can not convert in between ABI incompatible function types"), function create, file SILInstructions.cpp, line 2649.
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0.	Program arguments: /Library/Developer/Toolchains/swift-5.10-DEVELOPMENT-SNAPSHOT-2024-02-17-a.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /Users/rick/Desktop/OpaqueDemo/Sources/main.swift -emit-dependencies-path /Users/rick/Library/Developer/Xcode/DerivedData/OpaqueDemo-fvajqiamgzepesegqmkfjlwkzhmg/Build/Intermediates.noindex/OpaqueDemo.build/Debug/OpaqueDemo.build/Objects-normal/arm64/main.d -emit-const-values-path /Users/rick/Library/Developer/Xcode/DerivedData/OpaqueDemo-fvajqiamgzepesegqmkfjlwkzhmg/Build/Intermediates.noindex/OpaqueDemo.build/Debug/OpaqueDemo.build/Objects-normal/arm64/main.swiftconstvalues -emit-reference-dependencies-path /Users/rick/Library/Developer/Xcode/DerivedData/OpaqueDemo-fvajqiamgzepesegqmkfjlwkzhmg/Build/Intermediates.noindex/OpaqueDemo.build/Debug/OpaqueDemo.build/Objects-normal/arm64/main.swiftdeps -serialize-diagnostics-path /Users/rick/Library/Developer/Xcode/DerivedData/OpaqueDemo-fvajqiamgzepesegqmkfjlwkzhmg/Build/Intermediates.noindex/OpaqueDemo.build/Debug/OpaqueDemo.build/Objects-normal/arm64/main.dia -target arm64-apple-macos14.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -I /Users/rick/Library/Developer/Xcode/DerivedData/OpaqueDemo-fvajqiamgzepesegqmkfjlwkzhmg/Build/Products/Debug -I /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -F /Users/rick/Library/Developer/Xcode/DerivedData/OpaqueDemo-fvajqiamgzepesegqmkfjlwkzhmg/Build/Products/Debug -F /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -no-color-diagnostics -enable-testing -g -module-cache-path /Users/rick/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 5 -enforce-exclusivity=checked -Onone -D SWIFT_PACKAGE -D DEBUG -D Xcode -external-plugin-path /Applications/Xcode_15.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins#/Applications/Xcode_15.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode_15.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins#/Applications/Xcode_15.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-plugin-server -serialize-debugging-options -package-name opaquedemo -const-gather-protocols-file /Users/rick/Library/Developer/Xcode/DerivedData/OpaqueDemo-fvajqiamgzepesegqmkfjlwkzhmg/Build/Intermediates.noindex/OpaqueDemo.build/Debug/OpaqueDemo.build/Objects-normal/arm64/OpaqueDemo_const_extract_protocols.json -empty-abi-descriptor -validate-clang-modules-once -clang-build-session-file /Users/rick/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -Xcc -working-directory -Xcc /Users/rick/Desktop/OpaqueDemo -resource-dir /Library/Developer/Toolchains/swift-5.10-DEVELOPMENT-SNAPSHOT-2024-02-17-a.xctoolchain/usr/lib/swift -enable-anonymous-context-mangled-names -Xcc -I/Users/rick/Library/Developer/Xcode/DerivedData/OpaqueDemo-fvajqiamgzepesegqmkfjlwkzhmg/Build/Products/Debug/include -Xcc -I/Users/rick/Library/Developer/Xcode/DerivedData/OpaqueDemo-fvajqiamgzepesegqmkfjlwkzhmg/Build/Intermediates.noindex/OpaqueDemo.build/Debug/OpaqueDemo.build/DerivedSources-normal/arm64 -Xcc -I/Users/rick/Library/Developer/Xcode/DerivedData/OpaqueDemo-fvajqiamgzepesegqmkfjlwkzhmg/Build/Intermediates.noindex/OpaqueDemo.build/Debug/OpaqueDemo.build/DerivedSources/arm64 -Xcc -I/Users/rick/Library/Developer/Xcode/DerivedData/OpaqueDemo-fvajqiamgzepesegqmkfjlwkzhmg/Build/Intermediates.noindex/OpaqueDemo.build/Debug/OpaqueDemo.build/DerivedSources -Xcc -DSWIFT_PACKAGE -Xcc -DDEBUG=1 -module-name OpaqueDemo -frontend-parseable-output -disable-clang-spi -target-sdk-version 14.2 -target-sdk-name macosx14.2 -external-plugin-path /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/lib/swift/host/plugins#/Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/local/lib/swift/host/plugins#/Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -plugin-path /Library/Developer/Toolchains/swift-5.10-DEVELOPMENT-SNAPSHOT-2024-02-17-a.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Library/Developer/Toolchains/swift-5.10-DEVELOPMENT-SNAPSHOT-2024-02-17-a.xctoolchain/usr/local/lib/swift/host/plugins -o /Users/rick/Library/Developer/Xcode/DerivedData/OpaqueDemo-fvajqiamgzepesegqmkfjlwkzhmg/Build/Intermediates.noindex/OpaqueDemo.build/Debug/OpaqueDemo.build/Objects-normal/arm64/main.o -index-unit-output-path /OpaqueDemo.build/Debug/OpaqueDemo.build/Objects-normal/arm64/main.o -index-store-path /Users/rick/Library/Developer/Xcode/DerivedData/OpaqueDemo-fvajqiamgzepesegqmkfjlwkzhmg/Index.noindex/DataStore -index-system-modules
1.	Apple Swift version 5.10-dev (LLVM 7c3b53ecaad54fb, Swift d7111290a279135)
2.	Compiling with the current language version
3.	While evaluating request ASTLoweringRequest(Lowering AST to SIL for file "/Users/rick/Desktop/OpaqueDemo/Sources/main.swift")
4.	While silgen emitFunction SIL function "@$s10OpaqueDemo1SV1fQrACcyFZ".
 for 'f()' (at /Users/rick/Desktop/OpaqueDemo/Sources/main.swift:10:3)
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           0x0000000105801528 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  swift-frontend           0x0000000105800914 llvm::sys::RunSignalHandlers() + 112
2  swift-frontend           0x0000000105801b64 SignalHandler(int) + 304
3  libsystem_platform.dylib 0x0000000182951a24 _sigtramp + 56
4  libsystem_pthread.dylib  0x0000000182921cc0 pthread_kill + 288
5  libsystem_c.dylib        0x000000018282da40 abort + 180
6  libsystem_c.dylib        0x000000018282cd30 err + 0
7  swift-frontend           0x0000000105b14744 swift::ConvertFunctionInst::create(swift::SILDebugLocation, swift::SILValue, swift::SILType, swift::SILModule&, swift::SILFunction*, bool, swift::ValueOwnershipKind) (.cold.4) + 0
8  swift-frontend           0x000000010177d154 swift::ConvertFunctionInst::create(swift::SILDebugLocation, swift::SILValue, swift::SILType, swift::SILModule&, swift::SILFunction*, bool, swift::ValueOwnershipKind) + 440
9  swift-frontend           0x0000000101132180 swift::SILBuilder::createConvertFunction(swift::SILLocation, swift::SILValue, swift::SILType, bool) + 132
10 swift-frontend           0x0000000101725b58 swift::SILBuilder::createUncheckedReinterpretCast(swift::SILLocation, swift::SILValue, swift::SILType) + 496
11 swift-frontend           0x0000000100fb6290 swift::Lowering::SILGenBuilder::createUncheckedBitCast(swift::SILLocation, swift::Lowering::ManagedValue, swift::SILType) + 84
12 swift-frontend           0x0000000100ff4ed4 (anonymous namespace)::RValueEmitter::visitUnderlyingToOpaqueExpr(swift::UnderlyingToOpaqueExpr*, swift::Lowering::SGFContext) + 944
13 swift-frontend           0x0000000100fe03d8 swift::Lowering::SILGenFunction::emitRValue(swift::Expr*, swift::Lowering::SGFContext) + 40
14 swift-frontend           0x000000010105ed70 swift::Lowering::SILGenFunction::emitReturnExpr(swift::SILLocation, swift::Expr*) + 496
15 swift-frontend           0x000000010105d200 swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) + 5740
16 swift-frontend           0x000000010105cc8c swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) + 4344
17 swift-frontend           0x000000010105bb88 swift::Lowering::SILGenFunction::emitStmt(swift::Stmt*) + 24
18 swift-frontend           0x0000000101002ca0 swift::Lowering::SILGenFunction::emitFunction(swift::FuncDecl*) + 380
19 swift-frontend           0x0000000100f81c7c swift::Lowering::SILGenModule::emitFunctionDefinition(swift::SILDeclRef, swift::SILFunction*) + 6064
20 swift-frontend           0x0000000100f82918 swift::Lowering::SILGenModule::emitOrDelayFunction(swift::SILDeclRef) + 204
21 swift-frontend           0x0000000100f804b4 swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*) + 164
22 swift-frontend           0x000000010106cbb8 SILGenExtension::visitFuncDecl(swift::FuncDecl*) + 172
23 swift-frontend           0x0000000101068ee8 SILGenExtension::emitExtension(swift::ExtensionDecl*) + 132
24 swift-frontend           0x0000000101068e58 swift::Lowering::SILGenModule::visitExtensionDecl(swift::ExtensionDecl*) + 24
25 swift-frontend           0x0000000100f84f68 swift::ASTLoweringRequest::evaluate(swift::Evaluator&, swift::ASTLoweringDescriptor) const + 984
26 swift-frontend           0x000000010105b5e0 swift::SimpleRequest<swift::ASTLoweringRequest, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>> (swift::ASTLoweringDescriptor), (swift::RequestFlags)9>::evaluateRequest(swift::ASTLoweringRequest const&, swift::Evaluator&) + 148
27 swift-frontend           0x0000000100f882c8 llvm::Expected<swift::ASTLoweringRequest::OutputType> swift::Evaluator::getResultUncached<swift::ASTLoweringRequest>(swift::ASTLoweringRequest const&) + 396
28 swift-frontend           0x0000000100f858bc swift::performASTLowering(swift::FileUnit&, swift::Lowering::TypeConverter&, swift::SILOptions const&, swift::IRGenOptions const*) + 92
29 swift-frontend           0x00000001009d2bd0 swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 572
30 swift-frontend           0x00000001009e2d08 withSemanticAnalysis(swift::CompilerInstance&, swift::FrontendObserver*, llvm::function_ref<bool (swift::CompilerInstance&)>, bool) + 160
31 swift-frontend           0x00000001009d500c performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 748
32 swift-frontend           0x00000001009d407c swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2096
33 swift-frontend           0x000000010089c498 swift::mainEntry(int, char const**) + 2160
34 dyld                     0x00000001825a10e0 start + 2360

Expected behavior

no crash.

Environment

  • Apple Swift version 5.10-dev (LLVM 7c3b53ecaad54fb, Swift d711129)
  • Apple Swift version 5.11-dev (LLVM 48dba337c6a2104, Swift 823db1f)

Additional information

No response

@vanvoorden vanvoorden added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. crash Bug: A crash, i.e., an abnormal termination of software triage needed This issue needs more specific labels labels Feb 22, 2024
@vanvoorden
Copy link
Contributor Author

@slavapestov It looks like we fixed a similar issue with these opaque types for #60038. Could you think of something that landed recently that would lead to this new problem?

@slavapestov slavapestov self-assigned this Feb 23, 2024
@hborla hborla added SILGen Area → compiler: The SIL generation stage and removed triage needed This issue needs more specific labels labels Apr 27, 2024
@vanvoorden
Copy link
Contributor Author

I no longer see this crash from Xcode_16_beta_3. Looks like this has been fixed!

@AnthonyLatsis AnthonyLatsis added opaque result types Feature → types → opaque types: opaque result types generics Feature: generic declarations and types opaque types Feature → types: opaque types function types Feature → types: function types implicit conversions Feature: implicit conversions types Feature: types assertion failure Bug → crash: An assertion failure swift 5.10 compiler The Swift compiler itself duplicate Resolution: Duplicates another issue labels Jul 12, 2024
@AnthonyLatsis
Copy link
Collaborator

Interesting. This is still around on the main branch though.

@AnthonyLatsis
Copy link
Collaborator

Duplicate of #69057

@AnthonyLatsis AnthonyLatsis marked this as a duplicate of #69057 Jul 12, 2024
@AnthonyLatsis AnthonyLatsis closed this as not planned Won't fix, can't repro, duplicate, stale Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assertion failure Bug → crash: An assertion failure bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself crash Bug: A crash, i.e., an abnormal termination of software duplicate Resolution: Duplicates another issue function types Feature → types: function types generics Feature: generic declarations and types implicit conversions Feature: implicit conversions opaque result types Feature → types → opaque types: opaque result types opaque types Feature → types: opaque types SILGen Area → compiler: The SIL generation stage swift 5.10 types Feature: types
Projects
None yet
Development

No branches or pull requests

4 participants