-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
How frequently does the bug occur?
Sometimes
Description
On the ios app that uses realm swift sdk, we see crashes happening when the app is opened after an idle time of around 1 day, when there are hundreds of changesets to sync. This crash doesnt happen when the app is opened after a few mins or an hour.
Attaching the crash log received from crashlytics.
Stacktrace & log output
Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
com.apple.main-thread 0 libsystem_kernel.dylib 0xc84 mach_msg2_trap + 8 1 libsystem_kernel.dylib 0x13b54 mach_msg2_internal + 80 2 libsystem_kernel.dylib 0x13e2c mach_msg_overwrite + 540 3 libsystem_kernel.dylib 0x11c8 mach_msg + 24 4 CoreFoundation 0x79114 __CFRunLoopServiceMachPort + 160 5 CoreFoundation 0x7a340 __CFRunLoopRun + 1208 6 CoreFoundation 0x7f4dc CFRunLoopRunSpecific + 612 7 GraphicsServices 0x135c GSEventRunModal + 164 8 UIKitCore 0x39d37c -[UIApplication _run] + 888 9 UIKitCore 0x39cfe0 UIApplicationMain + 340 10 libswiftUIKit.dylib 0x350b0 UIApplicationMain(_:_:_:_:) + 104 11 JumpClear 0xed14 main + 4338216212 (AllCategoriesFilterView.swift:4338216212) 12 ??? 0x1a992cdec (Missing) Thread 0 libsystem_kernel.dylib 0x118c __workq_kernreturn + 8 1 libsystem_pthread.dylib 0xe28 _pthread_wqthread + 364 2 libsystem_pthread.dylib 0xb7c start_wqthread + 8 Thread 0 libsystem_kernel.dylib 0x118c __workq_kernreturn + 8 1 libsystem_pthread.dylib 0xe28 _pthread_wqthread + 364 2 libsystem_pthread.dylib 0xb7c start_wqthread + 8 Thread 0 libsystem_kernel.dylib 0x118c __workq_kernreturn + 8 1 libsystem_pthread.dylib 0xe28 _pthread_wqthread + 364 2 libsystem_pthread.dylib 0xb7c start_wqthread + 8 com.apple.uikit.eventfetch-thread 0 libsystem_kernel.dylib 0xc84 mach_msg2_trap + 8 1 libsystem_kernel.dylib 0x13b54 mach_msg2_internal + 80 2 libsystem_kernel.dylib 0x13e2c mach_msg_overwrite + 540 3 libsystem_kernel.dylib 0x11c8 mach_msg + 24 4 CoreFoundation 0x79114 __CFRunLoopServiceMachPort + 160 5 CoreFoundation 0x7a340 __CFRunLoopRun + 1208 6 CoreFoundation 0x7f4dc CFRunLoopRunSpecific + 612 7 Foundation 0x420c4 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212 8 Foundation 0x41fac -[NSRunLoop(NSRunLoop) runUntilDate:] + 64 9 UIKitCore 0x4cfdac -[UIEventFetcher threadMain] + 416 10 Foundation 0x5b634 __NSThread__start__ + 716 11 libsystem_pthread.dylib 0x16b8 _pthread_start + 148 12 libsystem_pthread.dylib 0xb88 thread_start + 8 Thread 0 libsystem_kernel.dylib 0x118c __workq_kernreturn + 8 1 libsystem_pthread.dylib 0xe28 _pthread_wqthread + 364 2 libsystem_pthread.dylib 0xb7c start_wqthread + 8 Thread 0 libsystem_kernel.dylib 0x118c __workq_kernreturn + 8 1 libsystem_pthread.dylib 0xe28 _pthread_wqthread + 364 2 libsystem_pthread.dylib 0xb7c start_wqthread + 8 Thread 0 libsystem_kernel.dylib 0x118c __workq_kernreturn + 8 1 libsystem_pthread.dylib 0xe28 _pthread_wqthread + 364 2 libsystem_pthread.dylib 0xb7c start_wqthread + 8 Thread 0 libsystem_kernel.dylib 0x118c __workq_kernreturn + 8 1 libsystem_pthread.dylib 0xe28 _pthread_wqthread + 364 2 libsystem_pthread.dylib 0xb7c start_wqthread + 8 Thread 0 libsystem_kernel.dylib 0x118c __workq_kernreturn + 8 1 libsystem_pthread.dylib 0xe28 _pthread_wqthread + 364 2 libsystem_pthread.dylib 0xb7c start_wqthread + 8 com.google.firebase.crashlytics.MachExceptionServer 0 libsystem_kernel.dylib 0xc84 mach_msg2_trap + 8 1 libsystem_kernel.dylib 0x13b54 mach_msg2_internal + 80 2 libsystem_kernel.dylib 0x13e2c mach_msg_overwrite + 540 3 libsystem_kernel.dylib 0x11c8 mach_msg + 24 4 FirebaseCrashlytics 0x1a03c FIRCLSMachExceptionServer + 104 5 libsystem_pthread.dylib 0x16b8 _pthread_start + 148 6 libsystem_pthread.dylib 0xb88 thread_start + 8 Thread 0 libsystem_kernel.dylib 0x118c __workq_kernreturn + 8 1 libsystem_pthread.dylib 0xe28 _pthread_wqthread + 364 2 libsystem_pthread.dylib 0xb7c start_wqthread + 8 com.apple.CFNetwork.CustomProtocols 0 libsystem_kernel.dylib 0xc84 mach_msg2_trap + 8 1 libsystem_kernel.dylib 0x13b54 mach_msg2_internal + 80 2 libsystem_kernel.dylib 0x13e2c mach_msg_overwrite + 540 3 libsystem_kernel.dylib 0x11c8 mach_msg + 24 4 CoreFoundation 0x79114 __CFRunLoopServiceMachPort + 160 5 CoreFoundation 0x7a340 __CFRunLoopRun + 1208 6 CoreFoundation 0x7f4dc CFRunLoopRunSpecific + 612 7 CFNetwork 0x2587e0 _CFURLStorageSessionDisableCache + 60900 8 Foundation 0x5b634 __NSThread__start__ + 716 9 libsystem_pthread.dylib 0x16b8 _pthread_start + 148 10 libsystem_pthread.dylib 0xb88 thread_start + 8 com.apple.NSURLConnectionLoader 0 libsystem_kernel.dylib 0xc84 mach_msg2_trap + 8 1 libsystem_kernel.dylib 0x13b54 mach_msg2_internal + 80 2 libsystem_kernel.dylib 0x13e2c mach_msg_overwrite + 540 3 libsystem_kernel.dylib 0x11c8 mach_msg + 24 4 CoreFoundation 0x79114 __CFRunLoopServiceMachPort + 160 5 CoreFoundation 0x7a340 __CFRunLoopRun + 1208 6 CoreFoundation 0x7f4dc CFRunLoopRunSpecific + 612 7 CFNetwork 0x2587e0 _CFURLStorageSessionDisableCache + 60900 8 Foundation 0x5b634 __NSThread__start__ + 716 9 libsystem_pthread.dylib 0x16b8 _pthread_start + 148 10 libsystem_pthread.dylib 0xb88 thread_start + 8 com.apple.CoreMotion.MotionThread 0 libsystem_kernel.dylib 0xc84 mach_msg2_trap + 8 1 libsystem_kernel.dylib 0x13b54 mach_msg2_internal + 80 2 libsystem_kernel.dylib 0x13e2c mach_msg_overwrite + 540 3 libsystem_kernel.dylib 0x11c8 mach_msg + 24 4 CoreFoundation 0x79114 __CFRunLoopServiceMachPort + 160 5 CoreFoundation 0x7a340 __CFRunLoopRun + 1208 6 CoreFoundation 0x7f4dc CFRunLoopRunSpecific + 612 7 CoreFoundation 0xc1f84 CFRunLoopRun + 64 8 CoreMotion 0x136e8 CLMotionActivity::isTypeInVehicle(CLMotionActivity::Type) + 23144 9 libsystem_pthread.dylib 0x16b8 _pthread_start + 148 10 libsystem_pthread.dylib 0xb88 thread_start + 8 Crashed: Thread 0 libsystem_kernel.dylib 0x7558 __pthread_kill + 8 1 libsystem_pthread.dylib 0x7118 pthread_kill + 268 2 libsystem_c.dylib 0x1d178 abort + 180 3 Realm 0x2ea8c4 please_report_this_issue_in_github_realm_realm_core_v_13_9_4 + 10 4 Realm 0x2eac08 realm::util::terminate_internal(std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char>>&) + 260 5 Realm 0x2eaa68 realm::util::terminate_with_info(char const*, char const*, long, char const*, std::initializer_list<realm::util::Printable>&&) + 400 6 Realm 0x2ea8d8 realm::util::terminate(char const*, char const*, long, std::initializer_list<realm::util::Printable>&&) + 18 7 Realm 0x316184 realm::sync::SessionWrapper::on_flx_sync_progress(long long, realm::sync::DownloadBatchState) + 504 8 Realm 0x315a04 realm::sync::ClientImpl::Session::process_pending_flx_bootstrap() + 1112 9 Realm 0x31534c realm::sync::ClientImpl::Session::process_flx_bootstrap_message(realm::sync::SyncProgress const&, realm::sync::DownloadBatchState, long long, std::__1::vector<realm::sync::Transformer::RemoteChangeset, std::__1::allocator<realm::sync::Transformer::RemoteChangeset>> const&) + 320 10 Realm 0x362a00 realm::sync::ClientImpl::Session::receive_download_message(realm::sync::SyncProgress const&, unsigned long long, realm::sync::DownloadBatchState, long long, std::__1::vector<realm::sync::Transformer::RemoteChangeset, std::__1::allocator<realm::sync::Transformer::RemoteChangeset>> const&) + 960 11 Realm 0x36a998 void realm::_impl::ClientProtocol::parse_download_message<realm::sync::ClientImpl::Connection>(realm::sync::ClientImpl::Connection&, realm::_impl::HeaderLineParser&) + 1572 12 Realm 0x35f358 void realm::_impl::ClientProtocol::parse_message_received<realm::sync::ClientImpl::Connection>(realm::sync::ClientImpl::Connection&, std::__1::basic_string_view<char, std::__1::char_traits<char>>) + 692 13 Realm 0x369680 realm::sync::ClientImpl::Connection::WebSocketObserverShim::websocket_binary_message_received(realm::util::Span<char const, 18446744073709551615ul>) + 148 14 Realm 0x34b8f8 (anonymous namespace)::WebSocket::frame_reader_loop() + 136 15 Realm 0x33b5d0 void realm::sync::network::Service::AsyncOper::do_recycle_and_execute<realm::util::UniqueFunction<void (std::__1::error_code, unsigned long)>, std::__1::error_code&, unsigned long&>(bool, realm::util::UniqueFunction<void (std::__1::error_code, unsigned long)>&, std::__1::error_code&, unsigned long&) + 156 16 Realm 0x33b0f8 realm::sync::network::Service::BasicStreamOps<realm::sync::network::ssl::Stream>::BufferedReadOper<realm::util::UniqueFunction<void (std::__1::error_code, unsigned long)>>::recycle_and_execute() + 240 17 Realm 0x343698 realm::sync::network::Service::Impl::run_impl(bool) + 388 18 Realm 0x33346c realm::sync::websocket::DefaultSocketProvider::event_loop() + 220 19 Realm 0x335128 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (realm::sync::websocket::DefaultSocketProvider::*)(), realm::sync::websocket::DefaultSocketProvider*>>(void*) + 64 20 libsystem_pthread.dylib 0x16b8 _pthread_start + 148 21 libsystem_pthread.dylib 0xb88 thread_start + 8 Realm notification listener 0 libsystem_kernel.dylib 0x25bc kevent + 8 1 Realm 0x3cbdb0 realm::_impl::ExternalCommitHelper::listen() + 156 2 Realm 0x3cbf0c 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::ExternalCommitHelper(realm::_impl::RealmCoordinator&, realm::RealmConfig const&)::$_0>>(void*) + 52 3 libsystem_pthread.dylib 0x16b8 _pthread_start + 148 4 libsystem_pthread.dylib 0xb88 thread_start + 8 Thread 0 libsystem_kernel.dylib 0x1558 __psynch_cvwait + 8 1 libsystem_pthread.dylib 0x8078 _pthread_cond_wait + 1232 2 libc++.1.dylib 0x12ef8 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 28 3 Realm 0x343ab4 realm::sync::network::Service::Impl::resolver_thread() + 204 4 Realm 0x343988 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::sync::network::Service::Impl::add_resolve_oper(std::__1::unique_ptr<realm::sync::network::Service::ResolveOperBase, realm::sync::network::Service::LendersOperDeleter>)::'lambda'()>>(void*) + 44 5 libsystem_pthread.dylib 0x16b8 _pthread_start + 148 6 libsystem_pthread.dylib 0xb88 thread_start + 8
Can you reproduce the bug?
Sometimes
Reproduction Steps
- Open the app. It does Realm login if not already logged in, then does realm sync and populates data.
- Quit the app and reopen again. - works fine
- Quit the app and reopen next day - crashes as soon as app is opened and doing realm sync.
- Until the changesets are all synced, the app keeps crashing if we open. Once sync is done it behaves normal until we quit and open after many hours.
Version
Realm Swift v10.38.3, Realm Swift v10.36.0
What Atlas Services are you using?
Atlas App Services: Functions or GraphQL or DataAPI etc
Are you using encryption?
No
Platform OS and version(s)
iOS 16.5, iOS 16.3.1, iOS 16.1.1
Build environment
Xcode version: ...14.3
Dependency manager and version: ... cocoapods 1.12.0