This comes from the play developers console. So as of right now I don't have more data than just the crash
native: pc 000000000004ad34 /system/lib/libc.so (tgkill+12)
native: pc 00000000000484d3 /system/lib/libc.so (pthread_kill+34)
native: pc 000000000001d495 /system/lib/libc.so (raise+10)
native: pc 0000000000018fd1 /system/lib/libc.so (__libc_android_abort+34)
native: pc 0000000000017034 /system/lib/libc.so (abort+4)
native: pc 000000000012bb6b /data/app/com.anghami-1/lib/arm/librealm-jni.so
native: pc 000000000012bb97 /data/app/com.anghami-1/lib/arm/librealm-jni.so
native: pc 000000000012bbef /data/app/com.anghami-1/lib/arm/librealm-jni.so
native: pc 00000000000f20f1 /data/app/com.anghami-1/lib/arm/librealm-jni.so
native: pc 00000000000eff5d /data/app/com.anghami-1/lib/arm/librealm-jni.so
native: pc 00000000000f0145 /data/app/com.anghami-1/lib/arm/librealm-jni.so
native: pc 00000000000f1275 /data/app/com.anghami-1/lib/arm/librealm-jni.so
native: pc 000000000007fb7f /data/app/com.anghami-1/lib/arm/librealm-jni.so
native: pc 0000000000073871 /data/app/com.anghami-1/lib/arm/librealm-jni.so
native: pc 000000000002fdab /data/app/com.anghami-1/lib/arm/librealm-jni.so (Java_io_realm_internal_SharedRealm_nativeCommitTransaction+22)
native: pc 0000000000ecf96d /data/app/com.anghami-1/oat/arm/base.odex
Realm version(s): 3.5.0
Realm sync feature enabled:no
Android Studio version: Android Studio 3.0 beta 2
Which Android version and device: 2 devices have the crash:
This comes from our beta channel with 150 currently active users. Our production build sees around 6~7M monthly actives so we expect that this will become a lot more serious once we deploy there.
Do you have encryption enabled?
The app has 3 realms. One of them is encrypted(One is a volatile cache, one is the default realm for most stuff, and one handles the account information and is encrypted). I have no way of knowing which one this crash is coming from though
parsed backtrace
native: pc 000000000004ad34 /system/lib/libc.so (tgkill+12)
native: pc 00000000000484d3 /system/lib/libc.so (pthread_kill+34)
native: pc 000000000001d495 /system/lib/libc.so (raise+10)
native: pc 0000000000018fd1 /system/lib/libc.so (__libc_android_abort+34)
native: pc 0000000000017034 /system/lib/libc.so (abort+4)
native: pc 000000000012bb6b /data/app/com.anghami-1/lib/arm/librealm-jni.so please_report_this_error_to_help_at_realm_dot_io
native: pc 000000000012bb97 /data/app/com.anghami-1/lib/arm/librealm-jni.so realm::util::terminate_internal(std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >&)
native: pc 000000000012bbef /data/app/com.anghami-1/lib/arm/librealm-jni.so realm::util::terminate(char const*, char const*, long, std::initializer_list<realm::util::Printable>&&)
native: pc 00000000000f20f1 /data/app/com.anghami-1/lib/arm/librealm-jni.so realm::GroupWriter::write_group()
native: pc 00000000000eff5d /data/app/com.anghami-1/lib/arm/librealm-jni.so realm::SharedGroup::low_level_commit(unsigned long long)
native: pc 00000000000f0145 /data/app/com.anghami-1/lib/arm/librealm-jni.so realm::SharedGroup::do_commit()
native: pc 00000000000f1275 /data/app/com.anghami-1/lib/arm/librealm-jni.so realm::SharedGroup::commit_and_continue_as_read()
native: pc 000000000007fb7f /data/app/com.anghami-1/lib/arm/librealm-jni.so realm::_impl::RealmCoordinator::commit_write(realm::Realm&)
native: pc 0000000000073871 /data/app/com.anghami-1/lib/arm/librealm-jni.so realm::Realm::commit_transaction()
native: pc 000000000002fdab /data/app/com.anghami-1/lib/arm/librealm-jni.so (Java_io_realm_internal_SharedRealm_nativeCommitTransaction+22)
native: pc 0000000000ecf96d /data/app/com.anghami-1/oat/arm/base.odex
@raja-baz can you please share your apk with us so i can test it as well? to [email protected] if you want to share it privately.
@beeender Would you rather I send you one with the debug flag set to true or shall I get you the APK used for play store as-is?
@raja-baz do you mind to send both? :P
Fair enough, I'll email them now
Both APKs sent(2 separate emails due to 25MB limit from gmail, and APKs are 13MB and 19MB, so they didn't fit in one)
So according to the bug tracker on core this looks like it might have been fixed there, so can we expect that to be included in a realm-java release at some point soon?
It was released in core 3.0.0 but it seems to have been prepared for release in a 2.9.2.
I've heard that realm-java will have another minor version before 4.0.0, so that'll probably include 2.9.2.
Any timeline on that from the realm-java people?
We are preparing a 3.6.0 release the next couple of days. Unfortunately, it isn't certain that we are able to include the fix in that release. Me might be able to make a hotfix release after that, but in worst case it will have to wait for 4.0 which is at the end of september.
@raja-baz I have been checking you MigrationHelper.java and found one serious issue which may corrupt the realm file.
public class MigrationHelper {
public static final long REALM_VERSION = 13;
public static void migrate(DynamicRealm realm, long oldVersion, long newVersion) {
if (oldVersion < 2) {
Realm.deleteRealm(RealmConfig.sDefaultRealmConfig);
}
}
It is our bug the Realm.deleteRealm() doesn't check if it is in the migration block. In this situation that the realm file will be removed while a Realm instance is still opened.
Will your end user got into the block of oldVersion < 2? if yes, i guess that is the cause for most strange crashes.
No, that's an old piece of code that only ran for developers and very early
alpha testers. We used to have de delete-on-migration flag on for realm
version 1. When we moved to 2 we added this piece of code so that we'd
replicate the behavior once but drop the flag.
However, the earliest version that actual users on the beta channel got was
12
On Fri, Sep 1, 2017 at 6:46 AM Chen Mulong notifications@github.com wrote:
@raja-baz https://github.com/raja-baz I have been checking you
MigrationHelper.java and found one serious issue which may corrupt the
realm file.public class MigrationHelper {
public static final long REALM_VERSION = 13;public static void migrate(DynamicRealm realm, long oldVersion, long newVersion) {
if (oldVersion < 2) {
Realm.deleteRealm(RealmConfig.sDefaultRealmConfig);
}
}It is our bug the Realm.deleteRealm() doesn't check if it is in the
migration block. In this situation that the realm file will be removed
while a Realm instance is still opened.Will your end user got into the block of oldVersion < 2? if yes, i guess
that is the cause for most strange crashes.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/realm/realm-java/issues/5178#issuecomment-326479996,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABNP7nllqxAMfbx01Yk7yjpeWDAuxjZKks5sd34ogaJpZM4PIbzb
.
So 3.6.0 and 3.7.0 were both released, was the fix from core pulled in for any of those? Or are we waiting for 4.0.0?
You can try 4.0.0-Snapshot
@Zhuinden I'd much rather not, given that I can't downgrade. If I run into some major issue in production I'd be in pretty bad shape...
Hi @raja-baz
If possible we want to make a release before 4.0.0 with a hotfix for this, but due to some internal dependencies, it still isn't clear if that is going to be possible or not.
Okay then, thanks for the quick feedback
I can confirm that this crash is gone for realm 3.7.2.
Most helpful comment
I can confirm that this crash is gone for realm 3.7.2.