swift icon indicating copy to clipboard operation
swift copied to clipboard

SIL Assertion failed: (SGF.ExpectedExecutor || SGF.unsafelyInheritsExecutor())

Open vsarunas opened this issue 9 months ago • 0 comments

Description

Trying out to build existing code that works on Swift 5.10 with highly Swift 6 toolchain 2024-04-30

Reproduction

There is a rather very similar crash https://github.com/apple/swift/issues/72805


Stack dump

Assertion failed: (SGF.ExpectedExecutor || SGF.unsafelyInheritsExecutor()), function emit, file SILGenConcurrency.cpp, line 650.
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0.	Program arguments: /Users/sarunas/Library/Developer/Toolchains/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-04-30-a.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /Users/sarunas/code/app/Sources/TransactionAugmentationSettlementDate/TransactionAugmentationSettlementDate.swift /Users/sarunas/code/app/Sources/TransactionAugmentationSettlementDate/TransactionAugmentationSettlementDateFactory.swift -emit-dependencies-path /Users/sarunas/Library/Developer/Xcode/DerivedData/appfimgswfnyqjezbfdpitkuujemsuz/Build/Intermediates.noindex/app.build/Debug/TransactionAugmentationSettlementDate.build/Objects-normal/arm64/TransactionAugmentationSettlementDate.d -emit-const-values-path /Users/sarunas/Library/Developer/Xcode/DerivedData/appfimgswfnyqjezbfdpitkuujemsuz/Build/Intermediates.noindex/app.build/Debug/TransactionAugmentationSettlementDate.build/Objects-normal/arm64/TransactionAugmentationSettlementDate.swiftconstvalues -emit-reference-dependencies-path /Users/sarunas/Library/Developer/Xcode/DerivedData/appfimgswfnyqjezbfdpitkuujemsuz/Build/Intermediates.noindex/app.build/Debug/TransactionAugmentationSettlementDate.build/Objects-normal/arm64/TransactionAugmentationSettlementDate.swiftdeps -serialize-diagnostics-path /Users/sarunas/Library/Developer/Xcode/DerivedData/appfimgswfnyqjezbfdpitkuujemsuz/Build/Intermediates.noindex/app.build/Debug/TransactionAugmentationSettlementDate.build/Objects-normal/arm64/TransactionAugmentationSettlementDate.dia -target arm64-apple-macos14.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode-15.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk -I /Users/sarunas/Library/Developer/Xcode/DerivedData/appfimgswfnyqjezbfdpitkuujemsuz/Build/Products/Debug -I /Applications/Xcode-15.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -F /Users/sarunas/Library/Developer/Xcode/DerivedData/appfimgswfnyqjezbfdpitkuujemsuz/Build/Products/Debug/PackageFrameworks -F /Users/sarunas/Library/Developer/Xcode/DerivedData/appfimgswfnyqjezbfdpitkuujemsuz/Build/Products/Debug/PackageFrameworks -F /Users/sarunas/Library/Developer/Xcode/DerivedData/appfimgswfnyqjezbfdpitkuujemsuz/Build/Products/Debug/PackageFrameworks -F /Users/sarunas/Library/Developer/Xcode/DerivedData/appfimgswfnyqjezbfdpitkuujemsuz/Build/Products/Debug/PackageFrameworks -F /Users/sarunas/Library/Developer/Xcode/DerivedData/appfimgswfnyqjezbfdpitkuujemsuz/Build/Products/Debug/PackageFrameworks -F /Users/sarunas/Library/Developer/Xcode/DerivedData/appfimgswfnyqjezbfdpitkuujemsuz/Build/Products/Debug/PackageFrameworks -F /Users/sarunas/Library/Developer/Xcode/DerivedData/appfimgswfnyqjezbfdpitkuujemsuz/Build/Products/Debug/PackageFrameworks -F /Users/sarunas/Library/Developer/Xcode/DerivedData/appfimgswfnyqjezbfdpitkuujemsuz/Build/Products/Debug/PackageFrameworks -F /Users/sarunas/Library/Developer/Xcode/DerivedData/appfimgswfnyqjezbfdpitkuujemsuz/Build/Products/Debug/PackageFrameworks -F /Users/sarunas/Library/Developer/Xcode/DerivedData/appfimgswfnyqjezbfdpitkuujemsuz/Build/Products/Debug/PackageFrameworks -F /Users/sarunas/Library/Developer/Xcode/DerivedData/appfimgswfnyqjezbfdpitkuujemsuz/Build/Products/Debug -F /Applications/Xcode-15.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -no-color-diagnostics -enable-testing -g -module-cache-path /Users/sarunas/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -profile-generate -profile-coverage-mapping -swift-version 5 -enforce-exclusivity=checked -Onone -D SWIFT_PACKAGE -D DEBUG -D Xcode -serialize-debugging-options -load-plugin-executable /Users/sarunas/Library/Developer/Xcode/DerivedData/appfimgswfnyqjezbfdpitkuujemsuz/Build/Products/Debug/PluginTypeMacros#PluginTypeMacros -package-name prototype_app_system_transaction_augmentation_settlement_date -const-gather-protocols-file /Users/sarunas/Library/Developer/Xcode/DerivedData/appfimgswfnyqjezbfdpitkuujemsuz/Build/Intermediates.noindex/app.build/Debug/TransactionAugmentationSettlementDate.build/Objects-normal/arm64/TransactionAugmentationSettlementDate_const_extract_protocols.json -empty-abi-descriptor -validate-clang-modules-once -clang-build-session-file /Users/sarunas/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -Xcc -working-directory -Xcc /Users/sarunas/code/app -resource-dir /Users/sarunas/Library/Developer/Toolchains/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-04-30-a.xctoolchain/usr/lib/swift -enable-anonymous-context-mangled-names -Xcc -I/Users/sarunas/Library/Developer/Xcode/DerivedData/appfimgswfnyqjezbfdpitkuujemsuz/Build/Intermediates.noindex/app.build/Debug/TransactionAugmentationSettlementDate.build/swift-overrides.hmap -Xcc -I/Users/sarunas/Library/Developer/Xcode/DerivedData/appfimgswfnyqjezbfdpitkuujemsuz/SourcePackages/checkouts/swift-atomics/Sources/_AtomicsShims/include -Xcc -I/Users/sarunas/Library/Developer/Xcode/DerivedData/appfimgswfnyqjezbfdpitkuujemsuz/SourcePackages/checkouts/swift-numerics/Sources/_NumericsShims/include -Xcc -I/Users/sarunas/Library/Developer/Xcode/DerivedData/appfimgswfnyqjezbfdpitkuujemsuz/Build/Products/Debug/include -Xcc -I/Users/sarunas/Library/Developer/Xcode/DerivedData/appfimgswfnyqjezbfdpitkuujemsuz/Build/Intermediates.noindex/app.build/Debug/TransactionAugmentationSettlementDate.build/DerivedSources-normal/arm64 -Xcc -I/Users/sarunas/Library/Developer/Xcode/DerivedData/appfimgswfnyqjezbfdpitkuujemsuz/Build/Intermediates.noindex/app.build/Debug/TransactionAugmentationSettlementDate.build/DerivedSources/arm64 -Xcc -I/Users/sarunas/Library/Developer/Xcode/DerivedData/appfimgswfnyqjezbfdpitkuujemsuz/Build/Intermediates.noindex/app.build/Debug/TransactionAugmentationSettlementDate.build/DerivedSources -Xcc -DSWIFT_PACKAGE -Xcc -DDEBUG=1 -module-name TransactionAugmentationSettlementDate -frontend-parseable-output -disable-clang-spi -target-sdk-version 14.4 -target-sdk-name macosx14.4 -external-plugin-path /Applications/Xcode-15.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/usr/lib/swift/host/plugins#/Applications/Xcode-15.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode-15.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/usr/local/lib/swift/host/plugins#/Applications/Xcode-15.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode-15.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode-15.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode-15.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode-15.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -plugin-path /Users/sarunas/Library/Developer/Toolchains/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-04-30-a.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Users/sarunas/Library/Developer/Toolchains/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-04-30-a.xctoolchain/usr/local/lib/swift/host/plugins -o /Users/sarunas/Library/Developer/Xcode/DerivedData/appfimgswfnyqjezbfdpitkuujemsuz/Build/Intermediates.noindex/app.build/Debug/TransactionAugmentationSettlementDate.build/Objects-normal/arm64/TransactionAugmentationSettlementDate.o -index-unit-output-path /app.build/Debug/TransactionAugmentationSettlementDate.build/Objects-normal/arm64/TransactionAugmentationSettlementDate.o -index-store-path /Users/sarunas/Library/Developer/Xcode/DerivedData/appfimgswfnyqjezbfdpitkuujemsuz/Index.noindex/DataStore -index-system-modules
1.	Apple Swift version 6.0-dev (LLVM 7b8e6346027d2b1, Swift 763421cee31dc8f)
2.	Compiling with effective version 5.10
3.	While evaluating request ASTLoweringRequest(Lowering AST to SIL for file "/Users/sarunas/code/app/Sources/TransactionAugmentationSettlementDate/TransactionAugmentationSettlementDate.swift")
4.	While silgen constructor initializer SIL function "@$s37TransactionAugmentationSettlementDateAAC4withAB10OrdoPublic0B13PluginContext_p_tYaKcfc".
 for 'init(with:)' (at /Users/sarunas/code/app/Sources/TransactionAugmentationSettlementDate/TransactionAugmentationSettlementDate.swift:47:12)
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           0x0000000105f053b4 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  swift-frontend           0x0000000105f03b80 llvm::sys::RunSignalHandlers() + 112
2  swift-frontend           0x0000000105f059fc SignalHandler(int) + 304
3  libsystem_platform.dylib 0x0000000193dcf584 _sigtramp + 56
4  libsystem_pthread.dylib  0x0000000193d9ec20 pthread_kill + 288
5  libsystem_c.dylib        0x0000000193caba20 abort + 180
6  libsystem_c.dylib        0x0000000193caad10 err + 0
7  swift-frontend           0x00000001060102bc swift::Lowering::SILGenFunction::emitGetCurrentExecutor(swift::SILLocation) (.cold.1) + 0
8  swift-frontend           0x00000001010eba38 swift::Lowering::ExecutorBreadcrumb::emit(swift::Lowering::SILGenFunction&, swift::SILLocation) + 168
9  swift-frontend           0x00000001010b4218 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, swift::SubstitutionMap, llvm::ArrayRef<swift::Lowering::ManagedValue>, swift::Lowering::CalleeTypeInfo const&, swift::optionset::OptionSet<swift::ApplyFlags, unsigned char>, swift::Lowering::SGFContext, std::__1::optional<swift::ActorIsolation>) + 1768
10 swift-frontend           0x00000001010b9598 (anonymous namespace)::CallEmission::apply(swift::Lowering::SGFContext) + 2028
11 swift-frontend           0x00000001010b7b48 swift::Lowering::SILGenFunction::emitApplyExpr(swift::ApplyExpr*, swift::Lowering::SGFContext) + 2028
12 swift-frontend           0x0000000101129ec0 void llvm::function_ref<void (swift::Expr*)>::callback_fn<swift::Lowering::RValue swift::Lowering::SILGenFunction::emitOpenExistentialExpr<swift::Lowering::RValue, (anonymous namespace)::RValueEmitter::visitOpenExistentialExpr(swift::OpenExistentialExpr*, swift::Lowering::SGFContext)::$_21>(swift::OpenExistentialExpr*, (anonymous namespace)::RValueEmitter::visitOpenExistentialExpr(swift::OpenExistentialExpr*, swift::Lowering::SGFContext)::$_21)::'lambda'(swift::Expr*)>(long, swift::Expr*) + 36
13 swift-frontend           0x0000000101117f80 swift::Lowering::SILGenFunction::emitOpenExistentialExprImpl(swift::OpenExistentialExpr*, llvm::function_ref<void (swift::Expr*)>) + 380
14 swift-frontend           0x0000000101121190 (anonymous namespace)::RValueEmitter::visitOpenExistentialExpr(swift::OpenExistentialExpr*, swift::Lowering::SGFContext) + 168
15 swift-frontend           0x000000010111139c swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 56
16 swift-frontend           0x00000001010c4938 (anonymous namespace)::ArgEmitter::emit(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern, std::__1::optional<swift::AnyFunctionType::Param>) + 3552
17 swift-frontend           0x00000001010b5b60 (anonymous namespace)::ArgEmitter::emitSingleArg(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern, std::__1::optional<swift::AnyFunctionType::Param>) + 312
18 swift-frontend           0x00000001010c307c (anonymous namespace)::ArgEmitter::emitPreparedArgs(swift::Lowering::PreparedArguments&&, swift::Lowering::AbstractionPattern) + 192
19 swift-frontend           0x00000001010ce08c (anonymous namespace)::CallSite::emit(swift::Lowering::SILGenFunction&, swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::SILFunctionType>, (anonymous namespace)::ParamLowering&, llvm::SmallVectorImpl<swift::Lowering::ManagedValue>&, llvm::SmallVectorImpl<(anonymous namespace)::DelayedArgument>&, swift::ForeignInfo const&) && + 532
20 swift-frontend           0x00000001010cd98c (anonymous namespace)::CallEmission::emitArgumentsForNormalApply(swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::SILFunctionType>, swift::ForeignInfo const&, llvm::SmallVectorImpl<swift::Lowering::ManagedValue>&, std::__1::optional<swift::SILLocation>&) + 840
21 swift-frontend           0x00000001010b94b4 (anonymous namespace)::CallEmission::apply(swift::Lowering::SGFContext) + 1800
22 swift-frontend           0x00000001010b7b48 swift::Lowering::SILGenFunction::emitApplyExpr(swift::ApplyExpr*, swift::Lowering::SGFContext) + 2028
23 swift-frontend           0x0000000101111974 swift::Lowering::SILGenFunction::emitIgnoredExpr(swift::Expr*) + 912
24 swift-frontend           0x000000010119385c swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) + 4340
25 swift-frontend           0x000000010119275c swift::Lowering::SILGenFunction::emitStmt(swift::Stmt*) + 24
26 swift-frontend           0x00000001010f082c swift::Lowering::SILGenFunction::emitClassConstructorInitializer(swift::ConstructorDecl*) + 2488
27 swift-frontend           0x00000001010a517c swift::Lowering::SILGenModule::emitFunctionDefinition(swift::SILDeclRef, swift::SILFunction*) + 2912
28 swift-frontend           0x00000001010a6d14 swift::Lowering::SILGenModule::emitOrDelayFunction(swift::SILDeclRef) + 252
29 swift-frontend           0x00000001010a7b8c swift::Lowering::SILGenModule::emitConstructor(swift::ConstructorDecl*) + 388
30 swift-frontend           0x00000001011a43f0 (anonymous namespace)::SILGenType::emitType() + 336
31 swift-frontend           0x00000001011a4294 swift::Lowering::SILGenModule::visitNominalTypeDecl(swift::NominalTypeDecl*) + 24
32 swift-frontend           0x00000001010a9654 swift::ASTLoweringRequest::evaluate(swift::Evaluator&, swift::ASTLoweringDescriptor) const + 880
33 swift-frontend           0x00000001011921b4 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
34 swift-frontend           0x00000001010aef48 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
35 swift-frontend           0x00000001010a9f58 swift::performASTLowering(swift::FileUnit&, swift::Lowering::TypeConverter&, swift::SILOptions const&, swift::IRGenOptions const*) + 96
36 swift-frontend           0x0000000100a97b8c swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 568
37 swift-frontend           0x0000000100aa8dfc withSemanticAnalysis(swift::CompilerInstance&, swift::FrontendObserver*, llvm::function_ref<bool (swift::CompilerInstance&)>, bool) + 160
38 swift-frontend           0x0000000100a9a1c8 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 708
39 swift-frontend           0x0000000100a99134 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2368
40 swift-frontend           0x00000001008b392c swift::mainEntry(int, char const**) + 3096
41 dyld                     0x0000000193a160e0 start + 2360
Command SwiftCompile failed with a nonzero exit code

Command SwiftCompile failed with a nonzero exit code

Expected behavior

Code compiles on Swift 5.10

Environment

Apple Swift version 6.0-dev (LLVM 7b8e6346027d2b1, Swift 763421cee31dc8f) Target: arm64-apple-macosx14.0

Additional information

No response

vsarunas avatar May 02 '24 11:05 vsarunas