Open Ar-Shak opened 3 years ago
Thanks for the report. I don't have an immediate explanation for this, so I will have to investigate a bit to answer it properly.
Maybe related to https://github.com/realm/realm-java/issues/7250.
There is a chance this might be fixed by Realm Java 10.3.0
. Which will be released shortly. At least this was in the changelog: https://github.com/realm/realm-core/blob/master/CHANGELOG.md#1033-release-notes
Fix a race condition which would lead to "uncaught exception in notifier thread: N5realm15InvalidTableRefE: transaction_ended" and a crash when the source Realm was closed or invalidated at a very specific time during the first run of a collection notifier (#3761, since v6.0.0).
I hope the above version fixes the issue, as I'm on the verge of moving away from Realm due to this issue.
@arshak-kahnputers Have you been able to test this with 10.3.0 (https://github.com/realm/realm-java/blob/master/CHANGELOG.md)?
@rorbech I have updated the library, so far haven't noticed any crash. Will update if I were to see any on Crashlytics.
@arshak-kahnputers Thanks for the feedback. I will close the issue for now. Please feel free to repost if you have new observations.
@rorbech The issue still persists on 10.3.0 which happened on LGE Stylo 6 running Android 10 which doesn't point to any Project files. The exception title text seemed to have changed but the line number and the remaining lines looks similar. Please check the attached screenshot.
Here's the stack trace: Fatal Exception: java.lang.IllegalStateException: Access to invalidated Results objects in /tmp/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsResults.cpp line 492 at io.realm.internal.OsResults.nativeEvaluateQueryIfNeeded(OsResults.java) at io.realm.internal.OsResults.load(OsResults.java:701) at io.realm.internal.OsResults.freeze(OsResults.java:329) at io.realm.RealmResults.freeze(RealmResults.java:600) at io.realm.rx.RealmObservableFactory$6$1.onChange(RealmObservableFactory.java:196) at io.realm.rx.RealmObservableFactory$6$1.onChange(RealmObservableFactory.java:192) at io.realm.internal.ObservableCollection$RealmChangeListenerWrapper.onChange(ObservableCollection.java:39) at io.realm.internal.ObservableCollection$CollectionObserverPair.onChange(ObservableCollection.java:20) at io.realm.internal.ObservableCollection$Callback.onCalled(ObservableCollection.java:64) at io.realm.internal.ObservableCollection$Callback.onCalled(ObservableCollection.java:54) at io.realm.internal.ObserverPairList.foreach(ObserverPairList.java:109) at io.realm.internal.OsResults.notifyChangeListeners(OsResults.java:675) at android.os.MessageQueue.nativePollOnce(MessageQueue.java) at android.os.MessageQueue.next(MessageQueue.java:336) at android.os.Looper.loop(Looper.java:174) at android.os.HandlerThread.run(HandlerThread.java:67)
We are in the same situation here ! Top Crashlitics Crash : 500 by days. Help would be good !
Little different message of error at the same line:
Caused by io.realm.exceptions.RealmError: Unrecoverable error. No such object in /tmp/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsResults.cpp line 492 at io.realm.internal.OsResults.nativeEvaluateQueryIfNeeded(OsResults.java) at io.realm.internal.OsResults.load(OsResults.java:701) at io.realm.RealmResults.load(RealmResults.java:142) at io.realm.RealmQuery.createRealmResults(RealmQuery.java:2360) at io.realm.RealmQuery.findAll(RealmQuery.java:2039)
Hi, we are looking into it, but nothing conclusive yet.
@cmelchior Please let us know once this issue has been resolved.
I'm commenting on this so that the issue remains open, as it seems that a bot has closed this issue yesterday.
@cmelchior Hi any news on this ?
Here is a crash I get close to the issue (but in a Rx context)
Fatal Exception: io.realm.exceptions.RealmError: Unrecoverable error. transaction_ended
Exception backtrace:
<backtrace not supported on this platform> in /Users/cm/Realm/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsResults.cpp line 504
at io.realm.internal.OsResults.nativeFreeze(OsResults.java)
at io.realm.internal.OsResults.freeze(OsResults.java:14)
at io.realm.RealmResults.freeze(RealmResults.java:16)
at io.realm.rx.RealmObservableFactory$6$1.onChange(RealmObservableFactory.java:20)
at io.realm.rx.RealmObservableFactory$6$1.onChange(RealmObservableFactory.java:2)
at io.realm.internal.ObservableCollection$RealmChangeListenerWrapper.onChange(ObservableCollection.java:2)
at io.realm.internal.ObservableCollection$CollectionObserverPair.onChange(ObservableCollection.java:13)
at io.realm.internal.ObservableCollection$Callback.onCalled(ObservableCollection.java:2)
at io.realm.internal.ObservableCollection$Callback.onCalled(ObservableCollection.java:2)
at io.realm.internal.ObserverPairList.foreach(ObserverPairList.java:41)
at io.realm.internal.OsResults.notifyChangeListeners(OsResults.java:46)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:336)
at android.os.Looper.loop(Looper.java:197)
at android.os.HandlerThread.run(HandlerThread.java:67)
App uses 10.0.4
or
Fatal Exception: java.lang.IllegalStateException: Access to invalidated Results objects in /tmp/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsResults.cpp line 492
at io.realm.internal.OsResults.nativeEvaluateQueryIfNeeded(OsResults.java)
at io.realm.internal.OsResults.load(OsResults.java:8)
at io.realm.internal.OsResults.freeze(OsResults.java:27)
at io.realm.RealmResults.freeze(RealmResults.java:16)
at io.realm.rx.RealmObservableFactory$6$1.onChange(RealmObservableFactory.java:20)
at io.realm.rx.RealmObservableFactory$6$1.onChange(RealmObservableFactory.java:2)
at io.realm.internal.ObservableCollection$RealmChangeListenerWrapper.onChange(ObservableCollection.java:2)
at io.realm.internal.ObservableCollection$CollectionObserverPair.onChange(ObservableCollection.java:13)
at io.realm.internal.ObservableCollection$Callback.onCalled(ObservableCollection.java:2)
at io.realm.internal.ObservableCollection$Callback.onCalled(ObservableCollection.java:2)
at io.realm.internal.ObserverPairList.foreach(ObserverPairList.java:41)
at io.realm.internal.OsResults.notifyChangeListeners(OsResults.java:46)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:326)
at android.os.Looper.loop(Looper.java:181)
at android.os.HandlerThread.run(HandlerThread.java:65)
What is strange here is how this may happen with freezed object, isn't it ?
any update here?
@shrikantbmali Are you experiencing anything similar? Could you please post all details? Are you in any way able to reproduce?
@bmunkholm Yes, When I try to create a realm instance in temp folder while I am running my Dotnet core 3.1 app it fails, I can consistently reproduce it. however, I just realized that I am posting of java thread. my bad, but the log is exactly the same.
@shrikantbmali That's interesting - could you please create a new issue in realm/realm-dotnet ? All details in terms how we could possibly reproduce it would be appreciated. Feel free to reference this issue as well as possibly related. Thanks!
Any update on this one? This is our one of the top crashes.
This issue has 59931 crash events affecting 11803 users
` Exception io.realm.exceptions.RealmError: Unrecoverable error. transaction_ended Exception backtrace:
@silicon-pranit your issue might not necessarily be the same as the one originally reported in this ticket. I would suggest you create another ticket and provide us with a full stack trace, including any potential native crashes following the format shown in https://developer.android.com/ndk/guides/ndk-stack
We are also noticing this issues in production:
io.realm.exceptions.RealmError: Unrecoverable error. transaction_ended
Exception backtrace:
<backtrace not supported on this platform> in /tmp/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsResults.cpp line 529
at io.realm.internal.OsResults.nativeFreeze
at io.realm.internal.OsResults.freeze
at io.realm.RealmResults.freeze
at io.realm.rx.RealmObservableFactory$6$1.onChange
at io.realm.rx.RealmObservableFactory$6$1.onChange
at io.realm.internal.ObservableCollection$RealmChangeListenerWrapper.onChange
at io.realm.internal.ObservableCollection$CollectionObserverPair.onChange
at io.realm.internal.ObservableCollection$Callback.onCalled
at io.realm.internal.ObservableCollection$Callback.onCalled
at io.realm.internal.ObserverPairList.foreach
at io.realm.internal.OsResults.notifyChangeListeners
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:335)
at android.os.Looper.loopOnce(Looper.java:161)
at android.os.Looper.loop(Looper.java:288)
at android.os.HandlerThread.run(HandlerThread.java:67)
Goal
Android app with latest realm (10.0.1) & even older version crashes with the error mentioned in the stack trace provided by Firebase Crashlytics. I thought the latest version might have fixed this issue. Also, the crash doesn't point to any of the files related to the project and I'm unable to reproduce this issue.
Actual Results
Stack trace provided by Firebase Crashlytics:
Fatal Exception: io.realm.exceptions.RealmError: Unrecoverable error. transaction_ended Exception backtrace: