-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
6.1.0 to 7.0.0 file format upgrade crashes is very slow or can corrupt the file if aborted #6875
Comments
Hmm, that looks really weird. All the offsets Can you produce it locally? |
Thanks for the quick reply. I couldn't reproduce it locally. A broken aab would be an easy fix. If nothing else comes in your mind I will release an update later today with a freshly build aab. And let you know if it fixed the crashes. |
I made a fresh install of Android Studio and all the build dependencies etc. And released a new version but the same crash happens on Huawei devices. I also saw another crash which might have to do something with it? #00 pc 0000000000022988 /system/lib64/libc.so (abort+116)#1 pc 00000000002b21b4 /data/app/com.kptncook.app.kptncook-rAaYapy4SiGBFxjtDb5blQ==/split_config.arm64_v8a.apk (offset 0xde000) I call |
I had a similar crash. Here's what happened:
Once I restored the file and waited (and waited) eventually it resumed my app. I'm kind of concerned this might be an issue to some users. |
Hi @jpmcosta We are rewriting the file as part of the upgrade. I suspect it could take a while on some devices 😢, but it is a bit weird if this is only happening on Huawei devices. If it is just the rewrite taking time on Huawei devices a work-around would be to use |
I understand. Still, I feel that we should have some way of preventing the user from destroying the database if they lose patience. A backup file maybe? I was able to replicate the issue on my device (not Huawei) and on the emulator (API 29). It took almost 3 minutes to update the file on the emulator. I can confirm that closing the app will corrupt the file on the emulator as well. Maybe some Huawei devices will force close an app automatically if it freezes for a long time. I would say I'm always using |
Can you share the file with us? |
Unfortunately, I really can't, I'm sorry. All the information stored is potentially sensitive and personal. That's just the nature of the app. |
@jpmcosta If you can reproduce locally, would it be possible to basically overwrite the actual data with rubbish? We don't care and the actual content. It's more the structure that matters. |
Fair enough, I'll try to create a sample file myself. Can you tell me roughly the number of classes and how many objects that are in them? If you can share the schema that might also be helpful |
I was going to investigate if I was calling |
@cmelchior @bmunkholm so I just finished a test project: Where I stand right now:
Issues I noticed:
A few notes on how to reproduce the issues:
|
After further investigation I can also confirm that my app is freezing on As I said before, I either use |
We found one bug during the upgrade process: realm/realm-core#3751, but that still doesn't explain why the upgrade is so slow. |
We can reproduce the issue with your example project. Thank you very much for that. It takes 130 seconds to open the old file using an x86 emulator, while it only takes 1-2 seconds using Realm Studio. It is a bit unclear exactly what is causing this, but we are looking into it. Right now there are two issues:
Unfortunately, right now there is no really good way around 1) except using the |
@cmelchior thank you for looking into this. Unfortunately, I'm also having issues with |
I'll need to look closer into that. At least the example repo you created doesn't seem to have that behaviour, e.g. the FAB continues to be responsive during the upgrade. |
@cmelchior at least in my testing, if I close (back button) and reopen the app, the app will freeze (it won't even show the FAB). Maybe because it is trying to open a new instance (?); I didn't investigate any further. |
I'm getting reports similar to the initially reported crashes (with constant offset), but still on Realm
|
I'm receiving a similar report, after changing to 7.0.0 from 6.0.2. Affecting:
Currently on 10% rollout. Is this the same issue?
Edit: I'm new to these kind of stacktraces. Looks like this one doesn't give much insight into what's going on. My next step is to re-release as an APK instead of a bundle. Hopefully this will help. |
My company's app also stucks at 10% rollout. Please let us know about any kind of update and workaround until it's patched @cmelchior and if the apk release fixed it for you @Jonty800 . Thanks |
The bad news is, it's still happening on the APK rollout. 2 crashes so far, one contained a crash report with more details:
It feels like this only happens on arm and arm64 devices. I notice other users reporting the Huawei P30 Pro experiences this issue, however, I use the P30 Pro as my primary development device and have not experienced the issue. |
➤ Brian Munkholm commented: Now fixed in Core. Will be included in next Java release soon. |
7.0.1 has been released which should fix this. |
Goal
I upgraded realm from 6.1.0 to 7.0.0 and released it via .aab to the Play Store. And got these crashes which only seams to appear on Huawei devices.
Actual Results
#00 pc 000000000006f06c /apex/com.android.runtime/lib64/bionic/libc.so (abort+160)
#1 pc 00000000002b21b4 /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/split_config.arm64_v8a.apk!librealm-jni.so (offset 0xde000)
#2 pc 00000000002b2234 /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/split_config.arm64_v8a.apk!librealm-jni.so (offset 0xde000)
#3 pc 00000000002b2358 /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/split_config.arm64_v8a.apk!librealm-jni.so (offset 0xde000)
#4 pc 000000000023bd74 /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/split_config.arm64_v8a.apk!librealm-jni.so (offset 0xde000)
#5 pc 000000000023bc38 /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/split_config.arm64_v8a.apk!librealm-jni.so (offset 0xde000)
#6 pc 0000000000253a98 /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/split_config.arm64_v8a.apk!librealm-jni.so (offset 0xde000)
#7 pc 00000000001e974c /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/split_config.arm64_v8a.apk!librealm-jni.so (offset 0xde000)
#8 pc 00000000001e9690 /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/split_config.arm64_v8a.apk!librealm-jni.so (offset 0xde000)
#9 pc 00000000001e2d04 /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/split_config.arm64_v8a.apk!librealm-jni.so (offset 0xde000)
#10 pc 000000000028dfe4 /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/split_config.arm64_v8a.apk!librealm-jni.so (offset 0xde000)
#11 pc 00000000002514a8 /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/split_config.arm64_v8a.apk!librealm-jni.so (offset 0xde000)
#12 pc 0000000000255f88 /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/split_config.arm64_v8a.apk!librealm-jni.so (offset 0xde000)
#13 pc 0000000000255118 /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/split_config.arm64_v8a.apk!librealm-jni.so (offset 0xde000)
#14 pc 0000000000256140 /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/split_config.arm64_v8a.apk!librealm-jni.so (offset 0xde000)
#15 pc 0000000000258420 /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/split_config.arm64_v8a.apk!librealm-jni.so (offset 0xde000)
#16 pc 000000000018a2b0 /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/split_config.arm64_v8a.apk!librealm-jni.so (offset 0xde000)
#17 pc 0000000000189df0 /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/split_config.arm64_v8a.apk!librealm-jni.so (offset 0xde000)
#18 pc 0000000000189d74 /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/split_config.arm64_v8a.apk!librealm-jni.so (offset 0xde000)
#19 pc 0000000000176040 /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/split_config.arm64_v8a.apk!librealm-jni.so (offset 0xde000)
#20 pc 000000000011f07c /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/split_config.arm64_v8a.apk!librealm-jni.so (offset 0xde000) (Java_io_realm_internal_OsSharedRealm_nativeGetSharedRealm+132)
#21 pc 0000000000047324 /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/oat/arm64/base.odex (art_jni_trampoline+196)
#22 pc 00000000001445b8 /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_static_stub+568)
#23 pc 00000000001531c4 /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+284)
#24 pc 00000000002eed0c /apex/com.android.runtime/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+384)
#25 pc 00000000002eb070 /apex/com.android.runtime/lib64/libart.so (bool art::interpreter::DoCall<true, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+656)
#26 pc 00000000005c08c0 /apex/com.android.runtime/lib64/libart.so (MterpInvokeStaticRange+236)
#27 pc 000000000013ec94 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_static_range+20)
#28 pc 00000000005bbb2c /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/oat/arm64/base.vdex (io.realm.internal.OsSharedRealm.+108)
#29 pc 00000000005bd55c /apex/com.android.runtime/lib64/libart.so (MterpInvokeDirect+1168)
#30 pc 000000000013e914 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_direct+20)
#31 pc 00000000005bb8f6 /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/oat/arm64/base.vdex (io.realm.internal.OsSharedRealm.getInstance+26)
#32 pc 00000000005bdd68 /apex/com.android.runtime/lib64/libart.so (MterpInvokeStatic+1136)
#33 pc 000000000013e994 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_static+20)
#34 pc 000000000055d4b4 /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/oat/arm64/base.vdex (iw2.+176)
#35 pc 00000000005bd55c /apex/com.android.runtime/lib64/libart.so (MterpInvokeDirect+1168)
#36 pc 000000000013e914 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_direct+20)
#37 pc 000000000055d3e8 /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/oat/arm64/base.vdex (iw2.+8)
#38 pc 00000000005bd55c /apex/com.android.runtime/lib64/libart.so (MterpInvokeDirect+1168)
#39 pc 000000000013e914 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_direct+20)
#40 pc 000000000056bf6c /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/oat/arm64/base.vdex (hx2.+24)
#41 pc 00000000005bd55c /apex/com.android.runtime/lib64/libart.so (MterpInvokeDirect+1168)
#42 pc 000000000013e914 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_direct+20)
#43 pc 000000000056b9e8 /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/oat/arm64/base.vdex (hx2.a+4)
#44 pc 00000000005bdd68 /apex/com.android.runtime/lib64/libart.so (MterpInvokeStatic+1136)
#45 pc 000000000013e994 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_static+20)
#46 pc 0000000000566c08 /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/oat/arm64/base.vdex (ix2.a+8)
#47 pc 00000000005c13d8 /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtualQuick+1368)
#48 pc 0000000000142594 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual_quick+20)
#49 pc 00000000005667ce /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/oat/arm64/base.vdex (ix2.a+234)
#50 pc 00000000005c13d8 /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtualQuick+1368)
#51 pc 0000000000142594 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual_quick+20)
#52 pc 000000000056669e /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/oat/arm64/base.vdex (ix2.a+22)
#53 pc 00000000002bf948 /apex/com.android.runtime/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.8053280095303785888)+240)
#54 pc 00000000005a609c /apex/com.android.runtime/lib64/libart.so (artQuickToInterpreterBridge+1012)
#55 pc 000000000014d468 /apex/com.android.runtime/lib64/libart.so (art_quick_to_interpreter_bridge+88)
#56 pc 00000000001445b8 /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_static_stub+568)
#57 pc 00000000001531c4 /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+284)
#58 pc 00000000002eed0c /apex/com.android.runtime/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+384)
#59 pc 00000000002e9fdc /apex/com.android.runtime/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+912)
#60 pc 00000000005bda68 /apex/com.android.runtime/lib64/libart.so (MterpInvokeStatic+368)
#61 pc 000000000013e994 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_static+20)
#62 pc 000000000056ba88 /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/oat/arm64/base.vdex (hx2.A+56)
#63 pc 00000000005bdd68 /apex/com.android.runtime/lib64/libart.so (MterpInvokeStatic+1136)
#64 pc 000000000013e994 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_static+20)
#65 pc 0000000000489df2 /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/oat/arm64/base.vdex (com.kptncook.app.kptncook.MyApp.initRealm+74)
#66 pc 00000000005bd55c /apex/com.android.runtime/lib64/libart.so (MterpInvokeDirect+1168)
#67 pc 000000000013e914 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_direct+20)
#68 pc 000000000048a1da /data/app/com.kptncook.app.kptncook-vBUTjChUoqQX0NEcL2Qkgw==/oat/arm64/base.vdex (com.kptncook.app.kptncook.MyApp.onCreate+18)
#69 pc 00000000002bf948 /apex/com.android.runtime/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.8053280095303785888)+240)
#70 pc 00000000005a609c /apex/com.android.runtime/lib64/libart.so (artQuickToInterpreterBridge+1012)
#71 pc 000000000014d468 /apex/com.android.runtime/lib64/libart.so (art_quick_to_interpreter_bridge+88)
#72 pc 000000000042df7c /system/framework/arm64/boot-framework.oat (android.app.Instrumentation.callApplicationOnCreate+124)
#73 pc 000000000057c5fc /system/framework/arm64/boot-framework.oat (android.app.ActivityThread.handleBindApplication+7644)
#74 pc 0000000000571ea0 /system/framework/arm64/boot-framework.oat (android.app.ActivityThread$H.handleMessage+9056)
#75 pc 00000000008a5ff4 /system/framework/arm64/boot-framework.oat (android.os.Handler.dispatchMessage+180)
#76 pc 00000000008a95e0 /system/framework/arm64/boot-framework.oat (android.os.Looper.loop+1456)
#77 pc 00000000005859f4 /system/framework/arm64/boot-framework.oat (android.app.ActivityThread.main+1668)
#78 pc 00000000001445b8 /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_static_stub+568)
#79 pc 00000000001531c4 /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+284)
#80 pc 00000000004c6b6c /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104)
#81 pc 00000000004c8594 /apex/com.android.runtime/lib64/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+1476)
#82 pc 00000000004557fc /apex/com.android.runtime/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+52)
#83 pc 00000000000f7c34 /system/framework/arm64/boot.oat (art_jni_trampoline+180)
#84 pc 0000000000b135f8 /system/framework/arm64/boot-framework.oat (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+136)
#85 pc 0000000000b1b6c4 /system/framework/arm64/boot-framework.oat (com.android.internal.os.ZygoteInit.main+2596)
#86 pc 00000000001445b8 /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_static_stub+568)
#87 pc 00000000001531c4 /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+284)
#88 pc 00000000004c6b6c /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104)
#89 pc 00000000004c67d8 /apex/com.android.runtime/lib64/libart.so (art::InvokeWithVarArgs(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+408)
#90 pc 00000000003c60fc /apex/com.android.runtime/lib64/libart.so (art::JNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+636)
#91 pc 00000000000e25c4 /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+116)
#92 pc 00000000000e5aa4 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vectorandroid::String8 const&, bool)+828)
#93 pc 00000000000034e0 /system/bin/app_process64 (main+1168)
#94 pc 000000000006a050 /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+108)
Version of Realm and tooling
Realm version(s): 7.0.0
Realm Sync feature enabled: No
Android Studio version: 3.6.3
Android Build Tools version: 3.6.3
Gradle version: 6.4.1
Which Android version and device(s): HUAWEI P30, HUAWEI P30 lite, P30 Pro, Mate 20 lite, Mate 20 Pro, Mate 20, HUAWEI P smart 2019
The text was updated successfully, but these errors were encountered: