element-hq / element-hq/element-android

[SDK] 'JNI ERROR (app bug): weak global reference table overflow' during initial sync

Open
#9,150 0 comments 0 reactions 0 assignees View on GitHub
matrix-sdk
Dominant language
Kotlin
Stars
3.7k
Forks
917
PR merge metrics
No merged PRs in 30d

Description

### Description

Hello, we have some user in production experiencing this crash: it seems to be related to the number of rooms the user is in.

Any solution? We are using 1.6.50 version

```
java_vm_ext.cc:737] JNI ERROR (app bug): weak global reference table overflow (max=51200)weak global reference table dump:
java_vm_ext.cc:737] Last 10 entries (of 51198):
java_vm_ext.cc:737] 51197: 0x20612e18 io.realm.internal.OsRealmConfig
java_vm_ext.cc:737] 51196: 0x20612c98 io.realm.BaseRealm$6
java_vm_ext.cc:737] 51195: 0x20610680 io.realm.internal.OsRealmConfig
java_vm_ext.cc:737] 51194: 0x20610500 io.realm.BaseRealm$6
java_vm_ext.cc:737] 51193: 0x2060df28 io.realm.internal.OsRealmConfig
java_vm_ext.cc:737] 51192: 0x2060dda8 io.realm.BaseRealm$6
java_vm_ext.cc:737] 51191: 0x136b9218 org.matrix.android.sdk.internal.database.RealmCompactOnLaunch
java_vm_ext.cc:737] 51190: 0x2060b7d0 io.realm.internal.OsRealmConfig
java_vm_ext.cc:737] 51189: 0x2060b650 io.realm.BaseRealm$6
java_vm_ext.cc:737] 51188: 0x136b9218 org.matrix.android.sdk.internal.database.RealmCompactOnLaunch
java_vm_ext.cc:737] Summary:
java_vm_ext.cc:737] 17031 of org.matrix.android.sdk.internal.database.RealmCompactOnLaunch (1 unique instances)
java_vm_ext.cc:737] 17029 of io.realm.BaseRealm$6 (17028 unique instances)
java_vm_ext.cc:737] 17029 of io.realm.internal.OsRealmConfig (17028 unique instances)
java_vm_ext.cc:737] 79 of java.lang.DexCache (79 unique instances)
java_vm_ext.cc:737] 11 of dalvik.system.PathClassLoader (8 unique instances)
java_vm_ext.cc:737] 8 of io.realm.internal.OsResults (8 unique instances)
java_vm_ext.cc:737] 3 of io.realm.BaseRealm$1 (3 unique instances)
java_vm_ext.cc:737] 3 of io.realm.internal.android.AndroidRealmNotifier (3 unique instances)
java_vm_ext.cc:737] 3 of dalvik.system.DelegateLastClassLoader (3 unique instances)
java_vm_ext.cc:737] 1 of java.lang.BootClassLoader
java_vm_ext.cc:737] 1 of java.lang.Class
java_vm_ext.cc:737]
runtime.cc:691] native: #09 pc 005839ec /apex/com.android.art/lib64/libart.so (art::JNI::NewWeakGlobalRef+164) (BuildId: 41ac8dfed2977c7a168799976d23a7f8)
runtime.cc:691] native: #10 pc 00501350 /apex/com.android.art/lib64/libart.so (art::::CheckJNI::NewRef +232) (BuildId: 41ac8dfed2977c7a168799976d23a7f8)
runtime.cc:691] native: #11 pc 004fa9d0 /data/app/~~h-eQcvnxV8bj-ORSbisG5g==/com.comehome-A4XipjhId8_OzXNdcJCelw==/base.apk (offset 5150000) (Java_io_realm_internal_OsRealmConfig_nativeSetCompactOnLaunchCallback+88) (BuildId: ea0a5d9080555279643882fd771d0f9af6bbfd6f)
runtime.cc:691] native: #12 pc 021956ac /memfd:jit-cache (deleted) (offset 2000000) (art_jni_trampoline+156)
runtime.cc:691] native: #13 pc 02128bb8 /memfd:jit-cache (deleted) (offset 2000000) (io.realm.internal.OsRealmConfig.+3192)
runtime.cc:691] native: #14 pc 0218fdc4 /memfd:jit-cache (deleted) (offset 2000000) (io.realm.internal.OsRealmConfig.+116)
runtime.cc:691] native: #15 pc 02047930 /memfd:jit-cache (deleted) (offset 2000000) (io.realm.internal.OsRealmConfig$Builder.build+176)
runtime.cc:691] native: #16 pc 020c2334 /memfd:jit-cache (deleted) (offset 2000000) (io.realm.internal.OsSharedRealm.getInstance+132)
runtime.cc:691] native: #17 pc 0208e498 /memfd:jit-cache (deleted) (offset 2000000) (io.realm.BaseRealm.+1048)
runtime.cc:691] native: #18 pc 0216329c /memfd:jit-cache (deleted) (offset 2000000) (io.realm.BaseRealm.+172)
runtime.cc:691] native: #19 pc 021138e0 /memfd:jit-cache (deleted) (offset 2000000) (io.realm.Realm.+256)
runtime.cc:691] native: #20 pc 02111efc /memfd:jit-cache (deleted) (offset 2000000) (io.realm.Realm.createInstance+124)
runtime.cc:691] native: #21 pc 020da77c /memfd:jit-cache (deleted) (offset 2000000) (io.realm.RealmCache.createInstance+124)
runtime.cc:691] native: #22 pc 0202f290 /memfd:jit-cache (deleted) (offset 2000000) (io.realm.RealmCache.doCreateRealmOrGetFromCache+976)
runtime.cc:691] native: #23 pc 02134088 /memfd:jit-cache (deleted) (offset 2000000) (io.realm.RealmCache.createRealmOrGetFromCache+200)
runtime.cc:691] native: #24 pc 02112004 /memfd:jit-cache (deleted) (offset 2000000) (io.realm.Realm.getInstance+100)
runtime.cc:691] native: #25 pc 0209be40 /memfd:jit-cache (deleted) (offset 2000000) (com.zhuinden.monarchy.Monarchy.doWithRealm+160)
runtime.cc:691] native: #26 pc 020d853c /memfd:jit-cache (deleted) (offset 2000000) (org.matrix.android.sdk.internal.util.MonarchyKt.fetchCopied+268)
runtime.cc:691] native: #27 pc 021630d0 /memfd:jit-cache (deleted) (offset 2000000) (org.matrix.android.sdk.internal.crypto.CryptoSessionInfoProvider.isRoomEncrypted+224)
runtime.cc:691] native: #28 pc 020b8094 /memfd:jit-cache (deleted) (offset 2000000) (org.matrix.android.sdk.internal.crypto.RustCryptoService.isRoomEncrypted+164)
runtime.cc:691] native: #29 pc 021222a0 /memfd:jit-cache (deleted) (offset 2000000) (org.matrix.android.sdk.internal.crypto.RustCryptoService.onRoomMembershipEvent+160)
runtime.cc:691] native: #30 pc 020006ec /memfd:jit-cache (deleted) (offset 2000000) (org.matrix.android.sdk.internal.crypto.RustCryptoService.onStateEvent+460)
runtime.cc:691] native: #31 pc 0218b348 /memfd:jit-cache (deleted) (offset 2000000) (org.matrix.android.sdk.internal.session.sync.SyncResponseHandler.handleResponse+12216)
runtime.cc:691] native: #32 pc 0033ef10 /apex/com.android.art/lib64/libart.so (art_quick_osr_stub+64) (BuildId: 41ac8dfed2977c7a168799976d23a7f8)
runtime.cc:691] native: #33 pc 00331b80 /apex/com.android.art/lib64/libart.so (art::jit::Jit::MaybeDoOnStackReplacement+2280) (BuildId: 41ac8dfed2977c7a168799976d23a7f8)
runtime.cc:691] native: #34 pc 004961b0 /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp+13152) (BuildId: 41ac8dfed2977c7a168799976d23a7f8)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.