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

Swift 5 compiler crash #472

Closed
yarshure opened this issue Jan 25, 2019 · 12 comments
Closed

Swift 5 compiler crash #472

yarshure opened this issue Jan 25, 2019 · 12 comments
Labels

Comments

@yarshure
Copy link

yarshure commented Jan 25, 2019

Xcode 10.2 Beta 1

crash log
1.	While emitting SIL for 'performInsert(_:)' (at /Users/yarshure/github/sfsocket/Carthage/Checkouts/GRDB_project_name_temp/GRDB/Record/PersistableRecord.swift:942:12)
2.	While silgen emitFunction SIL function "@$s4GRDB17PersistableRecordPAAE13performInsertyyAA8DatabaseCKF".
 for 'performInsert(_:)' (at /Users/yarshure/github/sfsocket/Carthage/Checkouts/GRDB_project_name_temp/GRDB/Record/PersistableRecord.swift:942:12)
0  swift                    0x00000001041fcf8a PrintStackTraceSignalHandler(void*) + 42
1  swift                    0x00000001041fc77c SignalHandler(int) + 348
2  libsystem_platform.dylib 0x00007fff6f4f1b3d _sigtramp + 29
3  libsystem_malloc.dylib   0x00007fff6f4b8b54 tiny_free_no_lock + 1035
4  swift                    0x000000010101c5ec swift::ASTVisitor<SILGenLValue, swift::Lowering::LValue, void, void, void, void, void, swift::Lowering::SGFAccessKind, swift::Lowering::LValueOptions>::visit(swift::Expr*, swift::Lowering::SGFAccessKind, swift::Lowering::LValueOptions) + 1436
5  swift                    0x000000010101bf82 swift::Lowering::SILGenFunction::emitLValue(swift::Expr*, swift::Lowering::SGFAccessKind, swift::Lowering::LValueOptions) + 34
6  swift                    0x0000000100f782f3 (anonymous namespace)::ArgEmitter::emit(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 1443
7  swift                    0x0000000100f8a0c5 (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>&, llvm::Optional<swift::ForeignErrorConvention> const&, swift::ImportAsMemberStatus) && + 1061
8  swift                    0x0000000100f873bb (anonymous namespace)::CallEmission::emitArgumentsForNormalApply(swift::CanTypeWrapper<swift::FunctionType>&, swift::Lowering::AbstractionPattern&, swift::CanTypeWrapper<swift::SILFunctionType>, llvm::Optional<swift::ForeignErrorConvention> const&, swift::ImportAsMemberStatus, llvm::SmallVectorImpl<swift::Lowering::ManagedValue>&, llvm::Optional<swift::SILLocation>&, swift::CanTypeWrapper<swift::FunctionType>&) + 1339
9  swift                    0x0000000100f84e2b (anonymous namespace)::CallEmission::apply(swift::Lowering::SGFContext) + 2763
10 swift                    0x0000000100f80f3b swift::Lowering::SILGenFunction::emitApplyExpr(swift::Expr*, swift::Lowering::SGFContext) + 2235
11 swift                    0x0000000100ff342b swift::Lowering::SILGenFunction::emitIgnoredExpr(swift::Expr*) + 811
12 swift                    0x0000000101050443 swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) + 10403
13 swift                    0x0000000101053084 swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) + 21732
14 swift                    0x00000001010503e8 swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) + 10312
15 swift                    0x000000010100741b swift::Lowering::SILGenFunction::emitFunction(swift::FuncDecl*) + 427
16 swift                    0x0000000100f664ce swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*) + 1006
17 swift                    0x000000010105f737 swift::Lowering::SILGenModule::visitExtensionDecl(swift::ExtensionDecl*) + 151
18 swift                    0x0000000100f70916 swift::Lowering::SILGenModule::emitSourceFile(swift::SourceFile*) + 1206
19 swift                    0x0000000100f725e5 swift::SILModule::constructSIL(swift::ModuleDecl*, swift::SILOptions&, swift::FileUnit*) + 1253
20 swift                    0x000000010052e130 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 26896
21 swift                    0x000000010052440f swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 6351
22 swift                    0x00000001004c5adb main + 1243
23 libdyld.dylib            0x00007fff6f306ed9 start + 1
24 libdyld.dylib            0x00000000000000cb start + 2429522419
error: Segmentation fault: 11
@groue
Copy link
Owner

groue commented Jan 25, 2019

Hello @yarshure,

This is a bug in the Swift 5 compiler: SR-9707.

We'll have to wait until it is fixed. Unless somebody has a genius idea.

@groue groue changed the title when build GRDBOSX Swift crash Swift 5 compiler crash Jan 25, 2019
@groue groue added help wanted Extra attention is needed blocked Progress is impossible due to some external blocking reason and removed blocked Progress is impossible due to some external blocking reason labels Jan 25, 2019
@groue
Copy link
Owner

groue commented Jan 30, 2019

Relevant Swift PR: apple/swift#22238

@groue
Copy link
Owner

groue commented Feb 4, 2019

The latest Swift 5 snapshot, from February 3, 2019, does no longer exhibit this crash 👍

Let's keep this issue open until Xcode beta is fixed as well.

@skrew
Copy link

skrew commented Feb 4, 2019

Xcode beta 2 still crash :(

C'mon apple, i'm tired because of the "microphone access" bug, corrected with Xcode 10.2 but can't use it because of the crash with GRDB...

Edit: Tested with the snapshot version of swift, it don't crash anymore with GRDB, fine, but it crash with another lib.

@groue
Copy link
Owner

groue commented Feb 5, 2019

GRDB support for Swift 5 has started in the swift-5.0 branch (with the latest Swift 5 snapshot). Just like Xcode betas, this is unfinished software. If it doesn't work for you, your help and support are welcome.

I'll try to sum up my plans regarding Swift 5 in a future message.

EDIT 2018/02/20: please stop using the swift-5.0 branch. Check
#472 (comment)

@groue
Copy link
Owner

groue commented Feb 5, 2019

@skrew:

:(

Take a deep breath, it will get better :-)

@graham-perks-snap
Copy link

Xcode beta 2 came out on the 4th, only a day after the Swift branch that fixed it. The timing was poor for beta 2 to include the fix. Hopefully beta 3 include the fix.

@groue
Copy link
Owner

groue commented Feb 6, 2019

Current plans for GRDB and Swift 5: https://forums.swift.org/t/plans-for-grdb-and-swift-5/20206/2

@groue groue removed the help wanted Extra attention is needed label Feb 13, 2019
@graham-perks-snap
Copy link

graham-perks-snap commented Feb 19, 2019

Building works in Xcode beta 3!

@groue
Copy link
Owner

groue commented Feb 20, 2019

Thanks @graham-perks-snap!

⚠️ The swift-5.0 quoted above is a short-lived branch. It will be deleted soon: don't rely on it.

👉 Instead, GRDB users who use Xcode 10.2 beta are encouraged to switch to GRDB 4, currently in development in the GRDB-4.0 branch. For more details, read the first paragraphs of the README.

The master README has been updated with Swift 5 information. Since all needed information is now easily available, I'm closing this issue.

@groue groue closed this as completed Feb 20, 2019
@graham-perks-snap
Copy link

Thanks @groue. Since GRDB 4 has no ETA (per the readme), this leaves users stranded on Xcode 9, which of course none of us will want to sit on for long.

@groue
Copy link
Owner

groue commented Feb 20, 2019

Since GRDB 4 has no ETA (per the readme), this leaves users stranded on Xcode 9, which of course none of us will want to sit on for long.

There is no ETA, but there is an estimated backlog in #479.

And there are other options than sitting on GRDB 3.6.2 and Xcode 10.1:

  1. Fork GRDB 3 so that it is compatible with Xcode 10.2 beta.
  2. Same as previous options, and submit a pull request so that other users can profit from your experience.
  3. Same as previous options, with production-grade quality (all guarantees of semantic versioning must apply): this will eventually give the very last GRDB 3 version: GRDB 3.6.3, and this would be really great.
  4. Upgrade your GRDB dependency on GRDB 4 (ok with Xcode 10.0, Xcode 10.1, and Xcode 10.2 beta)
  5. Same as the previous option, and help decreasing the ETA with your contributions.

My personal priorities are on GRDB 4, because this is where there is the most benefits for everybody. It should already be pretty usable, even if we can expect a few breaking changes until the final release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants