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

Random crashes with encrypted realm. #7652

Closed
yul13th opened this issue Feb 27, 2022 · 10 comments
Closed

Random crashes with encrypted realm. #7652

yul13th opened this issue Feb 27, 2022 · 10 comments
Assignees
Labels
O-Community T-Bug Waiting-For-Reporter Waiting for more information from the reporter before we can proceed

Comments

@yul13th
Copy link

yul13th commented Feb 27, 2022

How frequently does the bug occur?

Sometimes

Description

Application constantly crashes in random transactions.

Stacktrace & log output

2022-02-26 15:47:15.802 6088-6465/packageAPP E/REALM: uncaught exception in notifier thread: N5realm5_impl17TransactLogParser14BadTransactLogE: Bad transaction log
2022-02-26 15:47:15.807 6088-6465/packageAPP E/libc++abi: terminating with uncaught exception of type realm::_impl::TransactLogParser::BadTransactLog: Bad transaction log
2022-02-26 15:47:15.811 6088-6465/packageAPP A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 6465 (packageAPP), pid 6088 (packageAPP)

Can you reproduce the bug?

Yes, sometimes

Reproduction Steps

use the RealmConfiguration Builder with an encryptionKey then it will crash in Radom transactions using mostly copyToRealmOrUpdate

realmConfiguration = RealmConfiguration.Builder().encryptionKey(key)
        .name("nameDB")
        .allowWritesOnUiThread(true)
        .modules(RealmModule())
        .deleteRealmIfMigrationNeeded()
        .schemaVersion(1).build()
    Realm.setDefaultConfiguration(realmConfiguration)

example transactions

  Realm.getInstance(realmConfiguration)?.let {
            it.beginTransaction()
            val results = it.where(className::class.java)
                .isNotNull(name).findAll()
            results.load()
            results.deleteAllFromRealm()
            it.copyToRealmOrUpdate(list)
            it.commitTransaction()
            it.close()
        }

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

Build environment

Android Studio Bumblebee | 2021.1.1 Patch 2
tools.build:gradle: 7.1.2

kotlin-gradle-plugin: 1.6.10

@clementetb
Copy link
Collaborator

@yul13th do you have access to the affected Realm db file? We have found a potential issue when working with encrypted realms that can end up with a corrupt the database.

realm/realm-core#5174

@sync-by-unito sync-by-unito bot added the Waiting-For-Reporter Waiting for more information from the reporter before we can proceed label Feb 28, 2022
@paolo-ermit
Copy link

I've the same problem. But opening the file after a crash with Realm studio the file is readable, it doesn't seem to be corrupted.
Problem is happening with version
10.10.1
and not with versione
10.9.1

@sideprojecteu
Copy link

sideprojecteu commented Mar 1, 2022

I also have the same problem with encrypted realm after updating to 10.10.1. It was fine in 10.9.0 and previous versions. I do not have access to db file.

@yul13th
Copy link
Author

yul13th commented Mar 1, 2022

@yul13th do you have access to the affected Realm db file? We have found a potential issue when working with encrypted realms that can end up with a corrupt the database.

realm/realm-core#5174

I can't access the file... when the app crashes the device will ask to clean cache and then the app will work for a litlle while then it will happen again and the cycles repeat. So yes, I think it is possible that the file is getting corrupted.

@github-actions github-actions bot added Needs-Attention and removed Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Mar 1, 2022
@finnschiermer
Copy link

@clementetb as this is a newcomer happening only after a recent release (if I read it correctly), it is likely not related to the problem in realm/realm-core#5174

@clementetb
Copy link
Collaborator

@finnschiermer I see, it must be unrelated as it is an issue present since the first implementation.

@paolo-ermit @sideprojecteu @yul13th we could not replicate the issue with the information provided. Are you able to reproduce it constantly? Is it affecting an unique device? Could you write and share an example project that reproduces the issue?

@sync-by-unito sync-by-unito bot added Waiting-For-Reporter Waiting for more information from the reporter before we can proceed and removed Needs-Attention labels Mar 4, 2022
@finnschiermer finnschiermer self-assigned this Apr 11, 2022
@mattylase
Copy link

Wanted to add my voice to the chorus here. We somewhat recently upgraded to Realm 10.11.0. We didn't see any problems locally or in Crashlytics, but found a huge amount of problems are coming through the Play Console's reporting feature.

Screen Shot 2022-06-29 at 2 09 00 PM

,

@mattylase
Copy link

The only logs I have access to are from a non-technical coworker who happened to see the issue on their device. I'm not 100% sure it's related to encryption, but we are using encrypted Realm. I can't provide any repro steps or examples, as all reports are from the field of our app crash looping.

2022-06-29 13:36:38.124 16282-16282/? E/com.ourapp.sm: Not starting debugger since process cannot load the jdwp agent.
2022-06-29 13:36:38.339 16282-16282/? A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 16282 (com.ourapp.sm), pid 16282 (com.ourapp.sm)
2022-06-29 13:36:38.610 16360-16360/? A/DEBUG: Cmdline: com.ourapp.sm
2022-06-29 13:36:38.610 16360-16360/? A/DEBUG: pid: 16282, tid: 16282, name: com.ourapp.sm  >>> com.ourapp.sm <<<
2022-06-29 13:36:38.610 16360-16360/? A/DEBUG:       #01 pc 000000000039ccc4  /data/app/~~l-fpfTv3JOEU-rNFGVXnvA==/com.ourapp.sm-OzTGXILDWCH9vNJbAAejRg==/base.apk!librealm-jni.so (BuildId: 8233dde6fe4a96bdf9f1846a1e12689b58a893c1)
2022-06-29 13:36:38.610 16360-16360/? A/DEBUG:       #02 pc 000000000039ceec  /data/app/~~l-fpfTv3JOEU-rNFGVXnvA==/com.ourapp.sm-OzTGXILDWCH9vNJbAAejRg==/base.apk!librealm-jni.so (BuildId: 8233dde6fe4a96bdf9f1846a1e12689b58a893c1)
2022-06-29 13:36:38.610 16360-16360/? A/DEBUG:       #03 pc 000000000039cd7c  /data/app/~~l-fpfTv3JOEU-rNFGVXnvA==/com.ourapp.sm-OzTGXILDWCH9vNJbAAejRg==/base.apk!librealm-jni.so (BuildId: 8233dde6fe4a96bdf9f1846a1e12689b58a893c1)
2022-06-29 13:36:38.610 16360-16360/? A/DEBUG:       #04 pc 000000000039cd14  /data/app/~~l-fpfTv3JOEU-rNFGVXnvA==/com.ourapp.sm-OzTGXILDWCH9vNJbAAejRg==/base.apk!librealm-jni.so (std::terminate()+56) (BuildId: 8233dde6fe4a96bdf9f1846a1e12689b58a893c1)
2022-06-29 13:36:38.610 16360-16360/? A/DEBUG:       #05 pc 00000000003b837c  /data/app/~~l-fpfTv3JOEU-rNFGVXnvA==/com.ourapp.sm-OzTGXILDWCH9vNJbAAejRg==/base.apk!librealm-jni.so (BuildId: 8233dde6fe4a96bdf9f1846a1e12689b58a893c1)
2022-06-29 13:36:38.610 16360-16360/? A/DEBUG:       #06 pc 00000000004ba69c  /data/app/~~l-fpfTv3JOEU-rNFGVXnvA==/com.ourapp.sm-OzTGXILDWCH9vNJbAAejRg==/base.apk!librealm-jni.so (BuildId: 8233dde6fe4a96bdf9f1846a1e12689b58a893c1)
2022-06-29 13:36:38.610 16360-16360/? A/DEBUG:       #07 pc 0000000000622398  /data/app/~~l-fpfTv3JOEU-rNFGVXnvA==/com.ourapp.sm-OzTGXILDWCH9vNJbAAejRg==/base.apk!librealm-jni.so (BuildId: 8233dde6fe4a96bdf9f1846a1e12689b58a893c1)
2022-06-29 13:36:38.611 16360-16360/? A/DEBUG:       #08 pc 0000000000626e94  /data/app/~~l-fpfTv3JOEU-rNFGVXnvA==/com.ourapp.sm-OzTGXILDWCH9vNJbAAejRg==/base.apk!librealm-jni.so (BuildId: 8233dde6fe4a96bdf9f1846a1e12689b58a893c1)
2022-06-29 13:36:38.611 16360-16360/? A/DEBUG:       #09 pc 00000000005b4ff0  /data/app/~~l-fpfTv3JOEU-rNFGVXnvA==/com.ourapp.sm-OzTGXILDWCH9vNJbAAejRg==/base.apk!librealm-jni.so (BuildId: 8233dde6fe4a96bdf9f1846a1e12689b58a893c1)
2022-06-29 13:36:38.611 16360-16360/? A/DEBUG:       #10 pc 00000000004240ac  /data/app/~~l-fpfTv3JOEU-rNFGVXnvA==/com.ourapp.sm-OzTGXILDWCH9vNJbAAejRg==/base.apk!librealm-jni.so (BuildId: 8233dde6fe4a96bdf9f1846a1e12689b58a893c1)
2022-06-29 13:36:38.611 16360-16360/? A/DEBUG:       #11 pc 000000000042d714  /data/app/~~l-fpfTv3JOEU-rNFGVXnvA==/com.ourapp.sm-OzTGXILDWCH9vNJbAAejRg==/base.apk!librealm-jni.so (BuildId: 8233dde6fe4a96bdf9f1846a1e12689b58a893c1)
2022-06-29 13:36:38.611 16360-16360/? A/DEBUG:       #12 pc 00000000004686e0  /data/app/~~l-fpfTv3JOEU-rNFGVXnvA==/com.ourapp.sm-OzTGXILDWCH9vNJbAAejRg==/base.apk!librealm-jni.so (BuildId: 8233dde6fe4a96bdf9f1846a1e12689b58a893c1)
2022-06-29 13:36:38.611 16360-16360/? A/DEBUG:       #13 pc 0000000000468120  /data/app/~~l-fpfTv3JOEU-rNFGVXnvA==/com.ourapp.sm-OzTGXILDWCH9vNJbAAejRg==/base.apk!librealm-jni.so (BuildId: 8233dde6fe4a96bdf9f1846a1e12689b58a893c1)
2022-06-29 13:36:38.611 16360-16360/? A/DEBUG:       #14 pc 000000000048fe50  /data/app/~~l-fpfTv3JOEU-rNFGVXnvA==/com.ourapp.sm-OzTGXILDWCH9vNJbAAejRg==/base.apk!librealm-jni.so (BuildId: 8233dde6fe4a96bdf9f1846a1e12689b58a893c1)
2022-06-29 13:36:38.611 16360-16360/? A/DEBUG:       #15 pc 00000000004693b0  /data/app/~~l-fpfTv3JOEU-rNFGVXnvA==/com.ourapp.sm-OzTGXILDWCH9vNJbAAejRg==/base.apk!librealm-jni.so (BuildId: 8233dde6fe4a96bdf9f1846a1e12689b58a893c1)
2022-06-29 13:36:38.611 16360-16360/? A/DEBUG:       #16 pc 00000000003ea8d8  /data/app/~~l-fpfTv3JOEU-rNFGVXnvA==/com.ourapp.sm-OzTGXILDWCH9vNJbAAejRg==/base.apk!librealm-jni.so (Java_io_realm_internal_OsSharedRealm_nativeGetSharedRealm+132) (BuildId: 8233dde6fe4a96bdf9f1846a1e12689b58a893c1)
2022-06-29 13:36:38.611 16360-16360/? A/DEBUG:       #19 pc 00000000024a08d8  /data/app/~~l-fpfTv3JOEU-rNFGVXnvA==/com.ourapp.sm-OzTGXILDWCH9vNJbAAejRg==/oat/arm64/base.vdex

@clementetb
Copy link
Collaborator

@mattylase we are looking into the log you have shared in this issue: #7695

@clementetb
Copy link
Collaborator

Closing due to inactivity.

@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.
Labels
O-Community T-Bug Waiting-For-Reporter Waiting for more information from the reporter before we can proceed
Projects
None yet
Development

No branches or pull requests

6 participants