automerge / automerge-swift-archived

Wrapper around Swift types that can be modified concurrently by different users, and merged again automatically (a CRDT).
MIT License
159 stars 14 forks source link

Release mode crash: Can't unsafeBitCast between types of different sizes #30

Closed endeavour42 closed 3 years ago

endeavour42 commented 3 years ago

only tried this on the "support-latest-rust-version" branch, might or might not apply to the "main" branch:

the tests are crashing with "Swift runtime failure: Can't unsafeBitCast between types of different sizes" on this line:

let typePtr = unsafeBitCast(Root.self, to: UnsafeMutableRawPointer.self) KeyPathIntrospection.swift line 19

this is only happening in release mode (-O or -Osize). this doesn't happen in debug mode (-Onone)

Screenshot 2021-04-29 at 10 10 03
lightsprint09 commented 3 years ago

Can you please provide more info about Versions of macOS & Swift you are using

endeavour42 commented 3 years ago

it is on intel mac. i tested that on catalina + Xcode 12.4. since then i updated to big sur and Xcode 12.5, but haven't had a chance testing it on that setup. and the swift version - whatever comes with Xcode (shown as "swift 5" in Xcode, though it's probably some 5.x if to dig further).

lightsprint09 commented 3 years ago

I try to reproduce this. Build my iOS application in release mode and it did noch crash

endeavour42 commented 3 years ago

interesting. try macOS app (that's where it was crashing for me)

lightsprint09 commented 3 years ago

I can execute the performance test in release mode without crashing. Will close this for now. Reopen if you encounter the crash again.