realm-java: App crashes randomly after updating Realm from 3.0.0 to 3.5.0
Realm version: 3.0.0 Device: Android SDK Simulator x86 with Android v7.1.1 Encryption: Un-encrypted Android studio V 2.3.2 Realm sync feature enabled: no
The app uses SyncAdapter. Whenever some local changes are made in realm, SyncAdapter would sync the changes with server using an API. All the local changes made due to some user interaction are made on main thread using executeTransaction() while the sync happens on a different thread.
Goal
We want to migrate Realm from 3.0.0 to 3.5.0. However, app crashes in some scenarios upon upgrade to 3.5.0. I.e. in case a local change is done and the sync triggers, the app crashes randomly when trying to persist the changes received in response. Two different stack traces were logged in Debug mode are mentioned below
Actual Results
Exception 1:
mport.dev.debug A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x20 in tid 855 (mport.dev.debug)
[ 08-01 14:46:55.785 1254: 1254 W/ ]
debuggerd: handling request: pid=855 uid=10072 gid=10072 tid=855
08-01 14:46:55.790 1747-1747/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
08-01 14:46:55.790 1747-1747/? A/DEBUG: Build fingerprint: 'Android/sdk_google_phone_x86/generic_x86:7.1.1/NYC/3756122:userdebug/test-keys'
08-01 14:46:55.790 1747-1747/? A/DEBUG: Revision: '0'
08-01 14:46:55.790 1747-1747/? A/DEBUG: ABI: 'x86'
08-01 14:46:55.790 1747-1747/? A/DEBUG: pid: 855, tid: 855, name: mport.dev.debug >>> <package name> <<<
08-01 14:46:55.790 1747-1747/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x20
08-01 14:46:55.790 1747-1747/? A/DEBUG: eax 00000000 ebx acc00ac0 ecx 00000011 edx 00000001
08-01 14:46:55.790 1747-1747/? A/DEBUG: esi 00000000 edi 00000000
08-01 14:46:55.790 1747-1747/? A/DEBUG: xcs 00000073 xds 0000007b xes 0000007b xfs 0000003b xss 0000007b
08-01 14:46:55.790 1747-1747/? A/DEBUG: eip aef531cc ebp bfbeb8a8 esp bfbeb8a8 flags 00210206
08-01 14:46:56.077 1747-1747/? A/DEBUG: backtrace:
08-01 14:46:56.077 1747-1747/? A/DEBUG: #00 pc 001dc1cc /system/lib/libskia.so (_ZN8SkMatrix12setTranslateEff+60)
08-01 14:46:56.077 1747-1747/? A/DEBUG: #01 pc 000f8be2 /system/lib/libandroid_runtime.so (_ZN7android12SkMatrixGlue12setTranslateEP7_JNIEnvP8_jobjectxff+50)
08-01 14:46:56.077 1747-1747/? A/DEBUG: #02 pc 0193374a /system/framework/x86/boot-framework.oat (offset 0x1584000) (android.graphics.Matrix.native_setTranslate+150)
08-01 14:46:56.077 1747-1747/? A/DEBUG: #03 pc 0193592b /system/framework/x86/boot-framework.oat (offset 0x1584000) (android.graphics.Matrix.setTranslate+71)
08-01 14:46:56.077 1747-1747/? A/DEBUG: #04 pc 0216528b /system/framework/x86/boot-framework.oat (offset 0x1584000) (android.widget.ImageView.configureBounds+631)
08-01 14:46:56.077 1747-1747/? A/DEBUG: #05 pc 0216688b /system/framework/x86/boot-framework.oat (offset 0x1584000) (android.widget.ImageView.updateDrawable+743)
08-01 14:46:56.077 1747-1747/? A/DEBUG: #06 pc 02168719 /system/framework/x86/boot-framework.oat (offset 0x1584000) (android.widget.ImageView.setImageDrawable+101)
08-01 14:46:56.077 1747-1747/? A/DEBUG: #07 pc 00109262 /system/lib/libart.so (art_quick_invoke_stub+338)
08-01 14:46:56.077 1747-1747/? A/DEBUG: #08 pc 00112d9d /system/lib/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+237)
08-01 14:46:56.077 1747-1747/? A/DEBUG: #09 pc 0031d596 /system/lib/libart.so (_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+294)
08-01 14:46:56.077 1747-1747/? A/DEBUG: #10 pc 00315437 /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+615)
08-01 14:46:56.077 1747-1747/? A/DEBUG: #11 pc 0067ede7 /system/lib/libart.so (MterpInvokeVirtualQuick+535)
08-01 14:46:56.077 1747-1747/? A/DEBUG: #12 pc 000ff2a1 /system/lib/libart.so (artMterpAsmInstructionStart+29857)
08-01 14:46:56.077 1747-1747/? A/DEBUG: #13 pc 002e5e98 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+488)
08-01 14:46:56.077 1747-1747/? A/DEBUG: #14 pc 002ed6e0 /system/lib/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+192)
08-01 14:46:56.077 1747-1747/? A/DEBUG: #15 pc 00316612 /system/lib/libart.so (_ZN3art11interpreter6DoCallILb1ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+450)
08-01 14:46:56.077 1747-1747/? A/DEBUG: #16 pc 0067e3bd /system/lib/libart.so (MterpInvokeDirectRange+461)
08-01 14:46:56.077 1747-1747/? A/DEBUG: #17 pc 000fb921 /system/lib/libart.so (artMterpAsmInstructionStart+15137)
08-01 14:46:56.077 1747-1747/? A/DEBUG: #18 pc 002e5e98 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+488)
08-01 14:46:56.077 1747-1747/? A/DEBUG: #19 pc 002ed6e0 /system/lib/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+192)
08-01 14:46:56.077 1747-1747/? A/DEBUG: #20 pc 0031541b /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+587)
08-01 14:46:56.077 1747-1747/? A/DEBUG: #21 pc 0067bde2 /system/lib/libart.so (MterpInvokeInterface+1474)
08-01 14:46:56.077 1747-1747/? A/DEBUG: #22 pc 000fb721 /system/lib/libart.so (artMterpAsmInstructionStart+14625)
08-01 14:46:56.078 1747-1747/? A/DEBUG: #23 pc 002e5e98 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+488)
08-01 14:46:56.078 1747-1747/? A/DEBUG: #24 pc 002ed6e0 /system/lib/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+192)
08-01 14:46:56.078 1747-1747/? A/DEBUG: #25 pc 0031541b /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+587)
08-01 14:46:56.078 1747-1747/? A/DEBUG: #26 pc 0067c110 /system/lib/libart.so (MterpInvokeDirect+464)
08-01 14:46:56.078 1747-1747/? A/DEBUG: #27 pc 000fb621 /system/lib/libart.so (artMterpAsmInstructionStart+14369)
08-01 14:46:56.078 1747-1747/? A/DEBUG: #28 pc 002e5e98 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+488)
08-01 14:46:56.079 1747-1747/? A/DEBUG: #29 pc 002ed6e0 /system/lib/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+192)
08-01 14:46:56.079 1747-1747/? A/DEBUG: #30 pc 0031541b /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+587)
08-01 14:46:56.079 1747-1747/? A/DEBUG: #31 pc 0067ede7 /system/lib/libart.so (MterpInvokeVirtualQuick+535)
08-01 14:46:56.079 1747-1747/? A/DEBUG: #32 pc 000ff2a1 /system/lib/libart.so (artMterpAsmInstructionStart+29857)
08-01 14:46:56.079 1747-1747/? A/DEBUG: #33 pc 002e5e98 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+488)
08-01 14:46:56.079 1747-1747/? A/DEBUG: #34 pc 002ed6e0 /system/lib/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+192)
08-01 14:46:56.079 1747-1747/? A/DEBUG: #35 pc 0031541b /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+587)
08-01 14:46:56.079 1747-1747/? A/DEBUG: #36 pc 0067bde2 /system/lib/libart.so (MterpInvokeInterface+1474)
08-01 14:46:56.079 1747-1747/? A/DEBUG: #37 pc 000fb721 /system/lib/libart.so (artMterpAsmInstructionStart+14625)
08-01 14:46:56.079 1747-1747/? A/DEBUG: #38 pc 002e5e98 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+488)
08-01 14:46:56.080 1747-1747/? A/DEBUG: #39 pc 002ed6e0 /system/lib/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+192)
08-01 14:46:56.080 1747-1747/? A/DEBUG: #40 pc 0031541b /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+587)
08-01 14:46:56.080 1747-1747/? A/DEBUG: #41 pc 0067bde2 /system/lib/libart.so (MterpInvokeInterface+1474)
08-01 14:46:56.080 1747-1747/? A/DEBUG: #42 pc 000fb721 /system/lib/libart.so (artMterpAsmInstructionStart+14625)
08-01 14:46:56.080 1747-1747/? A/DEBUG: #43 pc 002e5e98 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+488)
08-01 14:46:56.080 1747-1747/? A/DEBUG: #44 pc 002ed6e0 /system/lib/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+192)
08-01 14:46:56.080 1747-1747/? A/DEBUG: #45 pc 0031541b /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+587)
08-01 14:46:56.080 1747-1747/? A/DEBUG: #46 pc 0067ede7 /system/lib/libart.so (MterpInvokeVirtualQuick+535)
08-01 14:46:56.080 1747-1747/? A/DEBUG: #47 pc 000ff2a1 /system/lib/libart.so (artMterpAsmInstructionStart+29857)
08-01 14:46:56.080 1747-1747/? A/DEBUG: #48 pc 002e5e98 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+488)
08-01 14:46:56.080 1747-1747/? A/DEBUG: #49 pc 002ed5f0 /system/lib/libart.so (_ZN3art11interpreter30EnterInterpreterFromEntryPointEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameE+176)
08-01 14:46:56.080 1747-1747/? A/DEBUG: #50 pc 0066cf79 /system/lib/libart.so (artQuickToInterpreterBridge+1049)
08-01 14:46:56.080 1747-1747/? A/DEBUG: #51 pc 0010f39d /system/lib/libart.so (art_quick_to_interpreter_bridge+77)
08-01 14:46:56.080 1747-1747/? A/DEBUG: #52 pc 00014e03 /dev/ashmem/dalvik-jit-code-cache (deleted)
[ 08-01 14:46:56.255 1254: 1254 W/ ]
debuggerd: resuming target 855
Exception 2:
mport.dev.debug A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x20 in tid 32429 (mport.dev.debug)
[ 08-01 18:21:48.093 1254: 1254 W/ ]
debuggerd: handling request: pid=32429 uid=10074 gid=10074 tid=32429
08-01 18:21:48.102 4223-4223/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
08-01 18:21:48.103 4223-4223/? A/DEBUG: Build fingerprint: 'Android/sdk_google_phone_x86/generic_x86:7.1.1/NYC/3756122:userdebug/test-keys'
08-01 18:21:48.103 4223-4223/? A/DEBUG: Revision: '0'
08-01 18:21:48.103 4223-4223/? A/DEBUG: ABI: 'x86'
08-01 18:21:48.103 4223-4223/? A/DEBUG: pid: 32429, tid: 32429, name: mport.dev.debug >>> mport.dev.debug <<<
08-01 18:21:48.103 4223-4223/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x20
08-01 18:21:48.103 4223-4223/? A/DEBUG: eax 00000000 ebx acc00ac0 ecx 00000011 edx 00000001
08-01 18:21:48.103 4223-4223/? A/DEBUG: esi 00000000 edi 00000000
08-01 18:21:48.103 4223-4223/? A/DEBUG: xcs 00000073 xds 0000007b xes 0000007b xfs 0000003b xss 0000007b
08-01 18:21:48.103 4223-4223/? A/DEBUG: eip aef531cc ebp bfbed708 esp bfbed708 flags 00010206
08-01 18:21:48.390 4223-4223/? A/DEBUG: backtrace:
08-01 18:21:48.390 4223-4223/? A/DEBUG: #00 pc 001dc1cc /system/lib/libskia.so (_ZN8SkMatrix12setTranslateEff+60)
08-01 18:21:48.390 4223-4223/? A/DEBUG: #01 pc 000f8be2 /system/lib/libandroid_runtime.so (_ZN7android12SkMatrixGlue12setTranslateEP7_JNIEnvP8_jobjectxff+50)
08-01 18:21:48.390 4223-4223/? A/DEBUG: #02 pc 0193374a /system/framework/x86/boot-framework.oat (offset 0x1584000) (android.graphics.Matrix.native_setTranslate+150)
08-01 18:21:48.390 4223-4223/? A/DEBUG: #03 pc 0193592b /system/framework/x86/boot-framework.oat (offset 0x1584000) (android.graphics.Matrix.setTranslate+71)
08-01 18:21:48.390 4223-4223/? A/DEBUG: #04 pc 0216528b /system/framework/x86/boot-framework.oat (offset 0x1584000) (android.widget.ImageView.configureBounds+631)
08-01 18:21:48.390 4223-4223/? A/DEBUG: #05 pc 0216688b /system/framework/x86/boot-framework.oat (offset 0x1584000) (android.widget.ImageView.updateDrawable+743)
08-01 18:21:48.390 4223-4223/? A/DEBUG: #06 pc 02168719 /system/framework/x86/boot-framework.oat (offset 0x1584000) (android.widget.ImageView.setImageDrawable+101)
08-01 18:21:48.390 4223-4223/? A/DEBUG: #07 pc 00109262 /system/lib/libart.so (art_quick_invoke_stub+338)
08-01 18:21:48.390 4223-4223/? A/DEBUG: #08 pc 00112d9d /system/lib/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+237)
08-01 18:21:48.390 4223-4223/? A/DEBUG: #09 pc 0031d596 /system/lib/libart.so (_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+294)
08-01 18:21:48.390 4223-4223/? A/DEBUG: #10 pc 00315437 /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+615)
08-01 18:21:48.390 4223-4223/? A/DEBUG: #11 pc 0067ede7 /system/lib/libart.so (MterpInvokeVirtualQuick+535)
08-01 18:21:48.390 4223-4223/? A/DEBUG: #12 pc 000ff2a1 /system/lib/libart.so (artMterpAsmInstructionStart+29857)
08-01 18:21:48.390 4223-4223/? A/DEBUG: #13 pc 002e5e98 /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+488)
08-01 18:21:48.390 4223-4223/? A/DEBUG: #14 pc 002ed5f0 /system/lib/libart.so (_ZN3art11interpreter30EnterInterpreterFromEntryPointEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameE+176)
08-01 18:21:48.390 4223-4223/? A/DEBUG: #15 pc 0066cf79 /system/lib/libart.so (artQuickToInterpreterBridge+1049)
08-01 18:21:48.390 4223-4223/? A/DEBUG: #16 pc 0010f39d /system/lib/libart.so (art_quick_to_interpreter_bridge+77)
08-01 18:21:48.390 4223-4223/? A/DEBUG: #17 pc 000bdde9 /dev/ashmem/dalvik-jit-code-cache (deleted)
Steps & Code to Reproduce
We could not pin point an exact reason why this happens. Went through the change log 3.0.0 onwards but we are unable to identify any particular change that can cause this. Based on the logs that we added, we can see that the transactions get completed successfully and it crashes after few milliseconds.
It would be great if you can pinpoint if this is a bug or something could be wrong at our end
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 55 (32 by maintainers)
Commits related to this issue
- try to produce the crash https://github.com/realm/realm-java/issues/5056 — committed to realm/realm-android-adapters by beeender 7 years ago
@eikaramba I can reproduce it on arm device. Checking now.
We finally got a working demo application with the crash and i send it to @beeender along with the sourcceode, hopefully this will resolve this issue.
any news ?