Open gongzhang opened 3 months ago
➤ PM Bot commented:
Jira ticket: RCOCOA-2323
I also run into this. Ever solve it? Seems like Realm considers it working or user error
@tgoyne does the guidance in https://github.com/realm/realm-swift/issues/8017#issuecomment-1540455131 still apply? Thanks
@aehlke I resolved the issue by moving the Realm database out of the shared group. I still use the shared group to exchange data between processes, but I never open a Realm database file within the shared group. Additionally, I utilize UserDefaults to implement observation.
Overall, any flock() in the shared group will lead to a background crash.
Looks like we aren't using the emulated file lock that we wrote for iOS on visionOS and need to be. This doesn't fix all of the problems, but does make it so that merely reading from an already-open Realm won't kill the process.
How frequently does the bug occur?
Always
Description
Hello everyone!
Although I'm aware that the
0xdead10cc
issue has been extensively discussed (e.g., #8017, #7863, #7053, #6861, etc.), I believe the problem I'm encountering is slightly different and can be reproduced 100% of the time, which is why I've decided to bring it up.I've noticed that on the Vision Pro, if my Realm database is stored within an App Group, then holding any observation to Realm in the app will lead to a 100% crash when entering the background. This means that if your database is within an App Group, even the most basic SwiftUI examples cannot function properly on visionOS:
More specifically, the app will 100% crash with either a
0xdead10cc
error or aRUNNINGBOARD 3735883980
error upon entering the background, provided the following conditions are met:@ObservedResults
or any other Realm observation object.Stacktrace & log output
Can you reproduce the bug?
Always
Reproduction Steps
I have provided a sample project along with the steps to reproduce the issue. The sample project is quite straightforward—it uses
@ObservedResults
and stores the database in an App Group.Steps to reproduce can be found here: https://github.com/gongzhang/RealmFileLockTest/tree/main?tab=readme-ov-file#steps-to-reproduce
Version
v10.49.1
What Atlas Services are you using?
Local Database only
Are you using encryption?
No
Platform OS and version(s)
visionOS 1.0-1.1.1 are confirmed
Build environment
Xcode version: 15.3 Dependency manager and version: XCFramework and SPM