-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Crash at Realm(fileURL: ) with access group. #4221
Comments
@Ankish thank you for sharing this crash report! Could you please provide some more info how to reproduce this crash, error message you see or example Xcode project, thanks! |
@stel I havent still seen this crash on iPhone 5s 9.3.5 - I am seeing this on 6s 9.3.3. Havent tested on all other devices. It does not crash always on initializing the Realm object. If I was able produce this consistently I could have prepared a sample project and pointed the issue. I am not able to reproduce it every time. however its a simple code: class func getSessionWithSessionId(sessionId : String ) -> Session?{
let realm = try! Realm(fileURL: NSURL(string: RealmConfig.dbPath)!) // crashes here on keyboard extension
let predicate = NSPredicate(format: "sessionID = %@",sessionId)
let collection = realm.objects(Session.self).filter(predicate)
if collection.count == 0 {
return nil
}
return collection.first!
} |
Hi @Ankish, we've made some improvements to the interprocess locking mechanism in recent Realm versions. Could you please try with the latest release to see if that improves things? That's Realm 2.0.2 as of this writing. |
@Ankish just following up on my request for you to see if recent Realm versions still exhibit this issue (latest version is 2.0.3 as of this writing). |
Closing as we never heard back from @Ankish and I suspect this has been fixed since the issue was reported. |
I see it ocassionaly.
|
@Ankish, can you share more information about the crash? The backtrace only tells us where the crash happened, not what went wrong. |
@Ankish, of particular interest is the portion of LLDB's output that looks something like this:
|
I might be accessing Realm from main thread as well as from an background thread. Is that safety guaranteed ? |
@Ankish, can you please provide the full crash log or debugger output rather than just a partial snippet? The missing portions of the output contain important information that will help us understand the problem. |
If you use realm file in bundle, it will crash on the device. Need to specify
let path = Bundle.main.url(forResource: "mydata", withExtension: "realm")!
let configuration = Realm.Configuration(fileURL: path, readOnly: true)
realm = try! Realm(configuration: configuration) |
@onmyway133 Hi, found this due to similar crash here in 2022 - is there a solution when you want to write from the extension as well? |
Using Real with Keyboard Extension - so using access group
Fetching by :
Crashes at first Realm code:
Stack trace
Steps to Reproduce
Xcode version: 7.3.1
iOS/OSX version: 9.3.3
Dependency manager + version: CocoaPods (unknown version)
The text was updated successfully, but these errors were encountered: