Skip to content
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

Help: Destruction of mutex in use #5578

Closed
lam-amsiq opened this issue Dec 1, 2017 · 36 comments
Closed

Help: Destruction of mutex in use #5578

lam-amsiq opened this issue Dec 1, 2017 · 36 comments

Comments

@lam-amsiq
Copy link

lam-amsiq commented Dec 1, 2017

Where to find log and how to upload log?

12-01 15:17:16.390 12244-12352/com.app E/REALM: /home/jenkins/workspace/realm_realm-core_PR-2921-KRZQVOGV6QNV4VTLKF7FZYBJS45TOKJXEZA7N2KFU6F5R5HNA7CA@6/src/realm/util/thread.cpp:183: [realm-core-4.0.3] Destruction of mutex in use
                                                   IMPORTANT: if you see this error, please send this log to help@realm.io.
12-01 15:17:16.390 12244-12352/com.app A/libc: Fatal signal 6 (SIGABRT) at 0x00002fd4 (code=-6), thread 12352 (RealmFinalizing)

Version of Realm and tooling

Realm version(s):
4.2.0
Android Studio version:
4.4.4
Which Android version and device:
Samsung Galaxy S3

@beeender
Copy link
Contributor

beeender commented Dec 1, 2017

can you reproduce it locally? can you get a full logcat for us? with adb logcat -v thread

@lam-amsiq
Copy link
Author

I( 2411: 2706) Touch event's action is 0x0 (deviceType=0) [pCnt=1, s=0.935 ] when=24580343974000
I( 2411: 2705) Delivering touch to (2794): action: 0x4, toolType: 1
I( 2411: 2705) Delivering touch to (22962): action: 0x0, toolType: 1
I( 2411: 2706) Touch event's action is 0x1 (deviceType=0) [pCnt=1, s=] when=24580418147000
I( 2411: 2705) Delivering touch to (22962): action: 0x1, toolType: 1
D(22962:23041) GC_FOR_ALLOC freed 15693K, 31% free 48195K/69484K, paused 119ms, total 119ms
D(22962:23170) <-- 200 OK https://www.soudfa.com/api/accounts/1125747/relations/2342287 (174ms, unknown-length body)
E(22962:23028) /home/jenkins/workspace/realm_realm-core_PR-2921-KRZQVOGV6QNV4VTLKF7FZYBJS45TOKJXEZA7N2KFU6F5R5HNA7CA@6/src/realm/util/thread.cpp:183: [realm-core-4.0.3] Destruction of mutex in use
E(22962:23028) IMPORTANT: if you see this error, please send this log to help@realm.io.
F(22962:23028) Fatal signal 6 (SIGABRT) at 0x000059b2 (code=-6), thread 23028 (RealmFinalizing)
D( 2794: 2794) onSignalStrengthsChanged signalStrength=SignalStrength: 99 99 -120 -160 -120 -1 -1 29 -90 -13 184 -1 2147483647 gsm|lte 0x3000 level=3
I( 1987: 1987) *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I( 1987: 1987) Build fingerprint: 'samsung/m3xx/m3:4.4.4/KTU84P/I9305XXSFQD1:user/release-keys'
I( 1987: 1987) Revision: '2'
I( 1987: 1987) pid: 22962, tid: 23028, name: RealmFinalizing  >>> com.soudfa <<<
I( 1987: 1987) signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
I( 2411: 2706) Touch event's action is 0x0 (deviceType=0) [pCnt=1, s=0.936 ] when=24580684859000
I( 2411: 2705) Delivering touch to (2794): action: 0x4, toolType: 1
I( 2411: 2705) Delivering touch to (22962): action: 0x0, toolType: 1
I( 1987: 1987)     r0 00000000  r1 000059f4  r2 00000006  r3 00000000
I( 1987: 1987)     r4 00000006  r5 00000000  r6 000059f4  r7 0000010c
I( 1987: 1987)     r8 000000b7  r9 62c1b282  sl 62c3e6b8  fp 655b7b24
I( 1987: 1987)     ip 62c1b266  sp 655b7920  lr 401be115  pc 401cd194  cpsr 000f0010
I( 1987: 1987)     d0  6d6c61655d332e30  d1  2e342d65726f632d
I( 1987: 1987)     d2  464b324e37415a45  d3  4e48355235463655
I( 1987: 1987)     d4  732f364041433741  d5  6d6c6165722f6372
I( 1987: 1987)     d6  68742f6c6974752f  d7  7070632e64616572
I( 1987: 1987)     d8  0000000000000000  d9  0000000000000000
I( 1987: 1987)     d10 0000000000000000  d11 0000000000000000
I( 1987: 1987)     d12 0000000000000000  d13 0000000000000000
I( 1987: 1987)     d14 0000000000000000  d15 0000000000000000
I( 1987: 1987)     d16 0200000018001001  d17 03ffffffff000000
I( 1987: 1987)     d18 4000000000000000  d19 3fd99b1de9244fe5
I( 1987: 1987)     d20 3f94e5e0a72f0539  d21 3fe5564ef4dbaa19
I( 1987: 1987)     d22 3fd24a6255bd7b19  d23 3fcc73dc2662e9c9
I( 2411: 2706) Touch event's action is 0x1 (deviceType=0) [pCnt=1, s=] when=24580769371000
I( 1987: 1987)     d24 3fc748699baf1b25  d25 3fc2f112df3e5244
I( 1987: 1987)     d26 3ff193ea7aad030a  d27 0000000000000000
I( 1987: 1987)     d28 0000000000000000  d29 0000000000000000
I( 2411: 2705) Delivering touch to (22962): action: 0x1, toolType: 1
I( 1987: 1987)     d30 0000000000000000  d31 0000000000000000
I( 1987: 1987)     scr 60000010
I( 1987: 1987) 
I( 1987: 1987) backtrace:
I( 1987: 1987)     #00  pc 00022194  /system/lib/libc.so (tgkill+12)
I( 1987: 1987)     #01  pc 00013111  /system/lib/libc.so (pthread_kill+48)
I( 1987: 1987)     #02  pc 00013325  /system/lib/libc.so (raise+10)
I( 1987: 1987)     #03  pc 0001205b  /system/lib/libc.so
I( 1987: 1987)     #04  pc 00021a48  /system/lib/libc.so (abort+4)
I( 1987: 1987)     #05  pc 0014189b  /data/app-lib/com.soudfa-4/librealm-jni.so
I( 1987: 1987)     #06  pc 001418c7  /data/app-lib/com.soudfa-4/librealm-jni.so
I( 1987: 1987) 
I( 1987: 1987) stack:
I( 1987: 1987)          655b78e0  655b78b8  
I( 1987: 1987)          655b78e4  62c32336  
I( 1987: 1987)          655b78e8  655b79a8  
I( 1987: 1987)          655b78ec  655b7a00  
I( 1987: 1987)          655b78f0  00000000  
I( 1987: 1987)          655b78f4  00000003  
I( 1987: 1987)          655b78f8  0000010b  
I( 1987: 1987)          655b78fc  70be5bbc  
I( 1987: 1987)          655b7900  00000110  
I( 1987: 1987)          655b7904  40006000  
I( 1987: 1987)          655b7908  68737228  
I( 1987: 1987)          655b790c  401bbf9b  /system/lib/libc.so (dlmalloc+4254)
I( 1987: 1987)          655b7910  40087115  /system/lib/liblog.so
I( 1987: 1987)          655b7914  62c1b174  /data/app-lib/com.soudfa-4/librealm-jni.so
I( 1987: 1987)          655b7918  401f51d8  /system/lib/libc.so
I( 1987: 1987)          655b791c  41a40008  
I( 1987: 1987)     #00  655b7920  00000006  
I( 1987: 1987)          655b7924  00000000  
I( 1987: 1987)          655b7928  000059f4  
I( 1987: 1987)          655b792c  62c1b266  /data/app-lib/com.soudfa-4/librealm-jni.so
I( 1987: 1987)          655b7930  62c1b266  /data/app-lib/com.soudfa-4/librealm-jni.so
I( 1987: 1987)          655b7934  401be115  /system/lib/libc.so (pthread_kill+52)
I( 1987: 1987)     #01  655b7938  00000006  
I( 1987: 1987)          655b793c  00000000  
I( 1987: 1987)          655b7940  655b7a60  
I( 1987: 1987)          655b7944  401be329  /system/lib/libc.so (raise+14)
I( 1987: 1987)     #02  655b7948  655b7954  
I( 1987: 1987)          655b794c  401bd05f  /system/lib/libc.so
I( 1987: 1987) 
I( 1987: 1987) memory near r1:
I( 1987: 1987)     000059d4 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     000059e4 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     000059f4 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     00005a04 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     00005a14 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     00005a24 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     00005a34 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     00005a44 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     00005a54 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     00005a64 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     00005a74 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     00005a84 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     00005a94 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     00005aa4 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     00005ab4 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     00005ac4 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987) 
I( 1987: 1987) memory near r6:
I( 1987: 1987)     000059d4 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     000059e4 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     000059f4 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     00005a04 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     00005a14 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     00005a24 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     00005a34 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     00005a44 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     00005a54 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     00005a64 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     00005a74 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     00005a84 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     00005a94 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     00005aa4 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     00005ab4 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987)     00005ac4 ffffffff ffffffff ffffffff ffffffff  
I( 1987: 1987) 
I( 1987: 1987) memory near r9:
I( 1987: 1987)     62c1b260 656c6961 65440064 75727473 6f697463  
I( 1987: 1987)     62c1b270 666f206e 74756d20 69207865 7375206e  
I( 1987: 1987)     62c1b280 682f0065 2f656d6f 6b6e656a 2f736e69  
I( 1987: 1987)     62c1b290 6b726f77 63617073 65722f65 5f6d6c61  
I( 1987: 1987)     62c1b2a0 6c616572 6f632d6d 505f6572 39322d52  
I( 1987: 1987)     62c1b2b0 4b2d3132 56515a52 3656474f 34564e51  
I( 1987: 1987)     62c1b2c0 4b4c5456 5a463746 534a4259 4f543534  
I( 1987: 1987)     62c1b2d0 45584a4b 4e37415a 55464b32 52354636  
I( 1987: 1987)     62c1b2e0 414e4835 40414337 72732f36 65722f63  
I( 1987: 1987)     62c1b2f0 2f6d6c61 6c697475 7268742f 2e646165  
I( 1987: 1987)     62c1b300 00707063 72687470 5f646165 6574756d  
I( 1987: 1987)     62c1b310 65645f78 6f727473 20292879 6c696166  
I( 1987: 1987)     62c1b320 70006465 65726874 6d5f6461 78657475  
I( 1987: 1987)     62c1b330 636f6c5f 2029286b 6c696166 203a6465  
I( 1987: 1987)     62c1b340 75636552 76697372 6f6c2065 6e696b63  
I( 1987: 1987)     62c1b350 666f2067 74756d20 28207865 64616564  
I( 1987: 1987) 
I( 1987: 1987) memory near sl:
I( 1987: 1987)     62c3e698 00020182 03040200 00000010 0000045b  
I( 1987: 1987)     62c3e6a8 61aa6f86 64f08f68 584e4148 620f6000  
I( 1987: 1987)     62c3e6b8 42a67108 00000000 655b7c40 00000000  
I( 1987: 1987)     62c3e6c8 655b7c94 0000002d 00000000 41c4ad00  
I( 1987: 1987)     62c3e6d8 00000000 00000000 574f7270 64f05300  
I( 1987: 1987)     62c3e6e8 00000000 00000000 00000001 00004000  
I( 1987: 1987)     62c3e6f8 00000000 64f2af28 41c4ad00 41c4fbc0  
I( 1987: 1987)     62c3e708 00000000 41c53cbc 41c53d30 41c53be0  
I( 1987: 1987)     62c3e718 41c53c00 41c53c5c 00000000 00000000  
I( 1987: 1987)     62c3e728 64d64e20 00000028 00000000 00000000  
I( 1987: 1987)     62c3e738 00000000 00000006 00002000 41cec33c  
I( 1987: 1987)     62c3e748 00000000 584e4108 00000001 64f2b170  
I( 1987: 1987)     62c3e758 00000001 00000040 00000200 00000004  
I( 1987: 1987)     62c3e768 00000003 61aa70ba 61aa70ba 00000007  
I( 1987: 1987)     62c3e778 61aa70c8 584e4148 00000000 00000000  
I( 1987: 1987)     62c3e788 90d837da 00000000 00000000 00000000  
I( 1987: 1987) 
I( 1987: 1987) memory near fp:
I( 1987: 1987)     655b7b04 41c4ab90 73a12ef0 00000000 64f08f68  
I( 1987: 1987)     655b7b14 00000001 00000008 42882240 428099d8  
I( 1987: 1987)     655b7b24 41c7b12f 64f08f68 61e0cb42 62a84765  
I( 1987: 1987)     655b7b34 62c3e6b8 76d23f68 401bbf9b 42100001  
I( 1987: 1987)     655b7b44 00000000 41cec0e8 401f9384 62c3e6d0  
I( 1987: 1987)     655b7b54 ffffbfff 62c3e6d0 41ca1041 62c3e6a8  
I( 1987: 1987)     655b7b64 76d23f68 00000000 00000028 41ce6c44  
I( 1987: 1987)     655b7b74 41ca6dcd 61aa70c2 61aa70c8 0000002a  
I( 1987: 1987)     655b7b84 584e4108 00000004 00000006 00000020  
I( 1987: 1987)     655b7b94 00000020 401f91d0 00000020 78e88778  
I( 1987: 1987)     655b7ba4 401bbf9b 00000000 41cebf28 00000000  
I( 1987: 1987)     655b7bb4 62c3ea38 ffffffd6 00000000 00000000  
I( 1987: 1987)     655b7bc4 401ba004 00000000 a6339c4c 62c3ea48  
I( 1987: 1987)     655b7bd4 62c3ea38 00000000 62c3e6a8 64f26b78  
I( 1987: 1987)     655b7be4 a6339c4c a6339c4c 428033e4 428033e0  
I( 1987: 1987)     655b7bf4 62c3e6a8 0000002d 00000168 1dcd64ff  
I( 1987: 1987) 
I( 1987: 1987) memory near ip:
I( 1987: 1987)     62c1b244 74700064 61657268 756d5f64 61786574  
I( 1987: 1987)     62c1b254 5f727474 74696e69 66202928 656c6961  
I( 1987: 1987)     62c1b264 65440064 75727473 6f697463 666f206e  
I( 1987: 1987)     62c1b274 74756d20 69207865 7375206e 682f0065  
I( 1987: 1987)     62c1b284 2f656d6f 6b6e656a 2f736e69 6b726f77  
I( 1987: 1987)     62c1b294 63617073 65722f65 5f6d6c61 6c616572  
I( 1987: 1987)     62c1b2a4 6f632d6d 505f6572 39322d52 4b2d3132  
I( 1987: 1987)     62c1b2b4 56515a52 3656474f 34564e51 4b4c5456  
I( 1987: 1987)     62c1b2c4 5a463746 534a4259 4f543534 45584a4b  
I( 1987: 1987)     62c1b2d4 4e37415a 55464b32 52354636 414e4835  
I( 1987: 1987)     62c1b2e4 40414337 72732f36 65722f63 2f6d6c61  
I( 1987: 1987)     62c1b2f4 6c697475 7268742f 2e646165 00707063  
I( 1987: 1987)     62c1b304 72687470 5f646165 6574756d 65645f78  
I( 1987: 1987)     62c1b314 6f727473 20292879 6c696166 70006465  
I( 1987: 1987)     62c1b324 65726874 6d5f6461 78657475 636f6c5f  
I( 1987: 1987)     62c1b334 2029286b 6c696166 203a6465 75636552  
I( 1987: 1987) 
I( 1987: 1987) memory near sp:
I( 1987: 1987)     655b7900 00000110 40006000 68737228 401bbf9b  
I( 1987: 1987)     655b7910 40087115 62c1b174 401f51d8 41a40008  
I( 1987: 1987)     655b7920 00000006 00000000 000059f4 62c1b266  
I( 1987: 1987)     655b7930 62c1b266 401be115 00000006 00000000  
I( 1987: 1987)     655b7940 655b7a60 401be329 655b7954 401bd05f  
I( 1987: 1987)     655b7950 000000b7 ffffffdf 401f5000 655b798c  
I( 1987: 1987)     655b7960 655b798c 655b799c 655b7a60 655b798c  
I( 1987: 1987)     655b7970 655b799c 401cca4c 00000000 62ba289f  
I( 1987: 1987)     655b7980 00000000 62ba28cb 655b799c 68737234  
I( 1987: 1987)     655b7990 62c25928 62ba2923 00000000 62c25914  
I( 1987: 1987)     655b79a0 00000000 62c25928 62c2b1d8 70be5bbc  
I( 1987: 1987)     655b79b0 70be5bbc 70be5bbd 70be5bbc 70be5cba  
I( 1987: 1987)     655b79c0 70be5dbc 62c31cb4 00000018 70be5bbc  
I( 1987: 1987)     655b79d0 62c2593c 00000006 00000000 00001002  
I( 1987: 1987)     655b79e0 00000000 00000000 00000000 00000000  
I( 1987: 1987)     655b79f0 00000000 00000000 00000000 00000000  
I( 1987: 1987) 
I( 1987: 1987) code around pc:
I( 1987: 1987)     401cd174 e8bd00f0 e3700a01 912fff1e e2600000  
I( 1987: 1987)     401cd184 ea006ecc e92d50f0 e3a07f43 ef000000  
I( 1987: 1987)     401cd194 e8bd50f0 e3700a01 912fff1e e2600000  
I( 1987: 1987)     401cd1a4 ea006ec4 e92d50f0 e3a070ee ef000000  
I( 1987: 1987)     401cd1b4 e8bd50f0 e3700a01 912fff1e e2600000  
I( 1987: 1987)     401cd1c4 ea006ebc f200429a bf0080f7 f000f891  
I( 1987: 1987)     401cd1d4 4001e92d f040f891 d3532a10 0301ea80  
I( 1987: 1987)     401cd1e4 0303f013 806ef000 d3262ae0 0300f1c0  
I( 1987: 1987)     401cd1f4 030ff013 eba2d021 ea5f0203 bf447cc3  
I( 1987: 1987)     401cd204 eb01f811 eb01f800 f811bf21 f811cb01  
I( 1987: 1987)     401cd214 f800eb01 f800cb01 ea5feb01 da037c43  
I( 1987: 1987)     401cd224 080df9a1 083df980 f921d303 f900070d  
I( 1987: 1987)     401cd234 f891071d f891f000 3a40f040 f891d30f  
I( 1987: 1987)     401cd244 f891f080 f921f0c0 f921020d f891420d  
I( 1987: 1987)     401cd254 3a40f0c0 020df900 420df900 f102d2f3  
I( 1987: 1987)     401cd264 3a200240 f921d305 3a20020d 020df900  
I( 1987: 1987) 
I( 1987: 1987) code around lr:
I( 1987: 1987)     401be0f4 447b4b13 42b3e010 6a1ed10e 44784811  
I( 1987: 1987)     401be104 ec84f7fb ea78f00d 46224631 e83af00f  
I( 1987: 1987)     401be114 d00a3001 e00b2400 2b00681b 480ad1eb  
I( 1987: 1987)     401be124 44782403 ec72f7fb f001e002 6804fa8f  
I( 1987: 1987)     401be134 fa8cf001 46206005 bf00bd70 0003b2ae  
I( 1987: 1987)     401be144 0003b2a2 0003b29a 0003b276 bf7ef7ff  
I( 1987: 1987)     401be154 4a3e4b3d e92d447b b08b43f0 4606589c  
I( 1987: 1987)     401be164 6823460d 930946a1 fa70f001 8000f8d0  
I( 1987: 1987)     401be174 d0482d00 f00f4628 280fff23 d8444604  
I( 1987: 1987)     401be184 ffe4f7ff d1064286 4629200f e942f00d  
I( 1987: 1987)     401be194 d03c2800 482ee02e f7fb4478 482debb6  
I( 1987: 1987)     401be1a4 e0154478 d11342b0 482b6a06 f7fb4478  
I( 1987: 1987)     401be1b4 4a2aec2e 46332120 a801447a fa96f013  
I( 1987: 1987)     401be1c4 a8012101 fdb4f01a 46061c42 e011d104  
I( 1987: 1987)     401be1d4 28006800 e02cd1e6 46294630 f00d4622  
I( 1987: 1987)     401be1e4 1c43e97e d11e4607 fa30f001 29046801  
I( 2411: 2706) Touch event's action is 0x0 (deviceType=0) [pCnt=1, s=0.937 ] when=24580983042000
D( 2411: 2705) Waiting for application to become ready for input: xxxx Reason: Waiting because the touched window has not finished processing the input events that were previously delivered to it.
I( 2411: 2706) Touch event's action is 0x1 (deviceType=0) [pCnt=1, s=] when=24581067745000
I( 2411: 2706) Touch event's action is 0x0 (deviceType=0) [pCnt=1, s=0.938 ] when=24581292217000
I( 2411: 2706) Touch event's action is 0x1 (deviceType=0) [pCnt=1, s=] when=24581376395000
I( 2411: 2706) Touch event's action is 0x0 (deviceType=0) [pCnt=1, s=0.939 ] when=24581601175000
I( 2411: 2706) Touch event's action is 0x1 (deviceType=0) [pCnt=1, s=] when=24581674801000
E( 2411: 2905) !@Sync 817
I( 2411: 2706) Touch event's action is 0x0 (deviceType=0) [pCnt=1, s=0.940 ] when=24581909549000
I( 2411: 2706) Touch event's action is 0x1 (deviceType=0) [pCnt=1, s=] when=24582025864000
I( 2411: 2706) Touch event's action is 0x0 (deviceType=0) [pCnt=1, s=0.941 ] when=24582261669000
D( 2794: 2794) refreshSignalCluster - setNWBoosterIndicators(false)
D( 2794: 2794) refreshSignalCluster: data=-1 bt=false
D( 2794: 2794) checkOverflow(432), More:false, Req:false Child:2
I( 2411: 2706) Touch event's action is 0x1 (deviceType=0) [pCnt=1, s=] when=24582378520000
I( 2411: 2706) Touch event's action is 0x0 (deviceType=0) [pCnt=1, s=0.942 ] when=24582656204000
I( 2411: 2706) Touch event's action is 0x1 (deviceType=0) [pCnt=1, s=] when=24582762641000
E( 2411: 2814) Exception dealing with report
E( 2411: 2814) libcore.io.ErrnoException: read failed: EAGAIN (Try again)
E( 2411: 2814)  at libcore.io.Posix.readBytes(Native Method)
E( 2411: 2814)  at libcore.io.Posix.read(Posix.java:128)
E( 2411: 2814)  at libcore.io.BlockGuardOs.read(BlockGuardOs.java:149)
E( 2411: 2814)  at com.android.server.am.NativeCrashListener.consumeNativeCrashData(NativeCrashListener.java:240)
E( 2411: 2814)  at com.android.server.am.NativeCrashListener.run(NativeCrashListener.java:138)
I( 1987: 1987) !@dumpstate -k -t -z -d -o /data/log/dumpstate_app_native -m 22962
I( 2411: 2683) Copying /data/tombstones/tombstone_09 to DropBox (SYSTEM_TOMBSTONE)
I(23387:23387) begin
D( 2794: 2794) onSignalStrengthsChanged signalStrength=SignalStrength: 99 99 -120 -160 -120 -1 -1 29 -89 -13 140 -1 2147483647 gsm|lte 0x3000 level=3
I( 2411: 2683) Notify a SYSTEM_TOMBSTONE FilePath:tombstone_09
W( 2411: 2683) Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1510 android.content.ContextWrapper.sendBroadcast:377 android.content.ContextWrapper.sendBroadcast:377 com.android.server.BootReceiver$2.onEvent:333 android.os.FileObserver$ObserverThread.onEvent:125 
D( 2411: 2411) Build: samsung/m3xx/m3:4.4.4/KTU84P/I9305XXSFQD1:user/release-keys
D( 2411: 2411) Hardware: smdk4x12
D( 2411: 2411) Revision: 2
D( 2411: 2411) Bootloader: I9305XXSFQD1
D( 2411: 2411) Radio: unknown
D( 2411: 2411) Kernel: Linux version 3.0.31-3447006 (dpi@SWDD5710) (gcc version 4.4.3 (GCC) ) #1 SMP PREEMPT Thu Apr 6 15:29:50 KST 2017
D( 2411: 2411) 
D( 2411: 2411) *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

@beeender
Copy link
Contributor

beeender commented Dec 1, 2017

Do you use primitive list we introduced in v4.0.0+ ?

@lam-amsiq
Copy link
Author

Yes

@idok595
Copy link

idok595 commented Dec 4, 2017

it is also happend on android 7 (galaxy s8+) same realm version

@asbadve
Copy link

asbadve commented May 30, 2018

05-30 12:35:23.726 2344-2446/com.ajinkyabadve.mywatchlist E/REALM: /mnt/jenkins/workspace/lm_realm-core_release_5.4.2-7MRDQ2N52D4436PA46O7GFYLIKQGV37WCE5DFMFVZ5J6WJYDBC3A@2/src/realm/util/thread.cpp:183: [realm-core-5.4.2] Destruction of mutex in use
!!! IMPORTANT: Please send this log and info about Realm SDK version and other relevant reproduction info to help@realm.io.
05-30 12:35:23.726 2344-2446/com.ajinkyabadve.mywatchlist A/libc: Fatal signal 6 (SIGABRT) at 0x00000928 (code=-6), thread 2446 (RealmFinalizing)

App crashes looks like the same issue

Realm version(s):
5.1.0
Android version:
4.4.4
Device:
Micromax AQ4501

@asbadve
Copy link

asbadve commented May 31, 2018

Detail logcat in case if needed

05-31 11:44:05.959 26141-26198/? E/REALM: /home/jenkins/workspace/lm_realm-core_release_5.4.2-7MRDQ2N52D4436PA46O7GFYLIKQGV37WCE5DFMFVZ5J6WJYDBC3A/src/realm/util/thread.cpp:183: [realm-core-5.4.2] Destruction of mutex in use
!!! IMPORTANT: Please send this log and info about Realm SDK version and other relevant reproduction info to help@realm.io.
05-31 11:44:05.972 26141-26198/? A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 26198 (RealmFinalizing)
05-31 11:44:06.064 26607-26607/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'xiaomi/tissot/tissot_sprout:8.0.0/OPR1.170623.026/V9.5.11.0.ODHMIFA:user/release-keys'
Revision: '0'
ABI: 'arm64'
pid: 26141, tid: 26198, name: RealmFinalizing >>> com.ajinkyabadve.mywatchlist <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
x0 0000000000000000 x1 0000000000006656 x2 0000000000000006 x3 0000000000000008
x4 0000000000000000 x5 0000000000000000 x6 0000000000000000 x7 7f7f7f7f7f7f7f7f
x8 0000000000000083 x9 fc76b4faaddbcdb8 x10 0000000000000000 x11 0000000000000001
x12 ffffffffffffffff x13 ffffffffffffffff x14 ff00000000000000 x15 ffffffffffffffff
05-31 11:44:06.065 26607-26607/? A/DEBUG: x16 00000077f37332e8 x17 00000077f36d4cc0 x18 0000000000000020 x19 000000000000661d
x20 0000000000006656 x21 00000077d8e4f822 x22 00000077d8e4f83e x23 00000077e6136e70
x24 00000077e5c45260 x25 00000077e5f51498 x26 0000000000000004 x27 00000077d8adebc0
x28 00000077d8adebfc x29 00000077d8ade370 x30 00000077f3688dd4
sp 00000077d8ade330 pc 00000077f36d4cc8 pstate 0000000060000000
05-31 11:44:06.069 26607-26607/? A/DEBUG: backtrace:
#00 pc 0000000000069cc8 /system/lib64/libc.so (tgkill+8)
#1 pc 000000000001ddd0 /system/lib64/libc.so (abort+88)
#2 pc 0000000000205288 /data/app/com.ajinkyabadve.mywatchlist-KtwLl5iUioE7E55KTO2KPw==/lib/arm64/librealm-jni.so
05-31 11:44:06.070 26607-26607/? A/DEBUG: #3 pc 00000000002052cc /data/app/com.ajinkyabadve.mywatchlist-KtwLl5iUioE7E55KTO2KPw==/lib/arm64/librealm-jni.so
#4 pc 000000000020535c /data/app/com.ajinkyabadve.mywatchlist-KtwLl5iUioE7E55KTO2KPw==/lib/arm64/librealm-jni.so
#5 pc 0000000000205528 /data/app/com.ajinkyabadve.mywatchlist-KtwLl5iUioE7E55KTO2KPw==/lib/arm64/librealm-jni.so
#6 pc 00000000001f07b8 /data/app/com.ajinkyabadve.mywatchlist-KtwLl5iUioE7E55KTO2KPw==/lib/arm64/librealm-jni.so
#7 pc 00000000000c8634 /data/app/com.ajinkyabadve.mywatchlist-KtwLl5iUioE7E55KTO2KPw==/lib/arm64/librealm-jni.so
#8 pc 0000000000050298 /data/app/com.ajinkyabadve.mywatchlist-KtwLl5iUioE7E55KTO2KPw==/lib/arm64/librealm-jni.so
#9 pc 000000000004e298 /data/app/com.ajinkyabadve.mywatchlist-KtwLl5iUioE7E55KTO2KPw==/lib/arm64/librealm-jni.so (Java_io_realm_internal_NativeObjectReference_nativeCleanUp+12)
#10 pc 00000000000390c0 /data/app/com.ajinkyabadve.mywatchlist-KtwLl5iUioE7E55KTO2KPw==/oat/arm64/base.odex (offset 0x

@zhaolongzhong
Copy link

Here is more log:

10-13 10:18:07.027 31223 31252 E REALM : /home/jenkins/workspace/realm_realm-core_master-ZBP7YYGK7EEKLBWAJKZQMIXPK7BHX4IZSAMXTSGLQ5SXVPPKKJMQ@7/src/realm/util/thread.cpp:183: [realm-core-5.7.2] Destruction of mutex in use
10-13 10:18:07.027 31223 31252 E REALM : !!! IMPORTANT: Please send this log and info about Realm SDK version and other relevant reproduction info to help@realm.io.
--------- beginning of crash
10-13 10:18:07.028 31223 31252 F libc : Fatal signal 6 (SIGABRT), code -6 in tid 31252 (RealmFinalizing)
10-13 10:18:07.028 1296 1296 W : debuggerd: handling request: pid=31223 uid=10104 gid=10104 tid=31252
10-13 10:18:07.339 31493 31493 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-13 10:18:07.339 31493 31493 F DEBUG : Build fingerprint: 'Android/sdk_google_phone_x86_64/generic_x86_64:7.1.1/NYC/4931657:userdebug/test-keys'
10-13 10:18:07.339 31493 31493 F DEBUG : Revision: '0'
10-13 10:18:07.339 31493 31493 F DEBUG : ABI: 'x86'
10-13 10:18:07.339 31493 31493 F DEBUG : pid: 31223, tid: 31252, name: RealmFinalizing
10-13 10:18:07.339 31493 31493 F DEBUG : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
10-13 10:18:07.339 31493 31493 F DEBUG : eax 00000000 ebx 000079f7 ecx 00007a14 edx 00000006
10-13 10:18:07.339 31493 31493 F DEBUG : esi c8970978 edi 0000000b
10-13 10:18:07.339 31493 31493 F DEBUG : xcs 00000023 xds 0000002b xes 0000002b xfs 0000006b xss 0000002b
10-13 10:18:07.339 31493 31493 F DEBUG : eip ffffe430 ebp 00007a14 esp c896fd5c flags 00000296
10-13 10:18:07.341 31493 31493 F DEBUG :
10-13 10:18:07.341 31493 31493 F DEBUG : backtrace:
10-13 10:18:07.341 31493 31493 F DEBUG : #00 pc ffffe430 [vdso:ffffe000] (__kernel_vsyscall+16)
10-13 10:18:07.341 31493 31493 F DEBUG : #1 pc 0008c5bc /system/lib/libc.so (tgkill+28)
10-13 10:18:07.341 31493 31493 F DEBUG : #2 pc 00087b06 /system/lib/libc.so (pthread_kill+70)
10-13 10:18:07.341 31493 31493 F DEBUG : #3 pc 0002a4f0 /system/lib/libc.so (raise+36)
10-13 10:18:07.341 31493 31493 F DEBUG : #4 pc 00021a7a /system/lib/libc.so (abort+92)
10-13 10:18:07.341 31493 31493 F DEBUG : #5 pc 0021c883 /data/app/com.xxx-1/lib/x86/librealm-jni.so
10-13 10:18:07.341 31493 31493 F DEBUG : #6 pc 0021c8d0 /data/app/com.xxx-1/lib/x86/librealm-jni.so
10-13 10:18:07.341 31493 31493 F DEBUG : #7 pc 0021c95e /data/app/com.xxx-1/lib/x86/librealm-jni.so
10-13 10:18:07.341 31493 31493 F DEBUG : #8 pc 0021cb36 /data/app/com.xxx-1/lib/x86/librealm-jni.so
10-13 10:18:07.341 31493 31493 F DEBUG : #9 pc 00207e30 /data/app/com.xxx-1/lib/x86/librealm-jni.so
10-13 10:18:07.341 31493 31493 F DEBUG : #10 pc 000b6bab /data/app/com.xxx-1/lib/x86/librealm-jni.so
10-13 10:18:07.341 31493 31493 F DEBUG : #11 pc 00032154 /data/app/com.xxx-1/lib/x86/librealm-jni.so
10-13 10:18:07.341 31493 31493 F DEBUG : #12 pc 0002fd66 /data/app/com.xxx-1/lib/x86/librealm-jni.so (Java_io_realm_internal_NativeObjectReference_nativeCleanUp+22)
10-13 10:18:07.341 31493 31493 F DEBUG : #13 pc 02141b8e /data/app/com.xxx-1/oat/x86/base.odex (offset 0x1eb9000)

@bentemple
Copy link

bentemple commented Feb 4, 2019

So, this issue has persisted and seemingly nothing I've changed has been able to mitigate it, but I recently may have identified a fix.
We have a specific realm transaction that deletes almost all the classes (when the user logs-out). And simply by adding a Realm.refresh() inside the realm transaction before looping through each of the Realm classes and deleting each one, seems to potentially have fixed the issue.

We were only getting this crash very occasionally in our integration tests, but it hasn't happened for several days. Here's what the code now looks like:

      //Let's make sure this realm is up-to-date before deleting all classes
        realm.refresh();

        final Class[] schemaClasses = xxxRealm.getClasses();
        for (final Class clazz : schemaClasses) {
            if (shouldCleanUp(clazz)) {
                realm.delete(clazz);
            }
       }

We have between 30-40 realm classes, so that might be a viable path for reproducing the issue, or at least specifically understanding that this crash might be directly caused by deleting all realm classes with several realms open on multiple threads.

@Zhuinden
Copy link
Contributor

Zhuinden commented Feb 4, 2019

     *
     * @throws IllegalStateException if attempting to refresh from within a transaction.
     */
    public void refresh() {
        checkIfValid();
        if (isInTransaction()) {
            throw new IllegalStateException("Cannot refresh a Realm instance inside a transaction.");
        }
        sharedRealm.refresh();
    }

Considering realm.refresh() throws while inside a transaction, and a transaction cannot be out of date because it is "at that moment creating the newest version of Realm that it sees in real-time that it is currently what is being created", I'd be very surprised if realm.refresh() had any effect inside a Realm transaction on this particular bug, unless the solution is to throw an exception and cancel certain transactions randomly.

@bentemple
Copy link

bentemple commented Feb 4, 2019

Ah, you're correct in pointing this out. Well, clearly it's fixing the issue by causing the underlying transaction to fail (there are more layers to this in our system)

That being said, this still shows that the issue is internal to realm and triggered at least in our case by deleting most of the realm classes, which is obviously something that we should be able to do.

@Zhuinden
Copy link
Contributor

Zhuinden commented Feb 4, 2019

I definitely agree!

Unfortunately I'm not actually a Realm member and I don't have any workarounds for this particular error. 😞

@cmelchior
Copy link
Contributor

@bentemple Interesting. It might point to the underlying error though.

As @Zhuinden points out, calling refresh() inside a transaction is not possible. What I do suspect is happening is that you are deleting the schema while it is still in use.

This could e.g. be because you had a RealmResults for that class, e.g. in shouldCleanUp()? We don't have an explicit close() method on classes like RealmQuery, RealmList and RealmResults so they release their native resources at the whim of the GC.

Do you know if this is a possibility?

In general, we have not done much to guard against this scenario as it is very difficult to detect across threads and is a pretty rare scenario (I only ever seen one other person reporting issues around it).

If you suspect this is happening. The safest is trying to completely close the Realm (which will remove the resources) before opening the Realm and deleting the schemas.

Alternatively, you can flag the schemas that need to be deleted and do it as the first thing the next time the app starts.

@Zhuinden
Copy link
Contributor

Zhuinden commented Feb 5, 2019

By schema, what do we mean by schema?

@cmelchior
Copy link
Contributor

DynamicRealm realm = DynamicRealm.getDefaultInstance();
realm.executeTransaction(r -> {
  r.getSchema().delete("Person")
});

I would need to validate, but I think that trying to delete a schema from a typed Realm would throw an exception since it needs a migration, but doing it from a DynamicRealm is allowed and has the side effects mentioned above.

@bentemple
Copy link

bentemple commented Feb 6, 2019

@cmelchior I feel strongly that it does point to the underlying issue. That being said, I'm not deleting schemas here, I'm deleting all the objects in a schema, this is the delete method I'm calling:

    /**
     * Deletes all objects of the specified class from the Realm.
     *
     * @param clazz the class which objects should be removed.
     * @throws IllegalStateException if the corresponding Realm is a query-based synchronized Realm, is
     * closed or called from an incorrect thread.
     */
    public void delete(Class<? extends RealmModel> clazz) {
        checkIfValid();
        if (sharedRealm.isPartial()) {
            throw new IllegalStateException(DELETE_NOT_SUPPORTED_UNDER_PARTIAL_SYNC);
        }
        schema.getTable(clazz).clear(sharedRealm.isPartial());
    }

I think that as you pointed out this is likely directly related to RealmList, RealmResults referencing the deleted objects. I went ahead and moved the refresh outside of the delete transaction, and I just recently saw my first crash as a result of fixing the transaction from failing.

Also, this isn't a dynamic realm

It actually seems like this crash could be triggered by deleting even a single object from a schema, albeit probably not likely, but if I can't clear the table, can I even safely delete a single object?

@cmelchior
Copy link
Contributor

@bentemple Yeah, I guess I misunderstood what your delete method does and my explanation definitely doesn't hold in your case.

Deleting objects should work perfectly fine. We do that all over the place in our unit tests and have never seen any issues due to it. That doesn't mean there couldn't be a bug there, I would just be very surprised.

Are you in any position to share the crashing code? You can do it privately to help@realm.io ?

@Zhuinden
Copy link
Contributor

Zhuinden commented Feb 6, 2019

unless the solution is to throw an exception and cancel certain transactions randomly.

I think that as you pointed out this is likely directly related to RealmList, RealmResults referencing the deleted objects. I went ahead and moved the refresh outside of the delete transaction, and I just recently saw my first crash as a result of fixing the transaction from failing.

😲

@bentemple
Copy link

Are you in any position to share the crashing code? You can do it privately to help@realm.io ?

I think I can share the crashing code, but our system has some layers on-top of realm so I'm not sure how much that will help. I'm guessing a more detailed high-level overview of the processes happening right before the crash might be more useful, but idk. I'll email directly and see if I can provide what you need.

@cmelchior
Copy link
Contributor

A high-level description of the system would also work. From the stack trace it is our finalizer thread that throws the exception meaning it happens when some kind of object from Realm with a native resource is GC'ed.

@cmelchior
Copy link
Contributor

Looking at the code in question you sent I do not see anything alarming.
After reviewing our own code, I can see that we just call down to table.clear() which should delete all objects fine.
Right now I'm hunting the suspicion that it is some derived object that somehow isn't invalidated that causes this....e.g. making a query on a list inside a deleted object or similar to this. This fits the hypothesis that this is caused in the RealmFinalizer at least.

@Ruben2112
Copy link

Ruben2112 commented Aug 19, 2019

I have been experiencing a similar issue, also getting the error Destruction of mutex in use. I contacted Realm support and they suggested adding my findings to this issue.

We are using Realm 5.10.0. Our app communicates with external sensors and we save their data in Realm. We read the data from Realm to display it on screen and calculate various statistics from it. Occasionally the crash occurs generating a tombstone file, and we can’t figure out what’s causing it as we can’t find a pattern. Even when we simulate the sensors, allowing us to always save identical data, it often crashes, but never at the same data points. It appears to be very random.

Our target SDK is Android 9 and so far the crash is occuring on Samsung Galaxy Tab Active 2 running Android 8.1 & Android 9.

We are not clearing or deleting any data when the crash happens, in contrary to what comments above have been suggesting. I don't know if that means my issue is different altogether or if the assumption that it's caused by clearing data is wrong. It is possible that data in a RealmResults object no longer fit the query applied so data is removed from the RealmResults though.

Here's the logcat:
tombstone.txt

@JvmName
Copy link

JvmName commented Oct 2, 2019

We're seeing the same thing:

At least for me, happening on a Pixel emulator running API 28. This is very reproducible, but we have a lot of Realm code so it's unclear what specifically is causing it.

@cmelchior is there any steps for obtaining more information that can help the team investigate?

2019-10-01 13:36:13.672 A/google-breakpad: Microdump skipped (uninteresting)
2019-10-01 13:36:13.694 W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
2019-10-01 13:36:13.694 W/google-breakpad: Chrome build fingerprint:
2019-10-01 13:36:13.694 W/google-breakpad: 69.0.3497.100
2019-10-01 13:36:13.694 W/google-breakpad: 349710017
2019-10-01 13:36:13.694 W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
2019-10-01 13:36:13.828 I/GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@2dba0f7)
2019-10-01 13:36:13.828 I/GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@2dba0f7)
2019-10-01 13:36:13.987 W/RealmFinalizing: type=1400 audit(0.0:95): avc: denied { search } for name="power_supply" dev="sysfs" ino=11991 scontext=u:r:untrusted_app:s0:c86,c256,c512,c768 tcontext=u:object_r:sysfs_batteryinfo:s0 tclass=dir permissive=0
2019-10-01 13:36:14.017 A/libc: Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 12400 (RealmFinalizing), pid 12320 (frontapp.mobile)
2019-10-01 13:36:14.035 E/DEBUG: failed to readlink /proc/12400/fd/39: No such file or directory
2019-10-01 13:36:14.036 E/DEBUG: failed to readlink /proc/12400/fd/40: No such file or directory
2019-10-01 13:36:14.036 E/DEBUG: failed to readlink /proc/12400/fd/43: No such file or directory
2019-10-01 13:36:14.076 I/crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone
2019-10-01 13:36:14.077 I//system/bin/tombstoned: received crash request for pid 12400
2019-10-01 13:36:14.078 I/crash_dump32: performing dump of process 12320 (target tid = 12400)
2019-10-01 13:36:14.082 A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2019-10-01 13:36:14.082 A/DEBUG: Build fingerprint: 'google/sdk_gphone_x86_arm/generic_x86_arm:9/PSR1.180720.117/5875966:user/release-keys'
2019-10-01 13:36:14.082 A/DEBUG: Revision: '0'
2019-10-01 13:36:14.082 A/DEBUG: ABI: 'x86'
2019-10-01 13:36:14.082 A/DEBUG: pid: 12320, tid: 12400, name: RealmFinalizing  >>> com.frontapp.mobile <<<
2019-10-01 13:36:14.082 A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------

2019-10-01 13:36:14.082 A/DEBUG: Abort message: 'FORTIFY: pthread_mutex_destroy called on a destroyed mutex (0xc7860ff4)'
2019-10-01 13:36:14.082 A/DEBUG:     eax 00000000  ebx 00003020  ecx 00003070  edx 00000006
2019-10-01 13:36:14.082 A/DEBUG:     edi 00003020  esi 00000000
2019-10-01 13:36:14.082 A/DEBUG:     ebp c58c6cb8  esp c58c6c58  eip e7e98b39
2019-10-01 13:36:14.185 A/DEBUG: backtrace:
2019-10-01 13:36:14.185 A/DEBUG:     #00 pc 00000b39  [vdso:e7e98000] (__kernel_vsyscall+9)
2019-10-01 13:36:14.185 A/DEBUG:     #01 pc 0001fdf8  /system/lib/libc.so (syscall+40)
2019-10-01 13:36:14.185 A/DEBUG:     #02 pc 00022ed3  /system/lib/libc.so (abort+115)
2019-10-01 13:36:14.185 A/DEBUG:     #03 pc 00090baa  /system/lib/libc.so (__fortify_fatal(char const*, ...)+58)
2019-10-01 13:36:14.185 A/DEBUG:     #04 pc 000900ea  /system/lib/libc.so (HandleUsingDestroyedMutex(pthread_mutex_t*, char const*)+58)
2019-10-01 13:36:14.185 A/DEBUG:     #05 pc 00090a17  /system/lib/libc.so (pthread_mutex_destroy+151)
2019-10-01 13:36:14.185 A/DEBUG:     #06 pc 002510ce  /data/app/com.frontapp.mobile-g8RjkB8vwBYL--3Bx3Zigw==/lib/x86/librealm-jni.so
2019-10-01 13:36:14.185 A/DEBUG:     #07 pc 000feedb  /data/app/com.frontapp.mobile-g8RjkB8vwBYL--3Bx3Zigw==/lib/x86/librealm-jni.so
2019-10-01 13:36:14.185 A/DEBUG:     #08 pc 0006a674  /data/app/com.frontapp.mobile-g8RjkB8vwBYL--3Bx3Zigw==/lib/x86/librealm-jni.so
2019-10-01 13:36:14.185 A/DEBUG:     #09 pc 00067f36  /data/app/com.frontapp.mobile-g8RjkB8vwBYL--3Bx3Zigw==/lib/x86/librealm-jni.so (Java_io_realm_internal_NativeObjectReference_nativeCleanUp+22)
2019-10-01 13:36:14.185 A/DEBUG:     #10 pc 00059ec2  /dev/ashmem/dalvik-jit-code-cache (deleted) (io.realm.internal.NativeObjectReference.nativeCleanUp+178)
2019-10-01 13:36:14.185 A/DEBUG:     #11 pc 0001a244  /dev/ashmem/dalvik-jit-code-cache (deleted) (io.realm.internal.NativeObjectReference.cleanup+116)
2019-10-01 13:36:14.185 A/DEBUG:     #12 pc 00059fa1  /dev/ashmem/dalvik-jit-code-cache (deleted) (io.realm.internal.FinalizerRunnable.run+113)
2019-10-01 13:36:14.185 A/DEBUG:     #13 pc 005f7434  /system/lib/libart.so (art_quick_osr_stub+36)
2019-10-01 13:36:14.185 A/DEBUG:     #14 pc 003423b4  /system/lib/libart.so (art::jit::Jit::MaybeDoOnStackReplacement(art::Thread*, art::ArtMethod*, unsigned int, int, art::JValue*)+3668)
2019-10-01 13:36:14.185 A/DEBUG:     #15 pc 005c3a12  /system/lib/libart.so (MterpMaybeDoOnStackReplacement+130)
2019-10-01 13:36:14.185 A/DEBUG:     #16 pc 005ef5a4  /system/lib/libart.so (ExecuteMterpImpl+65956)
2019-10-01 13:36:14.185 A/DEBUG:     #17 pc 0020999a  /dev/ashmem/dalvik-classes3.dex extracted in memory from /data/app/com.frontapp.mobile-g8RjkB8vwBYL--3Bx3Zigw==/base.apk!classes3.dex (deleted) (io.realm.internal.FinalizerRunnable.run+22)
2019-10-01 13:36:14.185 A/DEBUG:     #18 pc 00266096  /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.3007865774+598)
2019-10-01 13:36:14.185 A/DEBUG:     #19 pc 0026c61c  /system/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+220)
2019-10-01 13:36:14.185 A/DEBUG:     #20 pc 00293cab  /system/lib/libart.so (bool art::interpreter: oCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1019)
2019-10-01 13:36:14.185 A/DEBUG:     #21 pc 005bd434  /system/lib/libart.so (MterpInvokeInterface+1444)
2019-10-01 13:36:14.185 A/DEBUG:     #22 pc 005e2da1  /system/lib/libart.so (ExecuteMterpImpl+14753)
2019-10-01 13:36:14.185 A/DEBUG:     #23 pc 000ca806  /system/framework/boot.vdex (java.lang.Thread.run+12)
2019-10-01 13:36:14.185 A/DEBUG:     #24 pc 00266096  /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.3007865774+598)
2019-10-01 13:36:14.185 A/DEBUG:     #25 pc 0026c50e  /system/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+126)
2019-10-01 13:36:14.185 A/DEBUG:     #26 pc 005a93fd  /system/lib/libart.so (artQuickToInterpreterBridge+1277)
2019-10-01 13:36:14.185 A/DEBUG:     #27 pc 005f6aed  /system/lib/libart.so (art_quick_to_interpreter_bridge+77)
2019-10-01 13:36:14.185 A/DEBUG:     #28 pc 005f0a02  /system/lib/libart.so (art_quick_invoke_stub+338)
2019-10-01 13:36:14.185 A/DEBUG:     #29 pc 000a2f4e  /system/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+222)
2019-10-01 13:36:14.185 A/DEBUG:     #30 pc 004d3209  /system/lib/libart.so (art: anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art: anonymous namespace)::ArgArray*, art::JValue*, char const*)+89)
2019-10-01 13:36:14.185 A/DEBUG:     #31 pc 004d44b7  /system/lib/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue*)+471)
2019-10-01 13:36:14.185 A/DEBUG:     #32 pc 0050944c  /system/lib/libart.so (art::Thread::CreateCallback(void*)+1484)
2019-10-01 13:36:14.185 A/DEBUG:     #33 pc 0008f065  /system/lib/libc.so (__pthread_start(void*)+53)
2019-10-01 13:36:14.185 A/DEBUG:     #34 pc 0002485b  /system/lib/libc.so (__start_thread+75)

