realm / realm-java

Realm is a mobile database: a replacement for SQLite & ORMs
http://realm.io
Apache License 2.0
11.45k stars 1.75k forks source link

App crashes in some devices randomly #7686

Closed xrb21 closed 1 year ago

xrb21 commented 2 years ago

How frequently does the bug occur?

Sometimes

Description

We found that some users experienced the native crash "signal 6 (SIGABRT), code -6 (SI_TKILL)" in librealm-jni.so which is continuously occurred. We got crash reports only on google play console but not showing on crashlytic

Stacktrace & log output

signal 6 (SIGABRT), code -6 (SI_TKILL)

backtrace:
  #00  pc 000000000008a04c  /apex/com.android.runtime/lib64/bionic/libc.so (abort+180)
  #00  pc 000000000034d1a8  /data/app/~~dE_L9Bmho9MkMH1MFXZtMg==/com.project.app-n2JLdr7wAUS96kDokqGypw==/lib/arm64/librealm-jni.so

another backtrace log:
  #00  pc 0000000000062c94  /apex/com.android.runtime/lib/bionic/libc.so (abort+172)
  #00  pc 0000000000062f3b  /apex/com.android.runtime/lib/bionic/libc.so (__assert2+22)
  #00  pc 0000000000266f6f  /data/app/~~7f48NbYRL1NgLCyEev8CTQ==/com.project.app-A1VhypOHY2k6V8IDAnbugg==/lib/arm/librealm-jni.so
  #00  pc 0000000000267111  /data/app/~~7f48NbYRL1NgLCyEev8CTQ==/com.project.app-A1VhypOHY2k6V8IDAnbugg==/lib/arm/librealm-jni.so
  #00  pc 0000000000267019  /data/app/~~7f48NbYRL1NgLCyEev8CTQ==/com.project.app-A1VhypOHY2k6V8IDAnbugg==/lib/arm/librealm-jni.so
  #00  pc 0000000000266fc3  /data/app/~~7f48NbYRL1NgLCyEev8CTQ==/com.project.app-A1VhypOHY2k6V8IDAnbugg==/lib/arm/librealm-jni.so (std::terminate()+46)
  #00  pc 000000000027468d  /data/app/~~7f48NbYRL1NgLCyEev8CTQ==/com.project.app-A1VhypOHY2k6V8IDAnbugg==/lib/arm/librealm-jni.so

another backtrace log:
  #00  pc 000000000001d808  /system/lib64/libc.so (abort+120)
  #00  pc 000000000001d7dc  /system/lib64/libc.so (abort+76)

Can you reproduce the bug?

Not yet

Reproduction Steps

I'm using encrypted realm database and below is my realm configuration:

//example key used string length 64 chars
byte[] key = "xAWey5DiurJA7SFo7pBtXlftCPzA1Qk5jv9hm9EX9HJn8iWfbTsnWVbUCSDm8ehO".getBytes();

RealmConfiguration configR = new RealmConfiguration.Builder()
                .name("app_db.realm")
                .deleteRealmIfMigrationNeeded()
                .modules(new AppModuleRealm())
                .allowQueriesOnUiThread(true)
                .allowWritesOnUiThread(true)
                .encryptionKey(key)
                .build();

Version

10.10.1

What SDK flavour are you using?

Local Database only

Are you using encryption?

Yes, using encryption

Platform OS and version(s)

Android 12, Android 11, Android 10, Android 9, Android 8

Build environment

Android Studio version: Bumblebee 2021.1.1 patch 3 Android Build Tools version: 30.0.3 Gradle version: gradle-6.5-bin

cmelchior commented 2 years ago

Hi @xrb21 We have fixed a bug in the encryption layer that might be causing this in 10.11.0 which was just released. Can you try to upgrade?

edualonso commented 1 year ago

Closing issue due to inactivity. Please reopen if the problem persists.

bharatbl94 commented 5 months ago

I am also facing this problem.

This error is gone after re-installing the app. I am facing this issue after updating the Realm version to classpath "io.realm:realm-gradle-plugin:10.15.0". Here is the stack trace :-

0 libc.so +0x8d774                                     abort
1 librealm-jni.so +0x7ae010                            0x7c052ad014
2 librealm-jni.so +0x7ae30c                            0x7c052ad310
3 librealm-jni.so +0x7ae498                            0x7c052ad49c
4 librealm-jni.so +0x79c8ac                            0x7c0529b8b0
5 librealm-jni.so +0x79a1d4                            0x7c052991d8
6 librealm-jni.so +0x6e87c0                            0x7c051e77c4
7 librealm-jni.so +0x59bbb0                            0x7c0509abb4
8 split_config.arm64_v8a.apk!librealm-jni.so +0x517350 Java_io_realm_internal_OsSharedRealm_nativeWriteCopy
9 base.odex +0x1ca69c                                  art_jni_trampoline