realm / realm-js

Realm is a mobile database: an alternative to SQLite & key-value stores
https://realm.io
Apache License 2.0
5.79k stars 576 forks source link

Crash, Error: Unable to open a realm at path '/data/user/0/xxx/files/geo.realm': Realm file initial open failed: Invalid mnemonic. #4358

Closed stevenmathers closed 2 years ago

stevenmathers commented 2 years ago

How frequently does the bug occur?

Sometimes

Description

Crash, Error: Unable to open a realm at path '/data/user/0/xxx/files/geo.realm': Realm file initial open failed: Invalid mnemonic.

In our React Native mobile app, this error has started to appear for 10-15% of our users since our last release, yet we changed nothing to do with Realm in that release. Those users who get it, seem to get it repeatedly (locked out). The pattern is that a new install works fine, then when the app is launched subsequently, they get crashes on startup over and over, when Realm tries to read the file.

As its a small proportion of users, I have been unable to duplicate the error locally. So I released a new version that caught any exceptions from reading the realm file at startup and responded by deleting the file and creating the DB anew - downside is losing all the cached information, upside is of course they can still use the app. HOWEVER, I am finding that this hasnt fixed the problem.

Our Realm version 10.8.0 and has been for a long time.

Our encrypt key is static hardcoded.

Any insights appreciated. Is this familiar to anyone, or any suggestions at all really.

cheers

Stacktrace & log output

Crash, Error: Unable to open a realm at path '/data/user/0/io.geoworkforce/files/geo.realm': Realm file initial open failed: Invalid mnemonic. top_ref[0]: 411F60114140B39E, top_ref[1]: 3A2272657375227B, mnemonic: 22 73 65 72, fmt[0]: 118, fmt[1]: 105, flags: 65 Path:Exception backtrace: <backtrace not supported on this platform> Path: /data/user/0/io.geoworkforce/files/geo.realm Exception backtrace: <backtrace not supported on this platform>. This error is located at: in f in RCTView in Unknown in RCTView in Unknown in C, stack: schemaVersion@-1 openDB@887:2067 openDB@1014:606 value@423:3176 f@423:1639 lr@95:31853 bl@95:51882 ti@95:78509 ei@95:78437 Za@95:78202 qa@95:75364 qa@-1 <unknown>@95:26064 unstable_runWithPriority@192:3806 Ct@95:26011 Pt@95:25946 Oa@95:72858 Pi@95:88019 render@95:94758 exports@354:626 run@346:740 runApplication@346:1775 value@49:3492 <unknown>@49:747 value@49:2538 value@49:719 value@-1

Can you reproduce the bug?

Not yet

Reproduction Steps

No response

Version

10.8.0

What SDK flavour are you using?

Local Database only

Are you using encryption?

Yes, using encryption

Platform OS and version(s)

ios and android all kinds

Build environment

Which debugger for React Native: ..

Cocoapods version

No response

stevenmathers commented 2 years ago

I mean, I tested the work around I released by corrupting the realm.file in my debug environment and observing the exception go on to delete the file and create a new realm in its place. I was confident this would at least prevent the crash and give me time to work out the root cause. How could it not work? Im not sure. We open the db at startup one time and retain a reference to it, never closing it. Nothing at all has changed in that respect for a long time. It may not be best practice (not sure) but it hasnt failed us before so there has been no reason to change.

stevenmathers commented 2 years ago

My most pressing concern is protecting users from the crash. Why catching the exception and deleting the problematic xxx.realm file NOT work?

1) Either its not a problem with the file and its a problem with Realm 10.8.0 itself when it tries to open a Realm, even a new one, but then....we have been using this version for ages and had zero problems, but with this one release all of a sudden boom.
Q) would there be any dependencies that may have upgraded a minor version and been dragged into this release when it was built? What is Realm dependent on that might have a symptom like this?

2) Would I need to delete xxx.realm.lock and anything in xxx.realm.management as well in order for my workaround to work in the field? it worked in my local test when I basically replaced xxx.realm with a random text file (simulating unreadable realm file). But perhaps the issue is not the xxx.realm file but one of the other files that I am not deleting?

stevenmathers commented 2 years ago

one more clue - I have had a report from 2 users that the problem spontaneously resolves itself in some cases (in the case of repeated fresh installs)

what I mean is that once they 'get the issue' they can delete the app and reinstall the app, and the problem persists - first app launch is fine, but subsequent app launches fail. And they can repeat this multiple times with multiple fresh installs and it keeps failing in the same pattern. Except...sometimes after a few repeats of this process, the problem 'goes away'

you can see why I am scratching my head

fronck commented 2 years ago

@stevenmathers Are you using encrypted realms? Nvm :) The "Invalid mnemonic" error is thrown when one tried to access an encrypted realm with the wrong key/no key. How are you managing the keys (e.g., are the users entering them themselves when using the app)?

stevenmathers commented 2 years ago

Hiya, Im using a static hardcoded key - not the most secure, but its unable to change, so we can rule out the wrong key.

stevenmathers commented 2 years ago

heya, yes we are

we are using a static hardcoded key, so ist not a key mixup or a no-key situation.

On Fri, Feb 18, 2022 at 8:32 PM FFranck @.***> wrote:

@stevenmathers https://github.com/stevenmathers Are you using encrypted realms?

— Reply to this email directly, view it on GitHub https://github.com/realm/realm-js/issues/4358#issuecomment-1044214362, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKQ2O6PW2S35PHC2F4GJOZ3U3YG3TANCNFSM5OWPGJQQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

fronck commented 2 years ago

Are you doing any copying of files, either at the filesystem level, or through the writeCopyTo() method? The users' database files seem to have become corrupted. The "mnemonic" Realm.open() looks for is the first four bytes of the .realm file, which should be T-DB.

stevenmathers commented 2 years ago

Hi. Im using new Realm() rather than Realm.open(), but I can use Realm.open if that is preferred. Its never been an issue before.

The realm path is the mobile apps Document directory, which translates to a safe persistent space on either ios or android. (i.e. not cleaned up by the OS) Always worked , has not been changed.

writeCopyTo not used anywhere

NEW INFO: in iOS, still crashing at startup, Im seeing this. Previously I was not getting any helpful info in iOS about the nature of the exception. Perhaps my previous attempt to work around this issue is providing more info? Anyway, it is still crashing at schemaVersion, but the reason is slightly different in iOS?

Crash, Unhandled JS Exception: Error: No such table exists Exception backtrace: 0 GeoNext 0x0000000102617f8c _ZN8facebook5react11JSIExecutor21defaultTim..., stack: schemaVersion@(null):(null) openDB@890:2067 openDB@1017:606 value@426:3176 f@426:1639 lr@95:31853 bl@95:51882 ti@95:78509 ei@95:78437 Za@95:78202 qa@95:75364 qa@(null):(null) @95:26064 @193:3806 Ct@95:26011 Pt@95:25946 Oa@95:72858 Pi@95:88019 @95:94758 @359:626 run@351:740 runApplication@351:1775 value@46:3492 @46:747 value@46:2538 value@46:719 value@(null):(null)

Frans-L commented 2 years ago

Facing a similar kind of issue with the latest Realm when encryption is used.

Users are able to use the app normally, with some occasional crashes. After a few crashes, the database will become corrupted and thus cannot be opened anymore.

The occasional crashing seems to be related to this: https://github.com/realm/realm-swift/issues/7659

and the corruption for this: https://github.com/realm/realm-core/issues/5174

I'll write a proper issue once I have time to test this properly and find the proper logs.

fronck commented 2 years ago

@Frans-L Thanks for the links. We will follow up with the other teams to investigate any connections.

fronck commented 2 years ago

@stevenmathers @Frans-L If either of you are able to supply reproduction code, that would help us immensely in tracking down the issue.

fronck commented 2 years ago

@Frans-L @stevenmathers Do you know whether this issue can be triggered when the app is shut down manually (e.g., exiting the app from the UI), or if you're only seeing it when the OS suspends or kills the app?

Frans-L commented 2 years ago

@fronck

We found this bug while testing the latest Realm-JS version with our ~15 internal test users. They used our app with latest realm version for 3 days. During those 3 days:

We haven't yet managed to make a producible demo. We tried to revert the user data back to the point before corruption, and redo the same actions, but the crash/corruption didn't happen. So, it feels like it's not a fully deterministic crash.

This could pure coincide, but in our case, the crashes have happened only during 2 different actions. In both actions, we are writing into Realm and opening the iOS native modal at the same time. During the one action, we are writing new ~30 small objects into Realm, and opening React Native default modal component. During the other action, we are opening a react-navigation (v6) modal and updating 1 property from 1 Realm object. For my understanding, the RN's default modal and the library's modal are using the same iOS native modal component. However, I want to emphasize that this could be a pure coincide.

Here's stack trace of a crash that happened before the corruption:

Show stack trace ``` OS Version: iOS 15.1 (19B74) Report Version: 104 Exception Type: EXC_CRASH (SIGABRT) Crashed Thread: 11 Application Specific Information: N5realm4util16DecryptionFailedE Thread 11 Crashed: 0 Veri 0x200b0d214 __cxa_throw 1 Veri 0x200b0dcc0 __cxa_throw 2 Veri 0x200b0e548 __cxa_throw 3 Veri 0x200745b30 __cxa_throw 4 Veri 0x20074597c __cxa_throw 5 Veri 0x2009e8f78 __cxa_throw 6 Veri 0x200a0ad78 __cxa_throw 7 Veri 0x200a0ad24 __cxa_throw 8 Veri 0x2007dfda8 __cxa_throw 9 Veri 0x200816acc __cxa_throw 10 Veri 0x2008087dc __cxa_throw 11 Veri 0x200807b04 __cxa_throw 12 Veri 0x200806ebc __cxa_throw 13 Veri 0x2007e2168 __cxa_throw 14 Veri 0x2007e2288 __cxa_throw 15 libsystem_pthread.dylib 0x3e27679a0 _pthread_start 16 libsystem_pthread.dylib 0x3e2766e9c thread_start Thread 0 0 libsystem_kernel.dylib 0x36ef93504 mach_msg_trap 1 libsystem_kernel.dylib 0x36ef93b98 mach_msg 2 CoreFoundation 0x300f2b684 __CFRunLoopServiceMachPort 3 CoreFoundation 0x300f2f978 __CFRunLoopRun 4 CoreFoundation 0x300f433b4 CFRunLoopRunSpecific 5 GraphicsServices 0x338281388 GSEventRunModal 6 UIKitCore 0x305d896a4 -[UIApplication _run] 7 UIKitCore 0x305b087f0 UIApplicationMain 8 Veri 0x20049b19c 9 0x101091a24 Thread 1 name: com.apple.uikit.eventfetch-thread 0 libsystem_kernel.dylib 0x36ef93504 mach_msg_trap 1 libsystem_kernel.dylib 0x36ef93b98 mach_msg 2 CoreFoundation 0x300f2b684 __CFRunLoopServiceMachPort 3 CoreFoundation 0x300f2f978 __CFRunLoopRun 4 CoreFoundation 0x300f433b4 CFRunLoopRunSpecific 5 Foundation 0x303f80350 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] 6 Foundation 0x303fc1c24 -[NSRunLoop(NSRunLoop) runUntilDate:] 7 UIKitCore 0x305d028a0 -[UIEventFetcher threadMain] 8 Foundation 0x303fd0368 __NSThread__start__ 9 libsystem_pthread.dylib 0x3e27679a0 _pthread_start Thread 2 name: com.facebook.react.JavaScript 0 libsystem_kernel.dylib 0x36ef93f90 __psynch_cvwait 1 libsystem_pthread.dylib 0x3e276e250 _pthread_cond_wait 2 libc++.1.dylib 0x331e69dd8 std::__1::condition_variable::wait 3 Veri 0x200862cc8 __cxa_throw 4 Veri 0x200865d50 __cxa_throw 5 Veri 0x2007aa72c __cxa_throw 6 Veri 0x200789a08 __cxa_throw 7 JavaScriptCore 0x3171a12e4 JSC::APICallbackFunction::callImpl 8 JavaScriptCore 0x3170fed7c llint_function_for_construct_arity_checkTagGateAfter 9 JavaScriptCore 0x3170fba78 llint_function_for_construct_arity_checkTagGateAfter 10 JavaScriptCore 0x3170d23f4 vmEntryToJavaScriptTrampoline 11 JavaScriptCore 0x31780cc28 JSC::Interpreter::executeCall 12 JavaScriptCore 0x317b5cb78 JSC::boundThisNoArgsFunctionCall 13 JavaScriptCore 0x3170fec74 llint_function_for_construct_arity_checkTagGateAfter 14 JavaScriptCore 0x3170fbb4c [inlined] llint_function_for_construct_arity_checkTagGateAfter 15 JavaScriptCore 0x3170fbb4c llint_function_for_construct_arity_checkTagGateAfter 16 JavaScriptCore 0x3170d23f4 vmEntryToJavaScriptTrampoline 17 JavaScriptCore 0x31780cc28 JSC::Interpreter::executeCall 18 JavaScriptCore 0x317b5cb78 JSC::boundThisNoArgsFunctionCall 19 JavaScriptCore 0x3170fec74 llint_function_for_construct_arity_checkTagGateAfter 20 JavaScriptCore 0x3170fbb4c [inlined] llint_function_for_construct_arity_checkTagGateAfter 21 JavaScriptCore 0x3170fbb4c [inlined] llint_function_for_construct_arity_checkTagGateAfter 22 JavaScriptCore 0x3170fbb4c llint_function_for_construct_arity_checkTagGateAfter 23 JavaScriptCore 0x3170fba78 llint_function_for_construct_arity_checkTagGateAfter 24 JavaScriptCore 0x3170fbb4c llint_function_for_construct_arity_checkTagGateAfter 25 JavaScriptCore 0x3170fba78 llint_function_for_construct_arity_checkTagGateAfter 26 JavaScriptCore 0x3170fbb4c [inlined] llint_function_for_construct_arity_checkTagGateAfter 27 JavaScriptCore 0x3170fbb4c llint_function_for_construct_arity_checkTagGateAfter 28 JavaScriptCore 0x3170fce98 llint_function_for_construct_arity_checkTagGateAfter 29 JavaScriptCore 0x3170fbb4c llint_function_for_construct_arity_checkTagGateAfter 30 JavaScriptCore 0x3170fba78 llint_function_for_construct_arity_checkTagGateAfter 31 JavaScriptCore 0x3170fbb4c [inlined] llint_function_for_construct_arity_checkTagGateAfter 32 JavaScriptCore 0x3170fbb4c [inlined] llint_function_for_construct_arity_checkTagGateAfter 33 JavaScriptCore 0x3170fbb4c llint_function_for_construct_arity_checkTagGateAfter 34 JavaScriptCore 0x3170fba78 llint_function_for_construct_arity_checkTagGateAfter 35 JavaScriptCore 0x3170fbb4c llint_function_for_construct_arity_checkTagGateAfter 36 JavaScriptCore 0x3170fba78 llint_function_for_construct_arity_checkTagGateAfter 37 JavaScriptCore 0x3170fbb4c [inlined] llint_function_for_construct_arity_checkTagGateAfter 38 JavaScriptCore 0x3170fbb4c llint_function_for_construct_arity_checkTagGateAfter 39 JavaScriptCore 0x3170fce98 llint_function_for_construct_arity_checkTagGateAfter 40 JavaScriptCore 0x3170fbb4c llint_function_for_construct_arity_checkTagGateAfter 41 JavaScriptCore 0x3170fba78 llint_function_for_construct_arity_checkTagGateAfter 42 JavaScriptCore 0x3170fbb4c [inlined] llint_function_for_construct_arity_checkTagGateAfter 43 JavaScriptCore 0x3170fbb4c [inlined] llint_function_for_construct_arity_checkTagGateAfter 44 JavaScriptCore 0x3170fbb4c llint_function_for_construct_arity_checkTagGateAfter 45 JavaScriptCore 0x3170fba78 llint_function_for_construct_arity_checkTagGateAfter 46 JavaScriptCore 0x3170fbb4c llint_function_for_construct_arity_checkTagGateAfter 47 JavaScriptCore 0x3170fba78 llint_function_for_construct_arity_checkTagGateAfter 48 JavaScriptCore 0x3170fbb4c [inlined] llint_function_for_construct_arity_checkTagGateAfter 49 JavaScriptCore 0x3170fbb4c [inlined] llint_function_for_construct_arity_checkTagGateAfter 50 JavaScriptCore 0x3170fbb4c llint_function_for_construct_arity_checkTagGateAfter 51 JavaScriptCore 0x3170fba78 [inlined] llint_function_for_construct_arity_checkTagGateAfter 52 JavaScriptCore 0x3170fba78 llint_function_for_construct_arity_checkTagGateAfter 53 JavaScriptCore 0x3170fd558 llint_function_for_construct_arity_checkTagGateAfter 54 JavaScriptCore 0x3170fbb4c llint_function_for_construct_arity_checkTagGateAfter 55 JavaScriptCore 0x3170fba78 [inlined] llint_function_for_construct_arity_checkTagGateAfter 56 JavaScriptCore 0x3170fba78 [inlined] llint_function_for_construct_arity_checkTagGateAfter 57 JavaScriptCore 0x3170fba78 [inlined] llint_function_for_construct_arity_checkTagGateAfter 58 JavaScriptCore 0x3170fba78 llint_function_for_construct_arity_checkTagGateAfter 59 JavaScriptCore 0x3170fbb4c llint_function_for_construct_arity_checkTagGateAfter 60 JavaScriptCore 0x3170fba78 llint_function_for_construct_arity_checkTagGateAfter 61 JavaScriptCore 0x3170d23f4 vmEntryToJavaScriptTrampoline 62 JavaScriptCore 0x31780cc28 JSC::Interpreter::executeCall 63 JavaScriptCore 0x317b5cb78 JSC::boundThisNoArgsFunctionCall 64 JavaScriptCore 0x3170fec74 llint_function_for_construct_arity_checkTagGateAfter 65 JavaScriptCore 0x3170d23f4 vmEntryToJavaScriptTrampoline 66 JavaScriptCore 0x31780cc28 JSC::Interpreter::executeCall 67 JavaScriptCore 0x317b5cb78 JSC::boundThisNoArgsFunctionCall 68 JavaScriptCore 0x3170d25a4 vmEntryToNative 69 JavaScriptCore 0x31780cc50 JSC::Interpreter::executeCall 70 JavaScriptCore 0x317aac130 JSC::profiledCall 71 JavaScriptCore 0x3171b0508 JSObjectCallAsFunction 72 Veri 0x200667574 facebook::react::JSIExecutor::defaultTimeoutInvoker 73 Veri 0x200670488 facebook::react::JSIExecutor::defaultTimeoutInvoker 74 Veri 0x200663bf8 facebook::react::JSIExecutor::defaultTimeoutInvoker 75 Veri 0x2005af960 facebook::react::JSIExecutor::defaultTimeoutInvoker 76 Veri 0x2005bbb40 facebook::react::JSIExecutor::defaultTimeoutInvoker 77 Veri 0x2005bb8f4 facebook::react::JSIExecutor::defaultTimeoutInvoker 78 CoreFoundation 0x300f96920 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ 79 CoreFoundation 0x300f9781c __CFRunLoopDoBlocks 80 CoreFoundation 0x300f2fb7c __CFRunLoopRun 81 CoreFoundation 0x300f433b4 CFRunLoopRunSpecific 82 Veri 0x2005a4adc facebook::react::JSIExecutor::defaultTimeoutInvoker 83 Foundation 0x303fd0368 __NSThread__start__ 84 libsystem_pthread.dylib 0x3e27679a0 _pthread_start Thread 3 name: JavaScriptCore bmalloc scavenger 0 libsystem_kernel.dylib 0x36ef93f90 __psynch_cvwait 1 libsystem_pthread.dylib 0x3e276e250 _pthread_cond_wait 2 libc++.1.dylib 0x331e69dd8 std::__1::condition_variable::wait 3 JavaScriptCore 0x317ff21d0 std::__1::condition_variable_any::wait 4 JavaScriptCore 0x317ff69a0 bmalloc::Scavenger::threadRunLoop 5 JavaScriptCore 0x317ff6540 bmalloc::Scavenger::threadEntryPoint 6 JavaScriptCore 0x317ff79fc std::__1::__thread_proxy 7 libsystem_pthread.dylib 0x3e27679a0 _pthread_start Thread 4 name: AVAudioSession Notify Thread 0 libsystem_kernel.dylib 0x36ef93504 mach_msg_trap 1 libsystem_kernel.dylib 0x36ef93b98 mach_msg 2 CoreFoundation 0x300f2b684 __CFRunLoopServiceMachPort 3 CoreFoundation 0x300f2f978 __CFRunLoopRun 4 CoreFoundation 0x300f433b4 CFRunLoopRunSpecific 5 AudioSession 0x313684304 CADeprecated::GenericRunLoopThread::Entry 6 AudioSession 0x31368dd60 CADeprecated::CAPThread::Entry 7 libsystem_pthread.dylib 0x3e27679a0 _pthread_start Thread 5 0 libsystem_kernel.dylib 0x36ef93ae4 __semwait_signal 1 libsystem_c.dylib 0x316c96efc nanosleep 2 libsystem_c.dylib 0x316caaf38 sleep 3 Veri 0x20069c100 facebook::react::JSIExecutor::defaultTimeoutInvoker 4 libsystem_pthread.dylib 0x3e27679a0 _pthread_start Thread 6 name: SentryCrash Exception Handler (Secondary) 0 libsystem_kernel.dylib 0x36ef93504 mach_msg_trap 1 libsystem_kernel.dylib 0x36ef93b98 mach_msg 2 libsystem_kernel.dylib 0x36ef9f22c thread_suspend 3 Veri 0x2006a8988 __cxa_throw 4 libsystem_pthread.dylib 0x3e27679a0 _pthread_start Thread 7 name: SentryCrash Exception Handler (Primary) 0 libsystem_kernel.dylib 0x36ef93504 mach_msg_trap 1 libsystem_kernel.dylib 0x36ef93b98 mach_msg 2 Veri 0x2006a89b4 __cxa_throw 3 libsystem_pthread.dylib 0x3e27679a0 _pthread_start Thread 8 name: com.squareup.SocketRocket.NetworkThread 0 libsystem_kernel.dylib 0x36ef93504 mach_msg_trap 1 libsystem_kernel.dylib 0x36ef93b98 mach_msg 2 CoreFoundation 0x300f2b684 __CFRunLoopServiceMachPort 3 CoreFoundation 0x300f2f978 __CFRunLoopRun 4 CoreFoundation 0x300f433b4 CFRunLoopRunSpecific 5 Foundation 0x303f80350 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] 6 Veri 0x2005dff34 facebook::react::JSIExecutor::defaultTimeoutInvoker 7 Foundation 0x303fd0368 __NSThread__start__ 8 libsystem_pthread.dylib 0x3e27679a0 _pthread_start Thread 9 name: com.apple.NSURLConnectionLoader 0 libsystem_kernel.dylib 0x36ef93504 mach_msg_trap 1 libsystem_kernel.dylib 0x36ef93b98 mach_msg 2 CoreFoundation 0x300f2b684 __CFRunLoopServiceMachPort 3 CoreFoundation 0x300f2f978 __CFRunLoopRun 4 CoreFoundation 0x300f433b4 CFRunLoopRunSpecific 5 CFNetwork 0x3021d069c _CFURLStorageSessionCopyIdentifier 6 Foundation 0x303fd0368 __NSThread__start__ 7 libsystem_pthread.dylib 0x3e27679a0 _pthread_start Thread 10 name: Realm notification listener 0 libsystem_kernel.dylib 0x36ef94e7c kevent 1 Veri 0x2007e2138 __cxa_throw 2 Veri 0x2007e2288 __cxa_throw 3 libsystem_pthread.dylib 0x3e27679a0 _pthread_start Thread 11 name: Realm notification listener Crashed: 0 Veri 0x200b0d214 __cxa_throw 1 Veri 0x200b0dcc0 __cxa_throw 2 Veri 0x200b0e548 __cxa_throw 3 Veri 0x200745b30 __cxa_throw 4 Veri 0x20074597c __cxa_throw 5 Veri 0x2009e8f78 __cxa_throw 6 Veri 0x200a0ad78 __cxa_throw 7 Veri 0x200a0ad24 __cxa_throw 8 Veri 0x2007dfda8 __cxa_throw 9 Veri 0x200816acc __cxa_throw 10 Veri 0x2008087dc __cxa_throw 11 Veri 0x200807b04 __cxa_throw 12 Veri 0x200806ebc __cxa_throw 13 Veri 0x2007e2168 __cxa_throw 14 Veri 0x2007e2288 __cxa_throw 15 libsystem_pthread.dylib 0x3e27679a0 _pthread_start 16 libsystem_pthread.dylib 0x3e2766e9c thread_start Thread 12 0 libsystem_kernel.dylib 0x36ef95a10 __fcntl 1 libsystem_kernel.dylib 0x36ef9511c fcntl 2 Veri 0x200b11dfc __cxa_throw 3 Veri 0x200a2d8dc __cxa_throw 4 Veri 0x200a162bc __cxa_throw 5 Veri 0x200a109e8 __cxa_throw 6 Veri 0x200a14bc8 __cxa_throw 7 libsystem_pthread.dylib 0x3e27679a0 _pthread_start Thread 13 0 libsystem_kernel.dylib 0x36ef93f90 __psynch_cvwait 1 libsystem_pthread.dylib 0x3e276e250 _pthread_cond_wait 2 libc++.1.dylib 0x331e69dd8 std::__1::condition_variable::wait 3 Veri 0x200a10b18 __cxa_throw 4 Veri 0x200a14bc8 __cxa_throw 5 libsystem_pthread.dylib 0x3e27679a0 _pthread_start Thread 14 name: com.squareup.SocketRocket.NetworkThread 0 libsystem_kernel.dylib 0x36ef93504 mach_msg_trap 1 libsystem_kernel.dylib 0x36ef93b98 mach_msg 2 CoreFoundation 0x300f2b684 __CFRunLoopServiceMachPort 3 CoreFoundation 0x300f2f978 __CFRunLoopRun 4 CoreFoundation 0x300f433b4 CFRunLoopRunSpecific 5 Foundation 0x303f80350 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] 6 Intercom 0x1012d2f18 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector 7 Foundation 0x303fd0368 __NSThread__start__ 8 libsystem_pthread.dylib 0x3e27679a0 _pthread_start Thread 15 name: com.apple.CFSocket.private 0 libsystem_kernel.dylib 0x36ef941d0 __select 1 CoreFoundation 0x300fce73c __CFSocketManager 2 libsystem_pthread.dylib 0x3e27679a0 _pthread_start Thread 16 0 libsystem_pthread.dylib 0x3e2766e8c start_wqthread Thread 17 0 libsystem_kernel.dylib 0x36ef93b2c __workq_kernreturn 1 libsystem_pthread.dylib 0x3e276713c _pthread_wqthread Thread 18 0 libsystem_kernel.dylib 0x36ef93b2c __workq_kernreturn 1 libsystem_pthread.dylib 0x3e276713c _pthread_wqthread Thread 19 0 libsystem_kernel.dylib 0x36ef93b2c __workq_kernreturn 1 libsystem_pthread.dylib 0x3e276713c _pthread_wqthread Thread 20 0 libsystem_kernel.dylib 0x36ef93b2c __workq_kernreturn 1 libsystem_pthread.dylib 0x3e276713c _pthread_wqthread Thread 21 0 libsystem_kernel.dylib 0x36ef93b2c __workq_kernreturn 1 libsystem_pthread.dylib 0x3e276713c _pthread_wqthread Thread 22 0 libsystem_kernel.dylib 0x36ef93b2c __workq_kernreturn 1 libsystem_pthread.dylib 0x3e276713c _pthread_wqthread Thread 23 0 libsystem_kernel.dylib 0x36ef93b2c __workq_kernreturn 1 libsystem_pthread.dylib 0x3e276713c _pthread_wqthread Thread 24 0 libsystem_kernel.dylib 0x36ef93f90 __psynch_cvwait 1 libsystem_pthread.dylib 0x3e276e250 _pthread_cond_wait 2 JavaScriptCore 0x317f795a0 WTF::ParkingLot::parkConditionallyImpl 3 JavaScriptCore 0x317e3e560 WTF::Condition::waitUntilUnchecked 4 JavaScriptCore 0x317f43fec WTF::Detail::CallableWrapper::call 5 JavaScriptCore 0x317f9f3c8 WTF::Thread::entryPoint 6 JavaScriptCore 0x317fa1d24 WTF::wtfThreadEntryPoint 7 libsystem_pthread.dylib 0x3e27679a0 _pthread_start Thread 25 0 libsystem_kernel.dylib 0x36ef93f90 __psynch_cvwait 1 libsystem_pthread.dylib 0x3e276e250 _pthread_cond_wait 2 JavaScriptCore 0x317f795a0 WTF::ParkingLot::parkConditionallyImpl 3 JavaScriptCore 0x317e3e560 WTF::Condition::waitUntilUnchecked 4 JavaScriptCore 0x317f43fec WTF::Detail::CallableWrapper::call 5 JavaScriptCore 0x317f9f3c8 WTF::Thread::entryPoint 6 JavaScriptCore 0x317fa1d24 WTF::wtfThreadEntryPoint 7 libsystem_pthread.dylib 0x3e27679a0 _pthread_start Thread 26 0 libsystem_kernel.dylib 0x36ef93f90 __psynch_cvwait 1 libsystem_pthread.dylib 0x3e276e250 _pthread_cond_wait 2 JavaScriptCore 0x317f795a0 WTF::ParkingLot::parkConditionallyImpl 3 JavaScriptCore 0x317e3e560 WTF::Condition::waitUntilUnchecked 4 JavaScriptCore 0x317f43fec WTF::Detail::CallableWrapper::call 5 JavaScriptCore 0x317f9f3c8 WTF::Thread::entryPoint 6 JavaScriptCore 0x317fa1d24 WTF::wtfThreadEntryPoint 7 libsystem_pthread.dylib 0x3e27679a0 _pthread_start Thread 27 0 libsystem_kernel.dylib 0x36ef93f90 __psynch_cvwait 1 libsystem_pthread.dylib 0x3e276e250 _pthread_cond_wait 2 JavaScriptCore 0x317f795a0 WTF::ParkingLot::parkConditionallyImpl 3 JavaScriptCore 0x317e3e560 WTF::Condition::waitUntilUnchecked 4 JavaScriptCore 0x317f43fec WTF::Detail::CallableWrapper::call 5 JavaScriptCore 0x317f9f3c8 WTF::Thread::entryPoint 6 JavaScriptCore 0x317fa1d24 WTF::wtfThreadEntryPoint 7 libsystem_pthread.dylib 0x3e27679a0 _pthread_start Thread 28 0 libsystem_kernel.dylib 0x36ef93f90 __psynch_cvwait 1 libsystem_pthread.dylib 0x3e276e250 _pthread_cond_wait 2 JavaScriptCore 0x317f795a0 WTF::ParkingLot::parkConditionallyImpl 3 JavaScriptCore 0x317e3e560 WTF::Condition::waitUntilUnchecked 4 JavaScriptCore 0x317f43fec WTF::Detail::CallableWrapper::call 5 JavaScriptCore 0x317f9f3c8 WTF::Thread::entryPoint 6 JavaScriptCore 0x317fa1d24 WTF::wtfThreadEntryPoint 7 libsystem_pthread.dylib 0x3e27679a0 _pthread_start Thread 29 0 libsystem_kernel.dylib 0x36ef93f90 __psynch_cvwait 1 libsystem_pthread.dylib 0x3e276e250 _pthread_cond_wait 2 JavaScriptCore 0x317f795a0 WTF::ParkingLot::parkConditionallyImpl 3 JavaScriptCore 0x317e3e560 WTF::Condition::waitUntilUnchecked 4 JavaScriptCore 0x317f43fec WTF::Detail::CallableWrapper::call 5 JavaScriptCore 0x317f9f3c8 WTF::Thread::entryPoint 6 JavaScriptCore 0x317fa1d24 WTF::wtfThreadEntryPoint 7 libsystem_pthread.dylib 0x3e27679a0 _pthread_start EOF ```

Here's the stack trace that happen after the database has been corrupted:

Show stack trace ``` OS Version: iOS 15.0.1 (19A348) Report Version: 104 Exception Type: EXC_CRASH (SIGABRT) Crashed Thread: 7 Application Specific Information: N5realm4util16DecryptionFailedE Thread 7 Crashed: 0 Veri 0x200ce32b0 __cxa_throw 1 Veri 0x200ce3d78 __cxa_throw 2 Veri 0x200ce45fc __cxa_throw 3 Veri 0x200919f6c __cxa_throw 4 Veri 0x200ba7e20 __cxa_throw 5 Veri 0x200919d9c __cxa_throw 6 Veri 0x200bdd710 __cxa_throw 7 Veri 0x200be0790 __cxa_throw 8 Veri 0x200be5834 __cxa_throw 9 Veri 0x2009d6460 __cxa_throw 10 Veri 0x2009d77a0 __cxa_throw 11 Veri 0x2009d75ec __cxa_throw 12 Veri 0x200a3ac10 __cxa_throw 13 Veri 0x20095d4f0 __cxa_throw 14 Veri 0x20095bd00 __cxa_throw 15 JavaScriptCore 0x316b0fd8c JSC::APICallbackFunction::callImpl 16 JavaScriptCore 0x316a6d6f8 llint_function_for_construct_arity_checkTagGateAfter 17 JavaScriptCore 0x316a6a698 llint_function_for_construct_arity_checkTagGateAfter 18 JavaScriptCore 0x316a6a760 llint_function_for_construct_arity_checkTagGateAfter 19 JavaScriptCore 0x316a6a698 llint_function_for_construct_arity_checkTagGateAfter 20 JavaScriptCore 0x316a6a760 llint_function_for_construct_arity_checkTagGateAfter 21 JavaScriptCore 0x316a6a698 llint_function_for_construct_arity_checkTagGateAfter 22 JavaScriptCore 0x316a6a760 [inlined] llint_function_for_construct_arity_checkTagGateAfter 23 JavaScriptCore 0x316a6a760 llint_function_for_construct_arity_checkTagGateAfter 24 JavaScriptCore 0x316a6b974 llint_function_for_construct_arity_checkTagGateAfter 25 JavaScriptCore 0x316a6a760 llint_function_for_construct_arity_checkTagGateAfter 26 JavaScriptCore 0x316a6a698 [inlined] llint_function_for_construct_arity_checkTagGateAfter 27 JavaScriptCore 0x316a6a698 llint_function_for_construct_arity_checkTagGateAfter 28 JavaScriptCore 0x316a6a760 [inlined] llint_function_for_construct_arity_checkTagGateAfter 29 JavaScriptCore 0x316a6a760 llint_function_for_construct_arity_checkTagGateAfter 30 JavaScriptCore 0x316a6a698 llint_function_for_construct_arity_checkTagGateAfter 31 JavaScriptCore 0x316a6a760 llint_function_for_construct_arity_checkTagGateAfter 32 JavaScriptCore 0x316a6a698 llint_function_for_construct_arity_checkTagGateAfter 33 JavaScriptCore 0x316a6a760 [inlined] llint_function_for_construct_arity_checkTagGateAfter 34 JavaScriptCore 0x316a6a760 [inlined] llint_function_for_construct_arity_checkTagGateAfter 35 JavaScriptCore 0x316a6a760 llint_function_for_construct_arity_checkTagGateAfter 36 JavaScriptCore 0x316a6a698 [inlined] llint_function_for_construct_arity_checkTagGateAfter 37 JavaScriptCore 0x316a6a698 llint_function_for_construct_arity_checkTagGateAfter 38 JavaScriptCore 0x316a6bfbc llint_function_for_construct_arity_checkTagGateAfter 39 JavaScriptCore 0x316a6a760 llint_function_for_construct_arity_checkTagGateAfter 40 JavaScriptCore 0x316a6a698 [inlined] llint_function_for_construct_arity_checkTagGateAfter 41 JavaScriptCore 0x316a6a698 [inlined] llint_function_for_construct_arity_checkTagGateAfter 42 JavaScriptCore 0x316a6a698 [inlined] llint_function_for_construct_arity_checkTagGateAfter 43 JavaScriptCore 0x316a6a698 llint_function_for_construct_arity_checkTagGateAfter 44 JavaScriptCore 0x316a6a760 llint_function_for_construct_arity_checkTagGateAfter 45 JavaScriptCore 0x316a6a698 llint_function_for_construct_arity_checkTagGateAfter 46 JavaScriptCore 0x316a41b84 vmEntryToJavaScriptTrampoline 47 JavaScriptCore 0x317174cec JSC::Interpreter::executeCall 48 JavaScriptCore 0x3174ce898 JSC::boundThisNoArgsFunctionCall 49 JavaScriptCore 0x316a6d600 llint_function_for_construct_arity_checkTagGateAfter 50 JavaScriptCore 0x316a41b84 vmEntryToJavaScriptTrampoline 51 JavaScriptCore 0x317174cec JSC::Interpreter::executeCall 52 JavaScriptCore 0x3174ce898 JSC::boundThisNoArgsFunctionCall 53 JavaScriptCore 0x316a41d48 vmEntryToNative 54 JavaScriptCore 0x317174d14 JSC::Interpreter::executeCall 55 JavaScriptCore 0x31741eb70 JSC::profiledCall 56 JavaScriptCore 0x316b1de0c JSObjectCallAsFunction 57 Veri 0x20083bc6c facebook::react::JSIExecutor::defaultTimeoutInvoker 58 Veri 0x200844b80 facebook::react::JSIExecutor::defaultTimeoutInvoker 59 Veri 0x2008382f0 facebook::react::JSIExecutor::defaultTimeoutInvoker 60 Veri 0x200784058 facebook::react::JSIExecutor::defaultTimeoutInvoker 61 Veri 0x200790238 facebook::react::JSIExecutor::defaultTimeoutInvoker 62 Veri 0x20078ffec facebook::react::JSIExecutor::defaultTimeoutInvoker 63 CoreFoundation 0x300998930 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ 64 CoreFoundation 0x30099982c __CFRunLoopDoBlocks 65 CoreFoundation 0x3009317ec __CFRunLoopRun 66 CoreFoundation 0x3009453c4 CFRunLoopRunSpecific 67 Veri 0x2007791d4 facebook::react::JSIExecutor::defaultTimeoutInvoker 68 Foundation 0x3039e2958 __NSThread__start__ 69 libsystem_pthread.dylib 0x3e12d1a5c _pthread_start 70 libsystem_pthread.dylib 0x3e12d0f58 thread_start Thread 0 0 libsystem_kernel.dylib 0x36deeb564 mach_msg_trap 1 libsystem_kernel.dylib 0x36deebbf8 mach_msg 2 CoreFoundation 0x30092d694 __CFRunLoopServiceMachPort 3 CoreFoundation 0x300931988 __CFRunLoopRun 4 CoreFoundation 0x3009453c4 CFRunLoopRunSpecific 5 Foundation 0x303992d50 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] 6 Foundation 0x3039d46a4 -[NSRunLoop(NSRunLoop) runUntilDate:] 7 Veri 0x2008f1334 __cxa_throw 8 Veri 0x20066f4d8 9 UIKitCore 0x3055a3fe4 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] 10 UIKitCore 0x30578c548 -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] 11 UIKitCore 0x305774eb4 -[UIApplication _runWithMainScene:transitionContext:completion:] 12 UIKitCore 0x3055d1f8c -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] 13 UIKitCore 0x305429298 _UIScenePerformActionsWithLifecycleActionMask 14 UIKitCore 0x3055559b0 __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke 15 UIKitCore 0x3056764dc -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] 16 UIKitCore 0x3058b7ac8 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] 17 UIKitCore 0x3058431ec -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] 18 UIKitCore 0x30542a09c __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke 19 UIKitCore 0x3054ea684 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:actions:completion:] 20 UIKitCore 0x30542bfac _UISceneSettingsDiffActionPerformChangesWithTransitionContext 21 UIKitCore 0x3055171e4 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] 22 UIKitCore 0x30599fb08 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.610 23 UIKitCore 0x30545adb4 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] 24 UIKitCore 0x30549e4ec -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] 25 UIKitCore 0x3055d6e50 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] 26 UIKitCore 0x3055154a4 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] 27 FrontBoardServices 0x323edbe2c -[FBSScene _callOutQueue_agent_didCreateWithTransitionContext:completion:] 28 FrontBoardServices 0x323f01ce8 __94-[FBSWorkspaceScenesClient createWithSceneID:groupID:parameters:transitionContext:completion:]_block_invoke.215 29 FrontBoardServices 0x323ebc6c0 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] 30 FrontBoardServices 0x323ebdd00 __94-[FBSWorkspaceScenesClient createWithSceneID:groupID:parameters:transitionContext:completion:]_block_invoke 31 libdispatch.dylib 0x30033994c _dispatch_client_callout 32 libdispatch.dylib 0x30033d3e4 _dispatch_block_invoke_direct 33 FrontBoardServices 0x323ebdfa0 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ 34 FrontBoardServices 0x323ebd3e0 -[FBSSerialQueue _targetQueue_performNextIfPossible] 35 FrontBoardServices 0x323ec19f0 -[FBSSerialQueue _performNextFromRunLoopSource] 36 CoreFoundation 0x3009e102c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ 37 CoreFoundation 0x3009f1cec __CFRunLoopDoSource0 38 CoreFoundation 0x30092c060 __CFRunLoopDoSources0 39 CoreFoundation 0x300931800 __CFRunLoopRun 40 CoreFoundation 0x3009453c4 CFRunLoopRunSpecific 41 GraphicsServices 0x337985388 GSEventRunModal 42 UIKitCore 0x3057950b8 -[UIApplication _run] 43 UIKitCore 0x305512be4 UIApplicationMain 44 Veri 0x20066f894 45 0x10125da24 Thread 1 0 libsystem_kernel.dylib 0x36deebb8c __workq_kernreturn 1 libsystem_pthread.dylib 0x3e12d11f8 _pthread_wqthread Thread 2 0 libsystem_kernel.dylib 0x36deebb8c __workq_kernreturn 1 libsystem_pthread.dylib 0x3e12d11f8 _pthread_wqthread Thread 3 0 CoreFoundation 0x3009531c4 _CFStringGetCStringPtrInternal 1 CoreFoundation 0x30093dc54 CFStringFindWithOptionsAndLocale 2 CoreFoundation 0x300a10714 CFStringCreateArrayWithFindResults 3 CoreFoundation 0x3009cf858 CFStringCreateArrayBySeparatingStrings 4 CFNetwork 0x301af4d00 _CFNetworkErrorGetLocalizedDescription 5 CFNetwork 0x3019a1014 CFURLCacheRemoveAllCachedResponses 6 CFNetwork 0x301999b78 CFHTTPCookieStorageGetCookieAcceptPolicy 7 CFNetwork 0x301957bac CFURLRequestSetHTTPRequestBody 8 CFNetwork 0x301975b10 CFURLRequestSetMainDocumentURL 9 CFNetwork 0x30196bc58 CFURLRequestSetURL 10 libdispatch.dylib 0x300337c00 _dispatch_call_block_and_release 11 libdispatch.dylib 0x30033994c _dispatch_client_callout 12 libdispatch.dylib 0x3003410a8 _dispatch_lane_serial_drain 13 libdispatch.dylib 0x300341c40 _dispatch_lane_invoke 14 libdispatch.dylib 0x300342f1c _dispatch_workloop_invoke 15 libdispatch.dylib 0x30034c314 _dispatch_workloop_worker_thread 16 libsystem_pthread.dylib 0x3e12d11ac _pthread_wqthread Thread 4 name: com.apple.uikit.eventfetch-thread 0 libsystem_kernel.dylib 0x36deeb564 mach_msg_trap 1 libsystem_kernel.dylib 0x36deebbf8 mach_msg 2 CoreFoundation 0x30092d694 __CFRunLoopServiceMachPort 3 CoreFoundation 0x300931988 __CFRunLoopRun 4 CoreFoundation 0x3009453c4 CFRunLoopRunSpecific 5 Foundation 0x303992d50 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] 6 Foundation 0x3039d46a4 -[NSRunLoop(NSRunLoop) runUntilDate:] 7 UIKitCore 0x30570e078 -[UIEventFetcher threadMain] 8 Foundation 0x3039e2958 __NSThread__start__ 9 libsystem_pthread.dylib 0x3e12d1a5c _pthread_start Thread 5 0 libsystem_kernel.dylib 0x36deebb8c __workq_kernreturn 1 libsystem_pthread.dylib 0x3e12d11f8 _pthread_wqthread Thread 6 0 libsystem_kernel.dylib 0x36deebb8c __workq_kernreturn 1 libsystem_pthread.dylib 0x3e12d11f8 _pthread_wqthread Thread 7 name: com.facebook.react.JavaScript Crashed: 0 Veri 0x200ce32b0 __cxa_throw 1 Veri 0x200ce3d78 __cxa_throw 2 Veri 0x200ce45fc __cxa_throw 3 Veri 0x200919f6c __cxa_throw 4 Veri 0x200ba7e20 __cxa_throw 5 Veri 0x200919d9c __cxa_throw 6 Veri 0x200bdd710 __cxa_throw 7 Veri 0x200be0790 __cxa_throw 8 Veri 0x200be5834 __cxa_throw 9 Veri 0x2009d6460 __cxa_throw 10 Veri 0x2009d77a0 __cxa_throw 11 Veri 0x2009d75ec __cxa_throw 12 Veri 0x200a3ac10 __cxa_throw 13 Veri 0x20095d4f0 __cxa_throw 14 Veri 0x20095bd00 __cxa_throw 15 JavaScriptCore 0x316b0fd8c JSC::APICallbackFunction::callImpl 16 JavaScriptCore 0x316a6d6f8 llint_function_for_construct_arity_checkTagGateAfter 17 JavaScriptCore 0x316a6a698 llint_function_for_construct_arity_checkTagGateAfter 18 JavaScriptCore 0x316a6a760 llint_function_for_construct_arity_checkTagGateAfter 19 JavaScriptCore 0x316a6a698 llint_function_for_construct_arity_checkTagGateAfter 20 JavaScriptCore 0x316a6a760 llint_function_for_construct_arity_checkTagGateAfter 21 JavaScriptCore 0x316a6a698 llint_function_for_construct_arity_checkTagGateAfter 22 JavaScriptCore 0x316a6a760 [inlined] llint_function_for_construct_arity_checkTagGateAfter 23 JavaScriptCore 0x316a6a760 llint_function_for_construct_arity_checkTagGateAfter 24 JavaScriptCore 0x316a6b974 llint_function_for_construct_arity_checkTagGateAfter 25 JavaScriptCore 0x316a6a760 llint_function_for_construct_arity_checkTagGateAfter 26 JavaScriptCore 0x316a6a698 [inlined] llint_function_for_construct_arity_checkTagGateAfter 27 JavaScriptCore 0x316a6a698 llint_function_for_construct_arity_checkTagGateAfter 28 JavaScriptCore 0x316a6a760 [inlined] llint_function_for_construct_arity_checkTagGateAfter 29 JavaScriptCore 0x316a6a760 llint_function_for_construct_arity_checkTagGateAfter 30 JavaScriptCore 0x316a6a698 llint_function_for_construct_arity_checkTagGateAfter 31 JavaScriptCore 0x316a6a760 llint_function_for_construct_arity_checkTagGateAfter 32 JavaScriptCore 0x316a6a698 llint_function_for_construct_arity_checkTagGateAfter 33 JavaScriptCore 0x316a6a760 [inlined] llint_function_for_construct_arity_checkTagGateAfter 34 JavaScriptCore 0x316a6a760 [inlined] llint_function_for_construct_arity_checkTagGateAfter 35 JavaScriptCore 0x316a6a760 llint_function_for_construct_arity_checkTagGateAfter 36 JavaScriptCore 0x316a6a698 [inlined] llint_function_for_construct_arity_checkTagGateAfter 37 JavaScriptCore 0x316a6a698 llint_function_for_construct_arity_checkTagGateAfter 38 JavaScriptCore 0x316a6bfbc llint_function_for_construct_arity_checkTagGateAfter 39 JavaScriptCore 0x316a6a760 llint_function_for_construct_arity_checkTagGateAfter 40 JavaScriptCore 0x316a6a698 [inlined] llint_function_for_construct_arity_checkTagGateAfter 41 JavaScriptCore 0x316a6a698 [inlined] llint_function_for_construct_arity_checkTagGateAfter 42 JavaScriptCore 0x316a6a698 [inlined] llint_function_for_construct_arity_checkTagGateAfter 43 JavaScriptCore 0x316a6a698 llint_function_for_construct_arity_checkTagGateAfter 44 JavaScriptCore 0x316a6a760 llint_function_for_construct_arity_checkTagGateAfter 45 JavaScriptCore 0x316a6a698 llint_function_for_construct_arity_checkTagGateAfter 46 JavaScriptCore 0x316a41b84 vmEntryToJavaScriptTrampoline 47 JavaScriptCore 0x317174cec JSC::Interpreter::executeCall 48 JavaScriptCore 0x3174ce898 JSC::boundThisNoArgsFunctionCall 49 JavaScriptCore 0x316a6d600 llint_function_for_construct_arity_checkTagGateAfter 50 JavaScriptCore 0x316a41b84 vmEntryToJavaScriptTrampoline 51 JavaScriptCore 0x317174cec JSC::Interpreter::executeCall 52 JavaScriptCore 0x3174ce898 JSC::boundThisNoArgsFunctionCall 53 JavaScriptCore 0x316a41d48 vmEntryToNative 54 JavaScriptCore 0x317174d14 JSC::Interpreter::executeCall 55 JavaScriptCore 0x31741eb70 JSC::profiledCall 56 JavaScriptCore 0x316b1de0c JSObjectCallAsFunction 57 Veri 0x20083bc6c facebook::react::JSIExecutor::defaultTimeoutInvoker 58 Veri 0x200844b80 facebook::react::JSIExecutor::defaultTimeoutInvoker 59 Veri 0x2008382f0 facebook::react::JSIExecutor::defaultTimeoutInvoker 60 Veri 0x200784058 facebook::react::JSIExecutor::defaultTimeoutInvoker 61 Veri 0x200790238 facebook::react::JSIExecutor::defaultTimeoutInvoker 62 Veri 0x20078ffec facebook::react::JSIExecutor::defaultTimeoutInvoker 63 CoreFoundation 0x300998930 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ 64 CoreFoundation 0x30099982c __CFRunLoopDoBlocks 65 CoreFoundation 0x3009317ec __CFRunLoopRun 66 CoreFoundation 0x3009453c4 CFRunLoopRunSpecific 67 Veri 0x2007791d4 facebook::react::JSIExecutor::defaultTimeoutInvoker 68 Foundation 0x3039e2958 __NSThread__start__ 69 libsystem_pthread.dylib 0x3e12d1a5c _pthread_start 70 libsystem_pthread.dylib 0x3e12d0f58 thread_start Thread 8 name: JavaScriptCore bmalloc scavenger 0 libsystem_kernel.dylib 0x36deebff0 __psynch_cvwait 1 libsystem_pthread.dylib 0x3e12d8270 _pthread_cond_wait 2 libc++.1.dylib 0x3315b7e74 std::__1::condition_variable::__do_timed_wait 3 JavaScriptCore 0x317960100 bmalloc::Scavenger::threadRunLoop 4 JavaScriptCore 0x31795fb34 bmalloc::Scavenger::threadEntryPoint 5 JavaScriptCore 0x317960ff0 std::__1::__thread_proxy 6 libsystem_pthread.dylib 0x3e12d1a5c _pthread_start Thread 9 name: Heap Helper Thread 0 libsystem_kernel.dylib 0x36deebff0 __psynch_cvwait 1 libsystem_pthread.dylib 0x3e12d8270 _pthread_cond_wait 2 JavaScriptCore 0x3178e8c98 WTF::ParkingLot::parkConditionallyImpl 3 JavaScriptCore 0x31703b288 WTF::Condition::waitUntilUnchecked 4 JavaScriptCore 0x3178b3da4 WTF::Detail::CallableWrapper::call 5 JavaScriptCore 0x31790d238 WTF::Thread::entryPoint 6 JavaScriptCore 0x31790fb94 WTF::wtfThreadEntryPoint 7 libsystem_pthread.dylib 0x3e12d1a5c _pthread_start Thread 10 name: Heap Helper Thread 0 libsystem_kernel.dylib 0x36deebff0 __psynch_cvwait 1 libsystem_pthread.dylib 0x3e12d8270 _pthread_cond_wait 2 JavaScriptCore 0x3178e8c98 WTF::ParkingLot::parkConditionallyImpl 3 JavaScriptCore 0x31703b288 WTF::Condition::waitUntilUnchecked 4 JavaScriptCore 0x3178b3da4 WTF::Detail::CallableWrapper::call 5 JavaScriptCore 0x31790d238 WTF::Thread::entryPoint 6 JavaScriptCore 0x31790fb94 WTF::wtfThreadEntryPoint 7 libsystem_pthread.dylib 0x3e12d1a5c _pthread_start Thread 11 name: Heap Helper Thread 0 libsystem_kernel.dylib 0x36deebff0 __psynch_cvwait 1 libsystem_pthread.dylib 0x3e12d8270 _pthread_cond_wait 2 JavaScriptCore 0x3178e8c98 WTF::ParkingLot::parkConditionallyImpl 3 JavaScriptCore 0x31703b288 WTF::Condition::waitUntilUnchecked 4 JavaScriptCore 0x3178b3da4 WTF::Detail::CallableWrapper::call 5 JavaScriptCore 0x31790d238 WTF::Thread::entryPoint 6 JavaScriptCore 0x31790fb94 WTF::wtfThreadEntryPoint 7 libsystem_pthread.dylib 0x3e12d1a5c _pthread_start Thread 12 name: Heap Helper Thread 0 libsystem_kernel.dylib 0x36deebff0 __psynch_cvwait 1 libsystem_pthread.dylib 0x3e12d8270 _pthread_cond_wait 2 JavaScriptCore 0x3178e8c98 WTF::ParkingLot::parkConditionallyImpl 3 JavaScriptCore 0x31703b288 WTF::Condition::waitUntilUnchecked 4 JavaScriptCore 0x3178b3da4 WTF::Detail::CallableWrapper::call 5 JavaScriptCore 0x31790d238 WTF::Thread::entryPoint 6 JavaScriptCore 0x31790fb94 WTF::wtfThreadEntryPoint 7 libsystem_pthread.dylib 0x3e12d1a5c _pthread_start Thread 13 name: Heap Helper Thread 0 libsystem_kernel.dylib 0x36deebff0 __psynch_cvwait 1 libsystem_pthread.dylib 0x3e12d8270 _pthread_cond_wait 2 JavaScriptCore 0x3178e8c98 WTF::ParkingLot::parkConditionallyImpl 3 JavaScriptCore 0x31703b288 WTF::Condition::waitUntilUnchecked 4 JavaScriptCore 0x3178b3da4 WTF::Detail::CallableWrapper::call 5 JavaScriptCore 0x31790d238 WTF::Thread::entryPoint 6 JavaScriptCore 0x31790fb94 WTF::wtfThreadEntryPoint 7 libsystem_pthread.dylib 0x3e12d1a5c _pthread_start Thread 14 name: AVAudioSession Notify Thread 0 libsystem_kernel.dylib 0x36deeb564 mach_msg_trap 1 libsystem_kernel.dylib 0x36deebbf8 mach_msg 2 CoreFoundation 0x30092d694 __CFRunLoopServiceMachPort 3 CoreFoundation 0x300931988 __CFRunLoopRun 4 CoreFoundation 0x3009453c4 CFRunLoopRunSpecific 5 AudioSession 0x31302c304 CADeprecated::GenericRunLoopThread::Entry 6 AudioSession 0x313035d60 CADeprecated::CAPThread::Entry 7 libsystem_pthread.dylib 0x3e12d1a5c _pthread_start Thread 15 0 libsystem_kernel.dylib 0x36deebb44 __semwait_signal 1 libsystem_c.dylib 0x316614ef8 nanosleep 2 libsystem_c.dylib 0x316628f4c sleep 3 Veri 0x20087082c facebook::react::JSIExecutor::defaultTimeoutInvoker 4 libsystem_pthread.dylib 0x3e12d1a5c _pthread_start Thread 16 0 libsystem_kernel.dylib 0x36deeb564 mach_msg_trap 1 libsystem_kernel.dylib 0x36deebbf8 mach_msg 2 libsystem_kernel.dylib 0x36def728c thread_suspend 3 Veri 0x20087d0b4 __cxa_throw 4 libsystem_pthread.dylib 0x3e12d1a5c _pthread_start Thread 17 0 libsystem_kernel.dylib 0x36deeb564 mach_msg_trap 1 libsystem_kernel.dylib 0x36deebbf8 mach_msg 2 Veri 0x20087d0e0 __cxa_throw 3 libsystem_pthread.dylib 0x3e12d1a5c _pthread_start Thread 18 0 libsystem_kernel.dylib 0x36deeb564 mach_msg_trap 1 libsystem_kernel.dylib 0x36deebbf8 mach_msg 2 CoreFoundation 0x30092d694 __CFRunLoopServiceMachPort 3 CoreFoundation 0x300931988 __CFRunLoopRun 4 CoreFoundation 0x3009453c4 CFRunLoopRunSpecific 5 Foundation 0x303992d50 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] 6 Veri 0x2007b462c facebook::react::JSIExecutor::defaultTimeoutInvoker 7 Foundation 0x3039e2958 __NSThread__start__ 8 libsystem_pthread.dylib 0x3e12d1a5c _pthread_start Thread 19 0 libsystem_kernel.dylib 0x36deeb564 mach_msg_trap 1 libsystem_kernel.dylib 0x36deebbf8 mach_msg 2 CoreFoundation 0x30092d694 __CFRunLoopServiceMachPort 3 CoreFoundation 0x300931988 __CFRunLoopRun 4 CoreFoundation 0x3009453c4 CFRunLoopRunSpecific 5 CFNetwork 0x301bcc8cc _CFURLStorageSessionCopyIdentifier 6 Foundation 0x3039e2958 __NSThread__start__ 7 libsystem_pthread.dylib 0x3e12d1a5c _pthread_start Thread 20 0 libsystem_kernel.dylib 0x36deecedc kevent 1 Veri 0x2009b708c __cxa_throw 2 Veri 0x2009b71dc __cxa_throw 3 libsystem_pthread.dylib 0x3e12d1a5c _pthread_start EOF ```

I will write mode detailed issue with all info once I have time :)

stefoid commented 2 years ago

Sorry for late reply, I am on the road at the moment.

1) I have changed to unencrypted DB to protect the users in the short term, and the crashes have 100% disappeared. 2) crashes were spread equally across iOS and Android 3) weirdly, once a user has been affected, it seems to persist even if the app is reinstalled - I cant account for this, Im just reporting it.

fronck commented 2 years ago
3. weirdly, once a user has been affected, it seems to persist even if the app is reinstalled - I cant account for this, Im just reporting it.

Does the reinstallation include putting in a fresh copy of the database?

stefoid commented 2 years ago

Now that I think about it, I should check with support as to whether they were asking people to delete the app before reinstalling, or not. If not, it would make more sense as it would not be reinstalling the DB.

stefoid commented 2 years ago

WRT manually closing the app or OS closing it, I dont know. I have never managed to duplicate the issue myself by manually closing it, or opening apps to try to force the OS to shutdown the app due to resources. None of the reports I got could nail it down either.

What do you think might be a reason for this bug to suddenly increase in frequency with our last release - the specific release we made was so minor and did not involve the DB in any way (minor UI tweaks), plus the version of realm we (still) use is ^10.8.0 .. pretty old, even taking any minor version updates into account.

Frans-L commented 2 years ago

@stefoid ^10.8.0 means that NPM / YARN may install minor updates, e.g. 10.12.0 version.

Would you like to share the version number that you have in package.lock or yarn.lock.

I would guess that Realm-Core version 11.7.0 or 11.8.0 has introduced this bug. It seems like the same kind of crashing happens also in the Swift version after the Realm-Core version was increased to 11.8.0 from 11.6.1

So, I would guess that corruption may happen if the Realm-JS version is higher than 10.10.1. (Realm-JS 10.10.1 uses the core version 11.6.1.)

takameyer commented 2 years ago

I tried to reproduce this in a react native repo. The script runApp.sh will continually run and reopen the app at random intervals. The app itself will start making writes to realm as soon as it is opened. Unfortunately, this did not reproduce the issue. It is also using an encrypted Realm.

takameyer commented 2 years ago

@finnschiermer has made some progress on a possibly related issue.

stevenmathers commented 2 years ago

@stefoid ^10.8.0 means that NPM / YARN may install minor updates, e.g. 10.12.0 version.

Would you like to share the version number that you have in package.lock or yarn.lock.

I would guess that Realm-Core version 11.7.0 or 11.8.0 has introduced this bug. It seems like the same kind of crashing happens also in the Swift version after the Realm-Core version was increased to 11.8.0 from 11.6.1

So, I would guess that corruption may happen if the Realm-JS version is higher than 10.10.1. (Realm-JS 10.10.1 uses the core version 11.6.1.)

problematic release : (20th feb)

realm@10.13.0

previous no issues release: (1st feb)

realm@10.11.0

not the one you were expecting, but at least it makes sense that something changed

Frans-L commented 2 years ago

So, it sounds like the issue has appeared with Realm-Core v11.8.0. (Realm-JS v10.11.0 uses Realm-Core v11.7.0. Realm-JS v.10.12.0 uses Realm-Core v11.8.0. I have witnessed the corruption with the Realm-JS v10.12.0 version.)

Throwing wild guesses: By looking at the stack trace, the Realm notification listener thread crashes. So, probably the Realm Core v11.8.0 changed something related to notification and introduced the bug?

At least, these PRs did modify the logic a bit and were merged into v11.8.0 according to the changelog:

sync-by-unito[bot] commented 2 years ago

➤ Finn Andersen commented:

Fixed by realm-core 11.14

cristianoccazinsp commented 2 years ago

Just saw the same crash with unencrypted realms (https://github.com/realm/realm-js/issues/4533) using 10.20.0-beta.4.

sync-by-unito[bot] commented 2 years ago

➤ Finn Andersen commented:

Right - a corrupt file may still trigger this crash. The fix we did in core 11.14 was for one specific cause of corruption related to use of encryption (the initial report for this issue indicated encryption was in use).