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

Crash Either the encryption key is incorrect or data is corrupted after upgrading SDK to 10.54.0 #8719

Open
JohnnyTseng opened this issue Nov 22, 2024 · 0 comments

Comments

@JohnnyTseng
Copy link

JohnnyTseng commented Nov 22, 2024

How frequently does the bug occur?

Sometimes

Description

Hello,

We've upgraded our Realm SDK from 10.45.1 to 10.54.0, after that, we are receiving ~2000 crashes per day
All crashes points to same error message:

Fatal Exception: realm::util::DecryptionFailed
Decryption failed: page _[random number]_ in file of size _[random number]_ failed the HMAC check. Either the encryption key is incorrect or data is corrupted 

The only thing we did is upgrade Realm SDK version.
Currently we are unable to reproduce the issue, and we are trying our best to retrieve corrupted database from our users

In the meantime, we'd like to ask for help to see if there's anyway to mitigate or fix the crash, thank you!

Stacktrace & log output

This is the part of the stack trace before the crash


Fatal Exception: realm::util::DecryptionFailed
Decryption failed: page 65 in file of size 1069056 failed the HMAC check. Either the encryption key is incorrect or data is corrupted 0 
Realm 0x0000000105ac5e80 _ZN5realm4util16DecryptionFailed19get_message_with_btENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE + 60 1 
Realm 0x0000000105ac61ec _ZN5realm4util16DecryptionFailedC2ERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE + 56 2 
Realm 0x0000000105c67134 _ZN5realm4util20EncryptedFileMapping22throw_decryption_errorEmNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE + 152 3 Realm 0x0000000105ac53a4 _ZN5realm4util20EncryptedFileMapping12refresh_pageEmb + 396 4 
Realm 0x0000000105ac5a50 _ZN5realm4util20EncryptedFileMapping12read_barrierEPKvmb + 252 5 
Realm 0x00000001057fcb0c _ZNK5realm9Allocator18translate_criticalEPNS0_14RefTranslationEm + 200 6 
Realm 0x0000000105938cac _ZN5realm13BPlusTreeBase20create_root_from_refEm + 60 7 
Realm 0x0000000105950c10 _ZN5realm14CollectionBase19do_init_from_parentEPNS_13BPlusTreeBaseEmb + 36 8 
Realm 0x00000001059d517c _ZNK5realm6LnkLst4sizeEv + 28 9 
Realm 0x00000001057f20c4 -[RLMManagedArray count] + 28 10
Realm 0x00000001057caf94 -[RLMArray lastObject] + 20 11 
RealmSwift 0x0000000104ee6858 $s10RealmSwift0A14CollectionImplPAAE5first7ElementQzSgvgTm + 76 12 
RealmSwift 0x0000000104ee89dc $s10RealmSwift4ListCyxGAA0A10CollectionA2aEP4last7ElementQzSgvgTW + 80 13 


### Can you reproduce the bug?

No

### Reproduction Steps

_No response_

### Version

10.54.0

### What Atlas Services are you using?

Local Database only

### Are you using encryption?

Yes

### Platform OS and version(s)

iOS 15~18

### Build environment

Xcode version: 16.1
Dependency manager and version: CocoaPods 1.13.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant