After ThrowingException 16, std::exception in io_realm_internal_TableQuery.cpp line 1288 exception is logged, i can't
ThrowingException 16, std::exception in io_realm_internal_TableQuery.cpp line 1288 is logged in logcat)Requested table is not in this Realm. Creating it requires a transaction exception happens)A RealmObject with no @PrimaryKey cannot be updated error happened, although that class has a @PrimaryKey annotated field.ArrayIndexOutOfBoundsException: columnIndex > available columns.exceptionCase 1~3 dismiss after process is restarted (swipe it in recent tasks), but i could reproduce below steps. After case 4, i uninstalled application and no longer reproduce any of problems.
The class that have this problem query data and is listening changes (using observable) in main thread. At the same time every data about that class are removed (realm.delete(*.class)) and re-inserted with fresh one from server in worker thread.
I tried to find reproduce step for 1~2 hours, but i couldn't.
Realm version(s): 1.0.0
Android Studio version: 2.1.1
Which Android version and device: 6.0.1 (Galaxy S6)
Hello @hohnamkung
Thanks for the detailed description of the symptom. Is there anyway we could ask a simple sample to reproduce the problem you are going through? We could be more than happy to accelerate solving the issue once there is a tangible specimen available. We will strongly look forward.
Already i made a effort to find a way to reproduce it, but i couldn't find any. 😞
After case 1~3, i thought i can reproduce it so i uninstall application without backup realm file.
I'm not sure i can find a step to reproduce it or make a sample application.
But i and my team members have this issues time to time, so i'll share a realm file if i run into it.
@hohnamkung
We understand that the issue happens rarely. It really doesn't matter whether the issue could be 100% reproducible or not. We are looking forward to have a ground at least where we could collect sample data with an _actual_ case of crash.
We'll investigate the issue according the scenario you've provided. Thanks for letting us know. 👍
Hi @stk1m1
I shared a sample project (still not reproducible) and some other founding to [email protected]
Please check that out.
D/REALM: jni: ThrowingException 16, std::exception in io_realm_internal_TableQuery.cpp line 1253, .
D/REALM: Exception has been throw: std::exception in io_realm_internal_TableQuery.cpp line 1253
W/System.err: java.lang.IllegalArgumentException: A RealmObject with no @PrimaryKey cannot be updated: class kr.co.vcnc.android.couple.between.api.model.anniversary.RAnniversary
W/System.err: at io.realm.Realm.checkHasPrimaryKey(Realm.java:1178)
W/System.err: at io.realm.Realm.copyToRealmOrUpdate(Realm.java:754)
W/System.err: at kr.co.vcnc.android.couple.realm.RealmRunnable.lambda$transaction$1899(RealmRunnable.java:76)
W/System.err: at kr.co.vcnc.android.couple.realm.RealmRunnable.access$lambda$3(RealmRunnable.java:0)
W/System.err: at kr.co.vcnc.android.couple.realm.RealmRunnable$$Lambda$4.run(Unknown Source)
W/System.err: at kr.co.vcnc.android.couple.realm.RealmRunnable.transaction(RealmRunnable.java:93)
W/System.err: at kr.co.vcnc.android.couple.realm.RealmRunnable.transaction(RealmRunnable.java:75)
D/REALM: jni: ThrowingException 16, std::exception in io_realm_internal_TableQuery.cpp line 1288, .
D/REALM: Exception has been throw: std::exception in io_realm_internal_TableQuery.cpp line 1288
D/REALM: jni: ThrowingException 16, std::exception in io_realm_internal_TableQuery.cpp line 1253, .
@hohnamkung
Thank you very much for your contribution! We'll keep investigating and reach you back.
Hi @hohnamkung
Most of the errors seem to indicate schema changes somehow. Looking at the example you sent, you are copying an Realm file from assets, correct? Are you manipulating the file itself or the schema any other places?
Yes, The realm file in example's asset folder was copied from problem reproducing device. (when exception happens)
No i don't change anything in attached file. (just pull from device and push it into asset folder)
Hi @hohnamkung
I think we have identified an interaction between asynchronous listeners and synchronous RealmResults that could result in errors. Some of these errors will be solved by https://github.com/realm/realm-java/pull/2926, but we discovered it did not cover all corner cases.
However these errors should not result in some of error messages you are seeing, e.g Requested table is not in this Realm. Creating it requires a transaction still indicate that a Realm file with a wrong schema is being accessed.
Thanks @cmelchior
If i run into Requested table is not in this Realm. Creating it requires a transaction again, i'll get a some information and share it.
Yes, thank you. Any info you have on that one will be highly appreciated.
Since we haven't seen any more reports on this issue, I will either assume it has been fixed or was caused by something outside our control. Closing
Crazy timing: after 7 months of no activity on this issue, i come across it today as I'm seeing it in my codebase, only to find it closed 2 hours ago.
Shall I create a new ticket with what details I can offer?
@CDRussell No, i'll re-open this instead. Please provide as many details you can
Same log statements as OP was seeing:
D/REALM: jni: ThrowingException 16, std::exception in io_realm_internal_TableQuery.cpp line 1282
D/REALM: Exception has been throw: std::exception in io_realm_internal_TableQuery.cpp line 1282
In my case, I have a huge amount of entries I'm downloading from our own server and trying to persist. Somewhere in the 18,000 region. I'm downloading each and persisting to Realm. (This is basically stress testing the capabilities of the app)
Most of them are persisting just fine, however, I'm occasionally seeing those logs happening. There is a lot of concurrency going on in my project, so a lot of threads will be each grabbing their own Realm reference, writing to the DB, and then closing the reference. Memory is also getting squeezed heavily when the sync is happening.
Given the vast number of records, it isn't clear if the data is failing to save when that happens or not.
Given that's all I see in the logs, I'm not sure what more data I can retrieve. Can I pull additional realm logs somehow?
Using Realm version:
classpath "io.realm:realm-gradle-plugin:1.2.0"
Is it something you can reproduce somewhat reliably? Have you tried updating to 2.3?
Regarding logs
In 2.* you can set the log level using RealmLog.setLogLevel(LogLevel.ALL) , in 1.2 I believe you need to do RealmLog.add(new AndroidLogger(LogLevel.TRACE)) instead.
I can reproduce easily enough; it definitely happens many times over the course of one whole sync of that data.
I haven't tried upgrading to 2.3 yet. I can attempt that though I'm not sure how big a change footprint that'll have on the project. Will investigate how quickly I could test this.
I thought it was maybe each save attempt that was affected, but I just moved to another screen in my app and it died with this stacktrace
FATAL EXCEPTION: main
Process: com.REDACTED, PID: 3119
java.lang.Error: io.realm.internal.async.BadVersionException: std::exception in io_realm_internal_TableQuery.cpp line 1128
at io.realm.RealmQuery$5.call(RealmQuery.java:2161)
at io.realm.RealmQuery$5.call(RealmQuery.java:2131)
at io.realm.internal.async.BgPriorityCallable.call(BgPriorityCallable.java:36)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
Caused by: io.realm.internal.async.BadVersionException: std::exception in io_realm_internal_TableQuery.cpp line 1128
at io.realm.internal.TableQuery.nativeFindWithHandover(Native Method)
at io.realm.internal.TableQuery.findWithHandover(TableQuery.java:445)
at io.realm.RealmQuery$5.call(RealmQuery.java:2143)
at io.realm.RealmQuery$5.call(RealmQuery.java:2131)
at io.realm.internal.async.BgPriorityCallable.call(BgPriorityCallable.java:36)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
And some more in the logs:
D/REALM: jni: ThrowingException 11, mmap() failed: Out of memory size: 134217728 offset: 1207959552 in io_realm_internal_SharedGroup.cpp line 188, .
D/REALM: Exception has been throw: Unrecoverable error. mmap() failed: Out of memory size: 134217728 offset: 1207959552 in io_realm_internal_SharedGroup.cpp line 188
Out of memory could be the overall culprit perhaps?
Out of memory should crash the app outright. Are you catching Errors somewhere?
Regarding upgrading. The list of breaking changes is here: https://github.com/realm/realm-java/blob/master/CHANGELOG.md#breaking-changes-1
Not deliberately; though there's RxJava in the mix, which certainly could be masking an error somewhere.
Upgraded to 2.3 - Still seeing the errors.
E/REALM_JNI: jni: ThrowingException 7, std::exception in /home/cc/repo/realm/realm-java-release/realm/realm-library/src/main/cpp/io_realm_internal_TableQuery.cpp line 1297
E/REALM_JNI: Exception has been throw: std::exception in /home/cc/repo/realm/realm-java-release/realm/realm-library/src/main/cpp/io_realm_internal_TableQuery.cpp line 1297
Thanks for confirming. Are you able to share you project, even privately? Because we would be very interested in seeing it (You can send it to [email protected]) ? Alternatively, could you try to enable full logging by adding RealmLog.setLogLevel(LogLevel.ALL) right after Realm.init()
Do you save each element in a new transaction, or all elements in a single transaction?
@Zhuinden each individual element is being saved in a single transaction. For each element being downloaded, I have to load up an existing parent object and save the new object within it. If the parent doesn't exist, I have to first create it, before adding the new object to it.
The elements aren't being downloaded in any particular order, so I don't think I can group and save them in one transaction.
@cmelchior I'll enable full logging and see what that uncovers right now, and I've raised the question with the team to find out what I can share with you.
@CDRussell It has been a while for this issue, we didn't get further information about the issue so i guess it has been solved (search in the mailbox, didn't find any with your name. If you have sent more info about this, please let us know the sender address.)
I am closing this now, please let us know this is not solved. thanks!!
I never got permission to obtain more info from the business.
The issue was still there, but I've since moved on to work at a different
company, so I couldn't even provide more details any more .
Happy for the issue to be closed.
On Tue, Sep 5, 2017, 13:14 Chen Mulong notifications@github.com wrote:
@CDRussell https://github.com/cdrussell It has been a while for this
issue, we didn't get further information about the issue so i guess it has
been solved (search in the mailbox, didn't find any with your name. If you
have sent more info about this, please let us know the sender address.)I am closing this now, please let us know this is not solved. thanks!!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/realm/realm-java/issues/2901#issuecomment-327157237,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABRj2eBQDc_p_PHxL1Lo3cst6RsFrjZaks5sfTsJgaJpZM4IpmQX
.
Still an issue using the realm-gradle plugin 4.3.3 on Android for Samsung J5 (2017) running Android 7.0.
I'm using Realm in my instrumented tests and want to clear it between each test. I'm clearing both the application cache and deleting the Realm file in the setup of each test. The crash only occurs when calling an async(...) function at run time the second time around.