Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash please_report_this_issue_in_github_realm_realm_core_v_13_9_4 #8252

Closed
BCSingh opened this issue Jun 5, 2023 · 6 comments
Closed

crash please_report_this_issue_in_github_realm_realm_core_v_13_9_4 #8252

BCSingh opened this issue Jun 5, 2023 · 6 comments

Comments

@BCSingh
Copy link

BCSingh commented Jun 5, 2023

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.

issue_908e37e69e13e0381ca424173dfb0d14_crash_session_da6c66d7ab8446e58d625a804b48f6ca_DNE_0_v2_stacktrace.txt

Stacktrace & log output

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

  1. Open the app. It does Realm login if not already logged in, then does realm sync and populates data.
  2. Quit the app and reopen again. - works fine
  3. Quit the app and reopen next day - crashes as soon as app is opened and doing realm sync.
  4. 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

@dianaafanador3
Copy link
Contributor

@michael-wb do you have any clue why this may happen? The assertion seems to be happening on this line https://github.com/realm/realm-core/blob/895d480fbe33abd59d04e130deca9da1ce2e595c/src/realm/sync/client.cpp#L1234

@BCSingh
Copy link
Author

BCSingh commented Jun 16, 2023

We are still facing this issue.. Can you give some clarity on what's happening?

@michael-wb
Copy link

Hi @BCSingh - if I remember correctly, I believe this was fixed in a later version of Core (I will need to research to see if I can find it). Have you tried testing against a more recent version of the Swift SDK to see if it's still happening?

@BCSingh
Copy link
Author

BCSingh commented Jun 22, 2023

Hi @BCSingh - if I remember correctly, I believe this was fixed in a later version of Core (I will need to research to see if I can find it). Have you tried testing against a more recent version of the Swift SDK to see if it's still happening?

Thanks @michael-wb We were a few versions behind and this issue started suddenly happening on production. As you suggested, we have updated to the latest Realm Swift SDK and tested for a few days and it seems to work fine now.

@BCSingh BCSingh closed this as completed Jun 22, 2023
@joaopdcgarcia
Copy link

@BCSingh which version are you on? We've started to see this on 10.38.3

@BCSingh
Copy link
Author

BCSingh commented Jul 12, 2023

@BCSingh which version are you on? We've started to see this on 10.38.3

@joaopdcgarcia We started seeing this issue when we were using somewhere around the same version 10.38.x
Later as suggested by michael from Realm team, we updated the realm swift sdk to 10.42.0, we don't see this issue anymore. So try updating to one of the latest version.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants