realm-core: Realm notification listener crash

Realm version: 10.1.1 and some previous (it was reproduce on 10.0.0 too).

It happens suddenly on 20-50 users in a day (we have around 1k users in a day). I could provide only part of stack trace from firebase:

Crashed: Realm notification listener
0  Realm                          0x101671e04 long long realm::Array::get<64ul>(unsigned long) const + 4
1  Realm                          0x1013922fc realm::ArrayKeyBase<0>::get(unsigned long) const + 36
2  Realm                          0x101392324 realm::util::FunctionRef<void (realm::BPlusTreeNode*, unsigned long)>::FunctionRef<realm::BPlusTree<realm::ObjKey>::get(unsigned long) const::'lambda'(realm::BPlusTreeNode*, unsigned long)&>(realm::ObjKey&&)::'lambda'(void*, realm::BPlusTreeNode*, unsigned long)::__invoke(void*, realm::BPlusTreeNode*, unsigned long) + 28
3  Realm                          0x10173c638 realm::ConstLstIf<realm::ObjKey>::get(unsigned long) const + 264
4  Realm                          0x1013a3b84 realm::_impl::ListNotifier::run() + 244
5  Realm                          0x1013b9f8c realm::_impl::RealmCoordinator::run_async_notifiers() + 1788
6  Realm                          0x1013b9834 realm::_impl::RealmCoordinator::on_change() + 24
7  Realm                          0x10139345c realm::_impl::ExternalCommitHelper::listen() + 204
8  Realm                          0x1013938b4 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&)::$_0> >(void*) + 52
9  libsystem_pthread.dylib        0x1df23dca8 _pthread_start + 320
10 libsystem_pthread.dylib        0x1df246788 thread_start + 8

Steps to reproduce: unknown, sorry

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 26 (14 by maintainers)

Most upvoted comments

If you are not using sync, #5164 is not relevant for you. We will try to find out what we can do to find the root cause of this problem.

I see the issue #5164 was merged, but didn’t made it to 11.9.0. Is there a workaround for this or double check that we can do? It’s getting critical for us, as we are facing repetitive crashes for some users. Internally, we were still unable to reproduce the crash, with or without the debugger attached.

We have simplified as much as we could the object structure, we removed properties that were not important. It has now only one RLMArray property (with a max size of 15 RLMObjects) and we have an NSData property (which is fairly small, around 5k bytes). The crash still happens.

Are the apps that are crashing using Realm sync?

No. We’re using Realm just for persisting data locally.

@r-rebacz The confusion comes from the fact that the stack trace does not match v10.7.4. It seems to be a newer version. You can follow https://github.com/realm/realm-cocoa/pull/7488.

Thank you @jedelbo for your interest in the topic. We’re using v10.7.4.

Crashed: Realm notification listener
SIGSEGV 0x0000000116089ed0
----
Crashed: Realm notification listener
0  Realm                          0x103209124 long long realm::Array::get<64ul>(unsigned long) const + 4
1  Realm                          0x1030b2d64 realm::ArrayKeyBase<0>::get(unsigned long) const + 36
2  Realm                          0x1030b481c realm::util::FunctionRef<void (realm::BPlusTreeNode*, unsigned long)>::FunctionRef<realm::BPlusTree<realm::ObjKey>::get_uncached(unsigned long) const::'lambda'(realm::BPlusTreeNode*, unsigned long)&>(realm::ObjKey&&)::'lambda'(void*, realm::BPlusTreeNode*, unsigned long)::__invoke(void*, realm::BPlusTreeNode*, unsigned long) + 28
3  Realm                          0x1030b47f0 realm::BPlusTree<realm::ObjKey>::get_uncached(unsigned long) const + 64
4  Realm                          0x1030b5798 realm::LnkLst::get_any(unsigned long) const + 80
5  Realm                          0x10345ff30 realm::_impl::ListNotifier::run() + 260
6  Realm                          0x103468bdc realm::_impl::RealmCoordinator::run_async_notifiers() + 3124
7  Realm                          0x103467f2c realm::_impl::RealmCoordinator::on_change() + 24
8  Realm                          0x10344ec4c realm::_impl::ExternalCommitHelper::listen() + 204
9  Realm                          0x10344ede4 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&)::$_0> >(void*) + 52
10 libsystem_pthread.dylib        0x1dc620bfc _pthread_start + 320
11 libsystem_pthread.dylib        0x1dc629758 thread_start + 8