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

Decryption crash at realm version 10.12.0 #4428

Closed
RoosberryPi opened this issue Mar 17, 2022 · 3 comments
Closed

Decryption crash at realm version 10.12.0 #4428

RoosberryPi opened this issue Mar 17, 2022 · 3 comments
Assignees
Labels
O-Community T-Bug Waiting-For-Reporter Waiting for more information from the reporter before we can proceed

Comments

@RoosberryPi
Copy link

RoosberryPi commented Mar 17, 2022

How frequently does the bug occur?

Sometimes

Description

After an update from RealmJS 10.0.1 to 10.12.0 several crashes occurred at random places. Could find similar stack traces in issues reported in Realm Swift (realm/realm-swift#7629) and Realm Java (realm/realm-java#7652), which seem pretty recent.

Since the crashes occur only sometimes and the stacktraces are pretty abstract it makes it extremely hard to debug.
Is it possible that the update from 10.0.1 to 10.12.0 caused troubles with data migration?

Stacktrace & log output

Crash 1:

uncaught exception in notifier thread: N5realm5_impl17TransactLogParser14BadTransactLogE: Bad transaction log
2022-03-17 13:37:44.833660+0100 KarifyProApp[52407:2327307] uncaught exception in notifier thread: N5realm5_impl17TransactLogParser14BadTransactLogE: Bad transaction log
libc++abi: terminating with uncaught exception of type realm::_impl::TransactLogParser::BadTransactLog: Bad transaction log
dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/usr/lib/libMTLCapture.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
terminating with uncaught exception of type realm::_impl::TransactLogParser::BadTransactLog: Bad transaction log



Crash 2 (most common):


2022-03-17 14:42:03.364205+0100 KarifyProApp[53120:2353881] [javascript] write objects to realm, lock writes...
libc++abi: terminating with uncaught exception of type realm::util::DecryptionFailed: Decryption failed
Exception backtrace:
0   KarifyProApp                        0x0000000101bcbad8 _ZN5realm4util16DecryptionFailedC2Ev + 96
1   KarifyProApp                        0x0000000101bb51f4 _ZN5realm4util10AESCryptor4readEixPcm + 440
2   KarifyProApp                        0x0000000101bb5d80 _ZN5realm4util20EncryptedFileMapping12refresh_pageEm + 108
3   KarifyProApp                        0x0000000101bb6834 _ZN5realm4util20EncryptedFileMapping12read_barrierEPKvmPFmPKcE + 368
4   KarifyProApp                        0x0000000101728d44 _ZN5realm4util26do_encryption_read_barrierEPKvmPFmPKcEPNS0_20EncryptedFileMappingE + 84
5   KarifyProApp                        0x0000000101a38670 _ZNK5realm9Allocator23translate_less_criticalEPNS0_14RefTranslationEm + 448
6   KarifyProApp                        0x0000000101728b50 _ZN5realm5Array13init_from_refEm + 192
7   KarifyProApp                        0x0000000101a4c620 _ZNK5realm13ArrayBigBlobs6get_atEmRm + 108
8   KarifyProApp                        0x0000000101a70684 _ZZN5realm4util11FunctionRefIFvPNS_13BPlusTreeNodeEmEEC1IRZNKS_12BinaryColumn6get_atEmRmE3$_0EEOT_ENUlPvS3_mE_8__invokeESD_S3_m + 36
9   KarifyProApp                        0x0000000101a70630 _ZNK5realm12BinaryColumn6get_atEmRm + 132
10  KarifyProApp                        0x00000001017f1d10 _ZN5realm5_impl20ChangesetInputStream10next_blockERPKcS4_ + 96
11  KarifyProApp                        0x0000000101820620 _ZN5realm5_impl11transaction7advanceERNS_11TransactionERNS0_21TransactionChangeInfoENS_9VersionIDE + 876
12  KarifyProApp                        0x0000000101812380 _ZN12_GLOBAL__N_121IncrementalChangeInfo16advance_to_finalEN5realm9VersionIDE + 56
13  KarifyProApp                        0x0000000101811638 _ZN5realm5_impl16RealmCoordinator19run_async_notifiersEv + 3040
14  KarifyProApp                        0x00000001018109dc _ZN5realm5_impl16RealmCoordinator9on_changeEv + 24
15  KarifyProApp                        0x00000001017f4104 _ZN5realm5_impl20ExternalCommitHelper6listenEv + 204
16  KarifyProApp                        0x00000001017f4224 _ZNSt3__1L14__thread_proxyINS_5tupleIJNS_10unique_ptrINS_15__thread_structENS_14default_deleteIS3_EEEEZN5realm5_impl20ExternalCommitHelperC1ERNS8_16RealmCoordinatorEE3$_0EEEEEPvSE_ + 52
17  libsystem_pthread.dylib             0x000000023d2aa9ac _pthread_start + 148
18  libsystem_pthread.dylib             0x000000023d2a9e68 thread_start + 8
dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/usr/lib/libMTLCapture.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
terminating with uncaught exception of type realm::util::DecryptionFailed: Decryption failed

Can you reproduce the bug?

Not yet

Reproduction Steps

No response

Version

10.12.0

What SDK flavour are you using?

Local Database only

Are you using encryption?

Yes, using encryption

Platform OS and version(s)

iOS 15.4

Build environment

Which debugger for React Native: ..
Xcode debugger

Cocoapods version

1.11.3

@kneth
Copy link
Contributor

kneth commented Mar 18, 2022

@RoosberryPi Thank you for reporting. As you mentioned, it has been reported in multiple Realm SDKs. We are currently investigating it, and it is tracked by 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 Mar 18, 2022
@driq
Copy link

driq commented Mar 26, 2022

The report at realm/realm-swift#7629 suggests that this might be a regression introduced in realm-core v11.7.0 or v11.8.0

Realm-core was upgraded to v11.7.0 in realm-js v10.11.0, and to v11.8.0 in realm-js 10.12.0.

Depending on which version of realm-core introduced the regression, downgrading realm-js to v10.10.1 (containing realm-core v11.6.1 which was reported as ok in realm/realm-swift#7629) or to v10.11.0 (containing realm-core v11.7.0) might help to avoid the decryption crashes.

@sync-by-unito
Copy link

sync-by-unito bot commented Apr 25, 2022

➤ Finn Andersen commented:

Fixed by realm-core 11.14

@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

4 participants