@cmelchior cmelchior added Reproduction-Required and removed Blocked This issue is blocked by another issue labels Oct 3, 2019
@cmelchior
Copy link
Contributor

@ParthPadg What version of Realm are you running, then I can try to de-obfuscate your stacktrace. Hopefully that can reveal some more.

The error comes from the GC, which triggers the cleanup of some Realm resource that may already be destroyed, but it is unclear exactly what and how.

In another thread, you mentioned this happened if the app was left on for a number of minutes. Is the screen on during that time or does the phone go to sleep and this crash happens when you wake up?

@JvmName
Copy link

JvmName commented Oct 3, 2019

Hey @cmelchior, . I'm running this on 5.15.1.
RE screen on vs off: it seems to be related to how much Realm is used -- when I move to a part of the app without heavy DB I/O, the app can last for quite a while.
However, in parts of the app with super heavy DB usage, it'll crash in <5 min.

If there's specific metrics you want around invocations or anything, let me know here or on the other thread, I'll do my best to get you what you need. Thanks so much!!

@cmelchior
Copy link
Contributor

Ok, so the crash above, happens by normal use of the app?

@JvmName
Copy link

JvmName commented Oct 3, 2019

Yeah, the only potentially weird thing I'm doing is attempting to remove "orphaned" DB entries from a table, but to the DB it just looks like a transaction with a few insertions and a bunch of deletions.

@cmelchior
Copy link
Contributor

cmelchior commented Oct 3, 2019

The unrolled stack trace is this:

FORTIFY: pthread_mutex_destroy called on a destroyed mutex

Build fingerprint: 'google/sdk_gphone_x86_arm/generic_x86_arm:9/PSR1.180720.117/5875966:user/release-keys'
pid: 12320, tid: 12400, name: RealmFinalizing  >>> com.frontapp.mobile <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Stack frame #00 pc 00000b39  [vdso:e7e98000] (__kernel_vsyscall+9)
Stack frame #01 pc 0001fdf8  /system/lib/libc.so (syscall+40)
Stack frame #02 pc 00022ed3  /system/lib/libc.so (abort+115)
Stack frame #03 pc 00090baa  /system/lib/libc.so (__fortify_fatal(char const*, ...)+58)
Stack frame #04 pc 000900ea  /system/lib/libc.so (HandleUsingDestroyedMutex(pthread_mutex_t*, char const*)+58)
Stack frame #05 pc 00090a17  /system/lib/libc.so (pthread_mutex_destroy+151)
Stack frame #06 pc 002510ce  /data/app/com.frontapp.mobile-g8RjkB8vwBYL--3Bx3Zigw==/lib/x86/librealm-jni.so: Routine realm::Table::~Table() at unwind-dw2-fde-dip.c:?
Stack frame #07 pc 000feedb  /data/app/com.frontapp.mobile-g8RjkB8vwBYL--3Bx3Zigw==/lib/x86/librealm-jni.so: Routine realm::List::~List() at unwind-dw2-fde-dip.c:?
Stack frame #08 pc 0006a674  /data/app/com.frontapp.mobile-g8RjkB8vwBYL--3Bx3Zigw==/lib/x86/librealm-jni.so: Routine (anonymous namespace)::finalize_list(long long) at io_realm_internal_OsList.cpp:?
Stack frame #09 pc 00067f36  /data/app/com.frontapp.mobile-g8RjkB8vwBYL--3Bx3Zigw==/lib/x86/librealm-jni.so (Java_io_realm_internal_NativeObjectReference_nativeCleanUp+22): Routine Java_io_realm_internal_NativeObjectReference_nativeCleanUp at ??:?
Stack frame #10 pc 00059ec2  /dev/ashmem/dalvik-jit-code-cache (deleted) (io.realm.internal.NativeObjectReference.nativeCleanUp+178)
Stack frame #11 pc 0001a244  /dev/ashmem/dalvik-jit-code-cache (deleted) (io.realm.internal.NativeObjectReference.cleanup+116)
Stack frame #12 pc 00059fa1  /dev/ashmem/dalvik-jit-code-cache (deleted) (io.realm.internal.FinalizerRunnable.run+113)

It looks like the destruction of a RealmList is crashing. Are you using those in many places?

@JvmName
Copy link

JvmName commented Oct 3, 2019

Unfortunately yeah, our model files are littered with RealmLists :(

@cmelchior
Copy link
Contributor

Do these lists all contain references to other RealmObjects or do they also contain primitives like String or Integer?

@finnschiermer
Copy link

It is this one: realm/realm-core#2944

We have so far not been able to fix it in the context of current Core.

It will be fixed by Core-6.

@JvmName
Copy link

JvmName commented Oct 3, 2019

@cmelchior both, we have "primitive" RealmLists as well as lists that reference other RealmObjects

@cmelchior
Copy link
Contributor

This is fixed by realm/realm-core#3460

@JvmName
Copy link

JvmName commented Dec 10, 2019

@cmelchior if there isn't a realm-java build that has the RealmCore 6.x included, why has this issue been closed?

@Zhuinden
Copy link
Contributor

Technically it is in Realm-Core 5.23.7, but the question is valid.

@bmunkholm
Copy link
Contributor

@ParthPadg We close issues when fixes are merged, not when they are released. Github issue handling works best that way as you write "This PR fixes #xyz" and github will auto close when the PR is merged.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests