groue / GRDBCombine

GRDB ❤️ Combine
MIT License
223 stars 16 forks source link

DEMO application crashes with Xcode 11.2 #22

Closed williehallock802 closed 4 years ago

williehallock802 commented 4 years ago

I am not sure what is going wrong, but after I upgraded to Xcode 11.2, the demo application now crashes at:

extension EncodableRecord where Self: Encodable {
    public func encode(to container: inout PersistenceContainer) {
        let encoder = RecordEncoder<Self>(persistenceContainer: container)
        **try! encode(to: encoder)**
        container = encoder.persistenceContainer
    }
}

with

Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)

I will assume that this is easily reproducible. If it is not, I can provide more information. The only relevant difference between when it was working and now seems to be the version of Xcode.

I am using the tip of master -- 416dda2

I did notice that the Demo app was using GRDB 4.4.0. I attempted to use GRDB 4.5.0, but the results were unchanged...still crashes.

groue commented 4 years ago

Hello @williehallock802,

Thanks for reminding me of this. This crash is an Xcode bug. See https://github.com/groue/GRDB.swift/issues/640 for more information.

Please try the workaround explained in the above link: in the demo app Xcode project, select the app target, and set DEAD_CODE_STRIPPING to NO. It should fix the crash.

I should apply this workaround in the demo app so that other users do not face the same disappointment.

groue commented 4 years ago

The workaround for the Xcode bug has been pushed to the master branch.