We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
md5: 11e80745d16ba4455bfc1757ac6e1476
Issue Description:
func f() throws {} print(try? f())
Compile with xcrun /path/to/swift tmp.swift on Aug 21 master @ 828ab6d. Crashes with:
xcrun /path/to/swift tmp.swift
Assertion failed: (!concreteBuffer && "concrete buffer already formed?!"), function getAddressForInPlaceInitialization, file /Users/varun/foss-swift-alt/swift/lib/SILGen/SILGenConvert.cpp, line 557. Stack dump: 0. Program arguments: /Users/varun/foss-swift-alt/build/Ninja-ReleaseAssert/swift-macosx-x86_64/bin/swift-frontend -frontend -interpret /Users/varun/tmp/Tmp.swift -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -color-diagnostics -target-sdk-version 11.0 -module-name Tmp 1. Swift version 5.3-dev (LLVM 36f7fac60d2e676, Swift bc0a91316477c35) 2. While evaluating request ASTLoweringRequest(Lowering AST to SIL for module Tmp) 0 swift-frontend 0x000000010a82c3d5 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37 1 swift-frontend 0x000000010a82b3a8 llvm::sys::RunSignalHandlers() + 248 2 swift-frontend 0x000000010a82c9b6 SignalHandler(int) + 262 3 libsystem_platform.dylib 0x00007fff6d91bd7d _sigtramp + 29 4 libsystem_platform.dylib 000000000000000000 _sigtramp + 18446603338677895840 5 libsystem_c.dylib 0x00007fff6d7d5740 abort + 120 6 libsystem_c.dylib 0x00007fff6d7d49f6 err + 0 7 swift-frontend 0x000000010a9b7973 (anonymous namespace)::ExistentialInitialization::getAddressForInPlaceInitialization(swift::Lowering::SILGenFunction&, swift::SILLocation) (.cold.10) + 35 8 swift-frontend 0x00000001067171fe (anonymous namespace)::ExistentialInitialization::getAddressForInPlaceInitialization(swift::Lowering::SILGenFunction&, swift::SILLocation) + 1422 9 swift-frontend 0x000000010674100b (anonymous namespace)::RValueEmitter::visitOptionalTryExpr(swift::OptionalTryExpr*, swift::Lowering::SGFContext) + 2571 10 swift-frontend 0x0000000106736bf4 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 8948 11 swift-frontend 0x000000010672a12f swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 63 12 swift-frontend 0x00000001067460b2 swift::Lowering::ManagedValue llvm::function_ref<swift::Lowering::ManagedValue (swift::Lowering::SGFContext)>::callback_fn<(anonymous namespace)::RValueEmitter::visitErasureExpr(swift::ErasureExpr*, swift::Lowering::SGFContext)::$_9>(long, swift::Lowering::SGFContext) + 98 13 swift-frontend 0x00000001067173d3 void llvm::function_ref<void (swift::SILValue)>::callback_fn<swift::Lowering::SILGenFunction::emitExistentialErasure(swift::SILLocation, swift::CanType, swift::Lowering::TypeLowering const&, swift::Lowering::TypeLowering const&, llvm::ArrayRef<swift::ProtocolConformanceRef>, swift::Lowering::SGFContext, llvm::function_ref<swift::Lowering::ManagedValue (swift::Lowering::SGFContext)>, bool)::$_6>(long, swift::SILValue) + 163 14 swift-frontend 0x00000001066fbeba swift::Lowering::SILGenBuilder::bufferForExpr(swift::SILLocation, swift::SILType, swift::Lowering::TypeLowering const&, swift::Lowering::SGFContext, llvm::function_ref<void (swift::SILValue)>) + 154 15 swift-frontend 0x000000010671223b swift::Lowering::SILGenFunction::emitExistentialErasure(swift::SILLocation, swift::CanType, swift::Lowering::TypeLowering const&, swift::Lowering::TypeLowering const&, llvm::ArrayRef<swift::ProtocolConformanceRef>, swift::Lowering::SGFContext, llvm::function_ref<swift::Lowering::ManagedValue (swift::Lowering::SGFContext)>, bool) + 1339 16 swift-frontend 0x000000010673a773 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 24179 17 swift-frontend 0x0000000106727335 swift::Lowering::SILGenFunction::emitExprInto(swift::Expr*, swift::Lowering::Initialization*, llvm::Optional<swift::SILLocation>) + 309 18 swift-frontend 0x00000001066ae961 swift::Lowering::ArgumentSource::forwardInto(swift::Lowering::SILGenFunction&, swift::Lowering::Initialization*) && + 225 19 swift-frontend 0x00000001066aef8c swift::Lowering::ArgumentSource::forwardInto(swift::Lowering::SILGenFunction&, swift::Lowering::AbstractionPattern, swift::Lowering::Initialization*, swift::Lowering::TypeLowering const&) && + 252 20 swift-frontend 0x0000000106742d19 (anonymous namespace)::RValueEmitter::visitCollectionExpr(swift::CollectionExpr*, swift::Lowering::SGFContext) + 1481 21 swift-frontend 0x000000010673499e swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 158 22 swift-frontend 0x000000010673496e swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 110 23 swift-frontend 0x000000010672a12f swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 63 24 swift-frontend 0x00000001066e4657 (anonymous namespace)::ArgEmitter::emit(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 2071 25 swift-frontend 0x00000001066d0e32 (anonymous namespace)::ArgEmitter::emitSingleArg(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 450 26 swift-frontend 0x00000001066e3983 (anonymous namespace)::ArgEmitter::emitPreparedArgs(swift::Lowering::PreparedArguments&&, swift::Lowering::AbstractionPattern) + 147 27 swift-frontend 0x00000001066ecd21 (anonymous namespace)::CallEmission::emitArgumentsForNormalApply(swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::SILFunctionType>, llvm::Optional<swift::ForeignErrorConvention> const&, swift::ImportAsMemberStatus, llvm::SmallVectorImpl<swift::Lowering::ManagedValue>&, llvm::Optional<swift::SILLocation>&) + 1393 28 swift-frontend 0x00000001066d569e (anonymous namespace)::CallEmission::apply(swift::Lowering::SGFContext) + 3230 29 swift-frontend 0x00000001066d301e swift::Lowering::SILGenFunction::emitApplyExpr(swift::ApplyExpr*, swift::Lowering::SGFContext) + 2302 30 swift-frontend 0x0000000106734957 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 87 31 swift-frontend 0x000000010672a55a swift::Lowering::SILGenFunction::emitIgnoredExpr(swift::Expr*) + 938 32 swift-frontend 0x00000001066c6821 swift::Lowering::SILGenModule::visitTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 369 33 swift-frontend 0x00000001066c6f57 swift::ASTLoweringRequest::evaluate(swift::Evaluator&, swift::ASTLoweringDescriptor) const + 1415 34 swift-frontend 0x00000001067a0c81 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&) + 33 35 swift-frontend 0x00000001066cc8f9 llvm::Expected<swift::ASTLoweringRequest::OutputType> swift::Evaluator::getResultUncached<swift::ASTLoweringRequest>(swift::ASTLoweringRequest const&) + 345 36 swift-frontend 0x00000001066c82ed llvm::Expected<swift::ASTLoweringRequest::OutputType> swift::Evaluator::operator()<swift::ASTLoweringRequest, (void*)0>(swift::ASTLoweringRequest const&) + 61 37 swift-frontend 0x00000001066c8234 swift::performASTLowering(swift::ModuleDecl*, swift::Lowering::TypeConverter&, swift::SILOptions const&) + 116 38 swift-frontend 0x0000000106377886 performCompile(swift::CompilerInstance&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) + 7062
The text was updated successfully, but these errors were encountered:
@swift-ci create
Sorry, something went wrong.
Something to do with collections. This also crashes:
func f() throws {} func takesVarargs(_: Any...) {} func takesArray(_: [Any]) {} takesVarargs(try? f()) // crash takesArray([try? f()]) // crash
It seems like there's code that's computing getAddressForInPlaceInitialization multiple times instead of caching it once.
getAddressForInPlaceInitialization
No branches or pull requests
Additional Detail from JIRA
md5: 11e80745d16ba4455bfc1757ac6e1476
Issue Description:
Compile with
xcrun /path/to/swift tmp.swift
on Aug 21 master @ 828ab6d. Crashes with:The text was updated successfully, but these errors were encountered: