realm / realm-swift

Realm is a mobile database: a replacement for Core Data & SQLite
https://realm.io
Apache License 2.0
16.27k stars 2.14k forks source link

App occasionally crashes in production on `RLMAddObjectToRealm` (adding a new object to the database). #7626

Closed tijme closed 2 years ago

tijme commented 2 years ago

How frequently does the bug occur?

Sometimes

Description

I maintain an open-source app that allows users to manage one-time passwords. Users are able to add one-time passwords by filling in a form or scanning a QR-code, after which the data is saved to an encrypted Realm database. This usually (99% of the times) works. However, in TestFlight and production, various users are submitting crash reports.

I attached a second stack trace in which the same bug occurs (but in a different user story). The second stack trace occurs when a user starts the app, and the app syncs the data in iCloud to the device by saving it in the Realm database.

Unfortunately (as far as I can see) there's no clear error message in the stack traces.

Stacktrace 1

Hardware Model:      iPhone12,8
Process:             Raivo [30062]
Path:                /private/var/containers/Bundle/Application/89C453F0-773E-416B-9F84-B4EA24836E53/Raivo.app/Raivo
Identifier:          com.finnwea.Raivo
Version:             1.3.0 (53)
AppStoreTools:       12E506
AppVariant:          1:iPhone12,8:14
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           com.finnwea.Raivo [5185]

Date/Time:           2021-12-01 13:28:11.7167 +0800
Launch Time:         2021-12-01 13:27:19.0151 +0800
OS Version:          iPhone OS 15.1 (19B74)
Release Type:        User
Baseband Version:    3.00.00
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0

Last Exception Backtrace:
0   CoreFoundation                  0x182ef404c __exceptionPreprocess + 220 (NSException.m:200)
1   libobjc.A.dylib                 0x19b568f54 objc_exception_throw + 60 (objc-exception.mm:565)
2   Raivo                           0x10017df9c RLMAddObjectToRealm + 652 (RLMObjectStore.mm:155)
3   Raivo                           0x10005a474 thunk for @callee_guaranteed () -> (@error @owned Error) + 20 (<compiler-generated>:0)
4   Raivo                           0x100099fc8 partial apply for thunk for @callee_guaranteed () -> (@error @owned Error) + 16 (<compiler-generated>:0)
5   Raivo                           0x10009a220 thunk for @callee_guaranteed () -> (@error @owned Error)partial apply + 12
6   Raivo                           0x10039ab78 Realm.write<A>(withoutNotifying:_:) + 180 (Realm.swift:227)
7   Raivo                           0x10009921c closure #1 in MainCreatePasswordViewController.onSave(_:) + 268 (MainCreatePasswordViewController.swift:66)
8   Raivo                           0x10005a474 thunk for @callee_guaranteed () -> (@error @owned Error) + 20 (<compiler-generated>:0)
9   Raivo                           0x100099fc8 partial apply for thunk for @callee_guaranteed () -> (@error @owned Error) + 16 (<compiler-generated>:0)
10  libswiftObjectiveC.dylib        0x1b0b63a20 autoreleasepool<A>(invoking:) + 64 (ObjectiveC.swift:172)
11  Raivo                           0x100098ef4 MainCreatePasswordViewController.onSave(_:) + 200 (MainCreatePasswordViewController.swift:64)
12  Raivo                           0x1000992e0 @objc MainCreatePasswordViewController.onSave(_:) + 56 (<compiler-generated>:0)
13  UIKitCore                       0x1857c9bf0 -[UIApplication sendAction:to:from:forEvent:] + 100 (UIApplication.m:5360)
14  UIKitCore                       0x185aa8b80 -[UIBarButtonItem _triggerActionForEvent:] + 180 (UIBarButtonItem.m:774)
15  UIKitCore                       0x185a92880 __45-[_UIButtonBarTargetAction _invoke:forEvent:]_block_invoke + 40 (UIButtonBar.m:1220)
16  UIKitCore                       0x185a92730 -[_UIButtonBarTargetAction _invoke:forEvent:] + 204 (UIButtonBar.m:1226)
17  UIKitCore                       0x1857c9bf0 -[UIApplication sendAction:to:from:forEvent:] + 100 (UIApplication.m:5360)
18  UIKitCore                       0x1858f5a4c -[UIControl sendAction:to:forEvent:] + 128 (UIControl.m:871)
19  UIKitCore                       0x1856712c8 -[UIControl _sendActionsForEvents:withEvent:] + 352 (UIControl.m:942)
20  UIKitCore                       0x185671318 -[UIControl _sendActionsForEvents:withEvent:] + 432 (UIControl.m:950)
21  UIKitCore                       0x1859a07c0 -[UIControl touchesEnded:withEvent:] + 536 (UIControl.m:637)
22  UIKitCore                       0x18547407c -[UIWindow _sendTouchesForEvent:] + 980 (UIWindow.m:2974)
23  UIKitCore                       0x1854a5a84 -[UIWindow sendEvent:] + 4456 (UIWindow.m:3274)
24  UIKitCore                       0x185655318 -[UIApplication sendEvent:] + 828 (UIApplication.m:11864)
25  Raivo                           0x100077348 ApplicationPrincipal.sendEvent(_:) + 48 (ApplicationPrincipal.swift:39)
26  Raivo                           0x1000773c8 @objc ApplicationPrincipal.sendEvent(_:) + 48 (<compiler-generated>:0)
27  UIKitCore                       0x185478c30 __dispatchPreprocessedEventFromEventQueue + 7904 (UIEventDispatcher.m:2290)
28  UIKitCore                       0x18546da1c __processEventQueue + 6760 (UIEventDispatcher.m:2597)
29  UIKitCore                       0x185472ec8 __eventFetcherSourceCallback + 172 (UIEventDispatcher.m:2669)
30  CoreFoundation                  0x182f16020 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 (CFRunLoop.c:1972)
31  CoreFoundation                  0x182f26ce0 __CFRunLoopDoSource0 + 208 (CFRunLoop.c:2016)
32  CoreFoundation                  0x182e60fe8 __CFRunLoopDoSources0 + 268 (CFRunLoop.c:2053)
33  CoreFoundation                  0x182e667f4 __CFRunLoopRun + 820 (CFRunLoop.c:2951)
34  CoreFoundation                  0x182e7a3b8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
35  GraphicsServices                0x19e80a38c GSEventRunModal + 164 (GSEvent.c:2200)
36  UIKitCore                       0x18581a6a8 -[UIApplication _run] + 1100 (UIApplication.m:3493)
37  UIKitCore                       0x1855997f4 UIApplicationMain + 2092 (UIApplication.m:5046)
38  Raivo                           0x100031e8c main + 176 (main.swift:19)
39  dyld                            0x1008c5a24 start + 520 (dyldMain.cpp:876)

Kernel Triage:
VM - pmap_enter failed with resource shortage

Thread 0 name:
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x00000001b9dc6964 __pthread_kill + 8
1   libsystem_pthread.dylib         0x00000001f320c378 pthread_kill + 268 (pthread.c:1610)
2   libsystem_c.dylib               0x000000018dd31f50 abort + 164 (abort.c:118)
3   libc++abi.dylib                 0x000000019b670bc4 abort_message + 132 (abort_message.cpp:78)
4   libc++abi.dylib                 0x000000019b661fd8 demangling_terminate_handler() + 332 (cxa_default_handlers.cpp:71)
5   libobjc.A.dylib                 0x000000019b56f064 _objc_terminate() + 144 (objc-exception.mm:701)
6   libc++abi.dylib                 0x000000019b66ff58 std::__terminate(void (*)()) + 20 (cxa_handlers.cpp:59)
7   libc++abi.dylib                 0x000000019b672efc __cxa_rethrow + 148 (cxa_exception.cpp:616)
8   libobjc.A.dylib                 0x000000019b56ae8c objc_exception_rethrow + 44 (objc-exception.mm:604)
9   CoreFoundation                  0x0000000182e7a4a4 CFRunLoopRunSpecific + 836 (CFRunLoop.c:3283)
10  GraphicsServices                0x000000019e80a38c GSEventRunModal + 164 (GSEvent.c:2200)
11  UIKitCore                       0x000000018581a6a8 -[UIApplication _run] + 1100 (UIApplication.m:3493)
12  UIKitCore                       0x00000001855997f4 UIApplicationMain + 2092 (UIApplication.m:5046)
13  Raivo                           0x0000000100031e8c main + 176 (main.swift:19)
14  dyld                            0x00000001008c5a24 start + 520 (dyldMain.cpp:876)

Thread 1:
0   libsystem_pthread.dylib         0x00000001f3205e8c start_wqthread + 0

Thread 2 name:
Thread 2:
0   libsystem_kernel.dylib          0x00000001b9dc0504 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x00000001b9dc0b9c mach_msg + 76 (mach_msg.c:119)
2   CoreFoundation                  0x0000000182e62688 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646)
3   CoreFoundation                  0x0000000182e6697c __CFRunLoopRun + 1212 (CFRunLoop.c:3000)
4   CoreFoundation                  0x0000000182e7a3b8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
5   Foundation                      0x0000000184695354 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 236 (NSRunLoop.m:373)
6   Foundation                      0x00000001846d6c28 -[NSRunLoop(NSRunLoop) runUntilDate:] + 92 (NSRunLoop.m:420)
7   UIKitCore                       0x00000001857938a4 -[UIEventFetcher threadMain] + 524 (UIEventFetcher.m:1167)
8   Foundation                      0x00000001846e536c __NSThread__start__ + 808 (NSThread.m:972)
9   libsystem_pthread.dylib         0x00000001f32069a4 _pthread_start + 148 (pthread.c:891)
10  libsystem_pthread.dylib         0x00000001f3205ea0 thread_start + 8

Thread 3:
0   libsystem_pthread.dylib         0x00000001f3205e8c start_wqthread + 0

Thread 4:
0   libsystem_pthread.dylib         0x00000001f3205e8c start_wqthread + 0

Thread 5 name:
Thread 5:
0   libsystem_kernel.dylib          0x00000001b9dc1e7c kevent + 8
1   Raivo                           0x0000000100107ea8 realm::_impl::ExternalCommitHelper::listen() + 160 (external_commit_helper.cpp:216)
2   Raivo                           0x0000000100108a0c operator() + 4 (external_commit_helper.cpp:173)
3   Raivo                           0x0000000100108a0c __invoke<(lambda at /Users/tijme/Library/Developer/Xcode/DerivedData/Raivo-gysxtggxckhosgdqjnvxkebwzibt/SourcePackages/checkouts/realm-cocoa/Realm/ObjectStore/src/impl/apple/external_commit_helper.... + 4 (type_traits:3747)
4   Raivo                           0x0000000100108a0c __thread_execute<std::__1::unique_ptr<std::__1::__thread_struct>, (lambda at /Users/tijme/Library/Developer/Xcode/DerivedData/Raivo-gysxtggxckhosgdqjnvxkebwzibt/SourcePackages/checkouts/realm-cocoa... + 4 (thread:280)
5   Raivo                           0x0000000100108a0c void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, realm::_impl::ExternalCommitHelper::ExternalCom... + 52 (thread:291)
6   libsystem_pthread.dylib         0x00000001f32069a4 _pthread_start + 148 (pthread.c:891)
7   libsystem_pthread.dylib         0x00000001f3205ea0 thread_start + 8

Thread 6:
0   libsystem_pthread.dylib         0x00000001f3205e8c start_wqthread + 0

Thread 7 name:
Thread 7:
0   libsystem_kernel.dylib          0x00000001b9dc0504 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x00000001b9dc0b9c mach_msg + 76 (mach_msg.c:119)
2   CoreFoundation                  0x0000000182e62688 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646)
3   CoreFoundation                  0x0000000182e6697c __CFRunLoopRun + 1212 (CFRunLoop.c:3000)
4   CoreFoundation                  0x0000000182e7a3b8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
5   AudioSession                    0x000000018c20e308 CADeprecated::GenericRunLoopThread::Entry(void*) + 164 (GenericRunLoopThread.h:95)
6   AudioSession                    0x000000018c217d64 CADeprecated::CAPThread::Entry(CADeprecated::CAPThread*) + 92 (CAPThread.cpp:324)
7   libsystem_pthread.dylib         0x00000001f32069a4 _pthread_start + 148 (pthread.c:891)
8   libsystem_pthread.dylib         0x00000001f3205ea0 thread_start + 8

Thread 8:
0   libsystem_pthread.dylib         0x00000001f3205e8c start_wqthread + 0

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0x0000000000000000   x2: 0x0000000000000000   x3: 0x0000000000000000
    x4: 0x000000019b6740ad   x5: 0x000000016fdd3230   x6: 0x000000000000006e   x7: 0xffffffff00000600
    x8: 0x05326e5c65d08932   x9: 0x05326e5d65418cb2  x10: 0x0000000000000002  x11: 0x000000000000000b
   x12: 0x000000008c427841  x13: 0x000000000c427800  x14: 0x0000000000000010  x15: 0x0000000000000002
   x16: 0x0000000000000148  x17: 0x0000000100910580  x18: 0x000000010bb945cc  x19: 0x0000000000000006
   x20: 0x0000000000000103  x21: 0x0000000100910660  x22: 0x0000000000000001  x23: 0x0000000280bc40e0
   x24: 0x0000000000000000  x25: 0x0000000000000001  x26: 0x0000000eb1e31100  x27: 0x00000001dc5aa000
   x28: 0x0000000000000001   fp: 0x000000016fdd31a0   lr: 0x00000001f320c378
    sp: 0x000000016fdd3180   pc: 0x00000001b9dc6964 cpsr: 0x40000000
   esr: 0x56000080  Address size fault

Binary Images:
0x10002c000 - 0x100613fff Raivo arm64  <add50fab936d32cf8bcd887d34d4275b> /private/var/containers/Bundle/Application/89C453F0-773E-416B-9F84-B4EA24836E53/Raivo.app/Raivo
0x1008ac000 - 0x100903fff dyld arm64e  <c21dba379df93fc7b286734030e18bb1> /usr/lib/dyld
0x182e5b000 - 0x1832aefff CoreFoundation arm64e  <b2d21cfd378c36d5baf73f70599cfefc> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
0x18467d000 - 0x184982fff Foundation arm64e  <d59c69755af237bc93be43b80b4293a5> /System/Library/Frameworks/Foundation.framework/Foundation
0x185301000 - 0x186b85fff UIKitCore arm64e  <8388eb03002b3b35a78a6a022894292e> /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore
0x18c208000 - 0x18c231fff AudioSession arm64e  <99ff741f34943edf82b7c03c916ebad3> /System/Library/PrivateFrameworks/AudioSession.framework/AudioSession
0x18dd12000 - 0x18dd90fff libsystem_c.dylib arm64e  <30a1668a329d30009f747b42b21fe0fd> /usr/lib/system/libsystem_c.dylib
0x19b553000 - 0x19b58cfff libobjc.A.dylib arm64e  <10fa90c6dfe538aeb3dc2251181cc272> /usr/lib/libobjc.A.dylib
0x19b65d000 - 0x19b676fff libc++abi.dylib arm64e  <375cf7503f9339e8a6eb1c0d7181c64e> /usr/lib/libc++abi.dylib
0x19e809000 - 0x19e811fff GraphicsServices arm64e  <44e4515eb18737f18fe028e7b087daf5> /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
0x1b0b62000 - 0x1b0b64fff libswiftObjectiveC.dylib arm64e  <d5abd17557ed37e58cf1e71e3149d46b> /usr/lib/swift/libswiftObjectiveC.dylib
0x1b9dbf000 - 0x1b9df2fff libsystem_kernel.dylib arm64e  <b1b942de75903c61980a19d80ed4da37> /usr/lib/system/libsystem_kernel.dylib
0x1f3205000 - 0x1f3210fff libsystem_pthread.dylib arm64e  <1a4a45fd1bb639df84140590ce103717> /usr/lib/system/libsystem_pthread.dylib

EOF

Stacktrace 2

Hardware Model:      iPad8,1
Process:             Raivo [1170]
Path:                /private/var/containers/Bundle/Application/711C4DC7-AF0C-4B6B-88EA-A68FA99F16B4/Raivo.app/Raivo
Identifier:          com.finnwea.Raivo
Version:             1.3.0 (53)
AppStoreTools:       12E506
AppVariant:          1:iPad8,1:14
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           com.finnwea.Raivo [768]

Date/Time:           2021-12-17 22:02:53.8951 -0500
Launch Time:         2021-12-17 22:02:49.2631 -0500
OS Version:          iPhone OS 15.2 (19C56)
Release Type:        User
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  1

Last Exception Backtrace:
0   CoreFoundation                  0x182bca0fc __exceptionPreprocess + 220 (NSException.m:200)
1   libobjc.A.dylib                 0x19b405d64 objc_exception_throw + 60 (objc-exception.mm:565)
2   Raivo                           0x1021c9f9c RLMAddObjectToRealm + 652 (RLMObjectStore.mm:155)
3   Raivo                           0x1020a6474 thunk for @callee_guaranteed () -> (@error @owned Error) + 20 (<compiler-generated>:0)
4   Raivo                           0x1020842c0 partial apply for thunk for @callee_guaranteed () -> (@error @owned Error) + 16 (<compiler-generated>:0)
5   Raivo                           0x102084598 thunk for @callee_guaranteed () -> (@error @owned Error)partial apply + 12
6   Raivo                           0x1023e6b78 Realm.write<A>(withoutNotifying:_:) + 180 (Realm.swift:227)
7   Raivo                           0x102082fbc closure #1 in closure #1 in CloudKitPasswordSyncer.resyncAll(_:) + 1176 (CloudKitPasswordSyncer.swift:87)
8   Raivo                           0x1020a6474 thunk for @callee_guaranteed () -> (@error @owned Error) + 20 (<compiler-generated>:0)
9   Raivo                           0x1020842c0 partial apply for thunk for @callee_guaranteed () -> (@error @owned Error) + 16 (<compiler-generated>:0)
10  Raivo                           0x102084584 thunk for @callee_guaranteed () -> (@error @owned Error)partial apply + 12
11  libswiftObjectiveC.dylib        0x1b0298a20 autoreleasepool<A>(invoking:) + 64 (ObjectiveC.swift:172)
12  Raivo                           0x10208294c closure #1 in CloudKitPasswordSyncer.resyncAll(_:) + 436 (CloudKitPasswordSyncer.swift:69)
13  Raivo                           0x10209a03c thunk for @escaping @callee_guaranteed (@guaranteed [CKRecord]?, @guaranteed Error?) -> () + 100 (<compiler-generated>:0)
14  CloudKit                        0x18a091b84 -[CKQueryOperation _finishOnCallbackQueueWithError:] + 584 (CKQueryOperation.m:155)
15  CloudKit                        0x189fc3a84 -[CKOperation _finishInternalOnCallbackQueueWithError:] + 616 (CKOperation.m:1209)
16  CloudKit                        0x189fb0e08 -[CKOperation handleOperationDidCompleteWithMetrics:error:] + 228 (CKOperation.m:1178)
17  CloudKit                        0x18a091854 -[CKQueryOperation handleOperationDidCompleteWithCursor:metrics:error:] + 220 (CKQueryOperation.m:139)
18  CoreFoundation                  0x182b533a4 __invoking___ + 148
19  CoreFoundation                  0x182b70b74 -[NSInvocation invoke] + 468 (NSForwarding.m:3378)
20  CoreFoundation                  0x182ba79d4 -[NSInvocation invokeWithTarget:] + 80 (NSForwarding.m:3475)
21  CloudKit                        0x18a006428 __46-[CKOperationCallbackProxy forwardInvocation:]_block_invoke.40 + 276 (CKOperationCallbackProxy.m:71)
22  libdispatch.dylib               0x18284b454 _dispatch_block_async_invoke2 + 148 (queue.c:548)
23  libdispatch.dylib               0x18283c670 _dispatch_client_callout + 20 (object.m:560)
24  libdispatch.dylib               0x182843df4 _dispatch_lane_serial_drain + 672 (inline_internal.h:2601)
25  libdispatch.dylib               0x18284499c _dispatch_lane_invoke + 444 (queue.c:3937)
26  libdispatch.dylib               0x18284f1b8 _dispatch_workloop_worker_thread + 656 (queue.c:6727)
27  libsystem_pthread.dylib         0x1f2c4f0f4 _pthread_wqthread + 288 (pthread.c:2599)
28  libsystem_pthread.dylib         0x1f2c4ee94 start_wqthread + 8

Thread 0 name:
Thread 0:
0   libsystem_kernel.dylib          0x00000001b95cf504 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x00000001b95cfb9c mach_msg + 76 (mach_msg.c:119)
2   CoreFoundation                  0x0000000182b38738 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646)
3   CoreFoundation                  0x0000000182b3ca2c __CFRunLoopRun + 1212 (CFRunLoop.c:3000)
4   CoreFoundation                  0x0000000182b50468 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
5   GraphicsServices                0x000000019e6dc38c GSEventRunModal + 164 (GSEvent.c:2200)
6   UIKitCore                       0x00000001854f2088 -[UIApplication _run] + 1100 (UIApplication.m:3493)
7   UIKitCore                       0x0000000185270958 UIApplicationMain + 2092 (UIApplication.m:5046)
8   Raivo                           0x000000010207de8c main + 176 (main.swift:19)
9   dyld                            0x00000001029ddaa4 start + 520 (dyldMain.cpp:879)

Thread 1 name:
Thread 1 Crashed:
0   libsystem_kernel.dylib          0x00000001b95d5964 __pthread_kill + 8
1   libsystem_pthread.dylib         0x00000001f2c55378 pthread_kill + 268 (pthread.c:1668)
2   libsystem_c.dylib               0x000000018da8df50 abort + 164 (abort.c:118)
3   libc++abi.dylib                 0x000000019b50dbc4 abort_message + 132 (abort_message.cpp:78)
4   libc++abi.dylib                 0x000000019b4fefd8 demangling_terminate_handler() + 332 (cxa_default_handlers.cpp:71)
5   libobjc.A.dylib                 0x000000019b40be34 _objc_terminate() + 144 (objc-exception.mm:701)
6   libc++abi.dylib                 0x000000019b50cf58 std::__terminate(void (*)()) + 20 (cxa_handlers.cpp:59)
7   libc++abi.dylib                 0x000000019b50cef4 std::terminate() + 64 (cxa_handlers.cpp:88)
8   libdispatch.dylib               0x000000018283c684 _dispatch_client_callout + 40 (object.m:563)
9   libdispatch.dylib               0x0000000182843df4 _dispatch_lane_serial_drain + 672 (inline_internal.h:2601)
10  libdispatch.dylib               0x000000018284499c _dispatch_lane_invoke + 444 (queue.c:3937)
11  libdispatch.dylib               0x000000018284f1b8 _dispatch_workloop_worker_thread + 656 (queue.c:6727)
12  libsystem_pthread.dylib         0x00000001f2c4f0f4 _pthread_wqthread + 288 (pthread.c:2599)
13  libsystem_pthread.dylib         0x00000001f2c4ee94 start_wqthread + 8

Thread 2:
0   libsystem_pthread.dylib         0x00000001f2c4ee8c start_wqthread + 0

Thread 3:
0   libsystem_pthread.dylib         0x00000001f2c4ee8c start_wqthread + 0

Thread 4:
0   libsystem_pthread.dylib         0x00000001f2c4ee8c start_wqthread + 0

Thread 5:
0   libsystem_pthread.dylib         0x00000001f2c4ee8c start_wqthread + 0

Thread 6 name:
Thread 6:
0   libsystem_kernel.dylib          0x00000001b95cf504 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x00000001b95cfb9c mach_msg + 76 (mach_msg.c:119)
2   CoreFoundation                  0x0000000182b38738 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646)
3   CoreFoundation                  0x0000000182b3ca2c __CFRunLoopRun + 1212 (CFRunLoop.c:3000)
4   CoreFoundation                  0x0000000182b50468 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
5   Foundation                      0x000000018436cc94 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 236 (NSRunLoop.m:373)
6   Foundation                      0x00000001843addc8 -[NSRunLoop(NSRunLoop) runUntilDate:] + 92 (NSRunLoop.m:420)
7   UIKitCore                       0x000000018546b230 -[UIEventFetcher threadMain] + 524 (UIEventFetcher.m:1167)
8   Foundation                      0x00000001843bc40c __NSThread__start__ + 808 (NSThread.m:972)
9   libsystem_pthread.dylib         0x00000001f2c4f9a4 _pthread_start + 148 (pthread.c:891)
10  libsystem_pthread.dylib         0x00000001f2c4eea0 thread_start + 8

Thread 7:
0   libsystem_pthread.dylib         0x00000001f2c4ee8c start_wqthread + 0

Thread 8 name:
Thread 8:
0   libsystem_kernel.dylib          0x00000001b95d0e7c kevent + 8
1   Raivo                           0x0000000102153ea8 realm::_impl::ExternalCommitHelper::listen() + 160 (external_commit_helper.cpp:216)
2   Raivo                           0x0000000102154a0c operator() + 4 (external_commit_helper.cpp:173)
3   Raivo                           0x0000000102154a0c __invoke<(lambda at /Users/tijme/Library/Developer/Xcode/DerivedData/Raivo-gysxtggxckhosgdqjnvxkebwzibt/SourcePackages/checkouts/realm-cocoa/Realm/ObjectStore/src/impl/apple/external_commit_helper.... + 4 (type_traits:3747)
4   Raivo                           0x0000000102154a0c __thread_execute<std::__1::unique_ptr<std::__1::__thread_struct>, (lambda at /Users/tijme/Library/Developer/Xcode/DerivedData/Raivo-gysxtggxckhosgdqjnvxkebwzibt/SourcePackages/checkouts/realm-cocoa... + 4 (thread:280)
5   Raivo                           0x0000000102154a0c void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, realm::_impl::ExternalCommitHelper::ExternalCom... + 52 (thread:291)
6   libsystem_pthread.dylib         0x00000001f2c4f9a4 _pthread_start + 148 (pthread.c:891)
7   libsystem_pthread.dylib         0x00000001f2c4eea0 thread_start + 8

Thread 9:
0   libsystem_pthread.dylib         0x00000001f2c4ee8c start_wqthread + 0

Thread 10:
0   libsystem_pthread.dylib         0x00000001f2c4ee8c start_wqthread + 0

Thread 11:
0   libsystem_pthread.dylib         0x00000001f2c4ee8c start_wqthread + 0

Thread 12:
0   libsystem_pthread.dylib         0x00000001f2c4ee8c start_wqthread + 0

Thread 13:
0   libsystem_pthread.dylib         0x00000001f2c4ee8c start_wqthread + 0

Thread 14:
0   libsystem_pthread.dylib         0x00000001f2c4ee8c start_wqthread + 0

Thread 15:
0   libsystem_pthread.dylib         0x00000001f2c4ee8c start_wqthread + 0

Thread 16:
0   libsystem_pthread.dylib         0x00000001f2c4ee8c start_wqthread + 0

Thread 17:
0   libsystem_pthread.dylib         0x00000001f2c4ee8c start_wqthread + 0

Thread 18:
0   libsystem_pthread.dylib         0x00000001f2c4ee8c start_wqthread + 0

Thread 19:
0   libsystem_pthread.dylib         0x00000001f2c4ee8c start_wqthread + 0

Thread 20:
0   libsystem_pthread.dylib         0x00000001f2c4ee8c start_wqthread + 0

Thread 21:
0   libsystem_pthread.dylib         0x00000001f2c4ee8c start_wqthread + 0

Thread 22:
0   libsystem_pthread.dylib         0x00000001f2c4ee8c start_wqthread + 0

Thread 23:
0   libsystem_pthread.dylib         0x00000001f2c4ee8c start_wqthread + 0

Thread 24:
0   libsystem_pthread.dylib         0x00000001f2c4ee8c start_wqthread + 0

Thread 25:
0   libsystem_pthread.dylib         0x00000001f2c4ee8c start_wqthread + 0

Thread 26:
0   libsystem_pthread.dylib         0x00000001f2c4ee8c start_wqthread + 0

Thread 27:
0   libsystem_pthread.dylib         0x00000001f2c4ee8c start_wqthread + 0

Thread 1 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0x0000000000000000   x2: 0x0000000000000000   x3: 0x0000000000000000
    x4: 0x000000019b5110ad   x5: 0x000000016de0e440   x6: 0x000000000000006e   x7: 0x0000000000000700
    x8: 0x2dc8b7a9606c9c17   x9: 0x2dc8b7a80d8c6c17  x10: 0x0000000000000002  x11: 0x000000000000000b
   x12: 0x00000000c8c31825  x13: 0x0000000048c31800  x14: 0x0000000000000010  x15: 0x0000000000000002
   x16: 0x0000000000000148  x17: 0x000000016de0f000  x18: 0x0000000000000000  x19: 0x0000000000000006
   x20: 0x0000000000002907  x21: 0x000000016de0f0e0  x22: 0x0000000000000000  x23: 0x000000016de0f0e0
   x24: 0x00000002835101e8  x25: 0x0000000000000000  x26: 0x0000000000000134  x27: 0x0000000000000000
   x28: 0x0000000280e053c0   fp: 0x000000016de0e3b0   lr: 0x00000001f2c55378
    sp: 0x000000016de0e390   pc: 0x00000001b95d5964 cpsr: 0x40000000
   esr: 0x56000080  Address size fault

Binary Images:
0x102078000 - 0x10265ffff Raivo arm64  <add50fab936d32cf8bcd887d34d4275b> /private/var/containers/Bundle/Application/711C4DC7-AF0C-4B6B-88EA-A68FA99F16B4/Raivo.app/Raivo
0x1029c4000 - 0x102a1bfff dyld arm64e  <f94ccc7a6d1a33c7997ff611a6caa7e0> /usr/lib/dyld
0x182838000 - 0x18287efff libdispatch.dylib arm64e  <edd169e1d0db3808a19e99c1cd5a1c4c> /usr/lib/system/libdispatch.dylib
0x182b31000 - 0x182f84fff CoreFoundation arm64e  <16faa70c278c3561859ecec407c2dc7c> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
0x184354000 - 0x18465afff Foundation arm64e  <9618b2f2a4c23e07b7eed8d9e1bdeaec> /System/Library/Frameworks/Foundation.framework/Foundation
0x184fd8000 - 0x186862fff UIKitCore arm64e  <cd7f7ba2a2c63727aff69baab60cc6ab> /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore
0x189fa7000 - 0x18a18afff CloudKit arm64e  <2f0aca010748399d91e60ad8030f0278> /System/Library/Frameworks/CloudKit.framework/CloudKit
0x18da6e000 - 0x18daecfff libsystem_c.dylib arm64e  <f3afe30409793cba8338bebe9722ecd8> /usr/lib/system/libsystem_c.dylib
0x19b3f0000 - 0x19b429fff libobjc.A.dylib arm64e  <73e920f0e7ce394197d87a10dd2cd390> /usr/lib/libobjc.A.dylib
0x19b4fa000 - 0x19b513fff libc++abi.dylib arm64e  <71b1e39fb291315daf46a4343e707387> /usr/lib/libc++abi.dylib
0x19e6db000 - 0x19e6e3fff GraphicsServices arm64e  <064a1bb60e413ad2a402fb563fc141f5> /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
0x1b0297000 - 0x1b0299fff libswiftObjectiveC.dylib arm64e  <43dae53ef87f3e92b392c48f05693d90> /usr/lib/swift/libswiftObjectiveC.dylib
0x1b95ce000 - 0x1b9601fff libsystem_kernel.dylib arm64e  <eb3e47f3395335839feefb6cff8a8d7a> /usr/lib/system/libsystem_kernel.dylib
0x1f2c4e000 - 0x1f2c59fff libsystem_pthread.dylib arm64e  <c5c27e9d955739c9b9c65f6e7323ee1c> /usr/lib/system/libsystem_pthread.dylib

EOF

Can you reproduce the bug?

Not yet

Reproduction Steps

No response

Version

5.5.2

What SDK flavour are you using?

Local Database only

Are you using encryption?

Yes, using encryption

Platform OS and version(s)

iOS version 14.x and 15.x.

Build environment

Xcode version: 12.5.* (18E182) Dependency manager and version: Swift Package Manager

dianaafanador3 commented 2 years ago

Hey @tijme try to update to our latest release version https://github.com/realm/realm-swift/releases/tag/v10.22.0, some of this issues are fixed on each of our releases.

tijme commented 2 years ago

I have deployed a new version of my app with the latest version of Realm to TestFlight, waiting for users to give feedback. I'll report the results back to you.

leemaguire commented 2 years ago

Hi @tijme,

Did the latest version of Realm solve your issue?