realm / realm-js

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

Stability issues with Realm v. 10.13.0 and 10.16.0 #4525

Closed martinpoulsen closed 1 year ago

martinpoulsen commented 2 years ago

Since we upgraded Realm from 10.10.1 => 10.13.0, we have experienced a big drop in stability on iOS and have been hit by what appears to be native memory management issues. Our crash reporting tool (Bugsnag) reports that the iOS app session stability dropped from ~ 99% to ~ 90%. We didn't update any other dependencies (or made any native code changes) in the release where we updated Realm and started seeing these issues. This is what the top crashes looked like with Realm 10.13.0:

app-with-realm-10.13.0

Then we tried upgrading Realm from 10.13.0 => 10.16.0 (again without making changes to other app dependencies or making native code changes) but unfortunately the session stability did not improve. This is what the top crashes look like with Realm after the Realm upgrade to 10.16.0 (sorry about the non-symbolicated traces):

app-with-realm-10.16.0

Both app versions with Realm 10.13.0 and 10.16.0 show realm::NoSuchTable and realm::KeyNotFound crashes. However, the most frequently reported crash comes in the form of a more general SIGABRT error report which it's my understanding could be rooted in any native module. Here's an example stack trace from the reported SIGABRT crash:

CrashReporter Key:  6d45566d1ac905693d54683d15c5898bf1c38050
Hardware Model:     iPhone12,5
Process:            driversnote
Identifier:         com.driversnote.driversnote
Version:            4.4.0
Role:               Background
OS Version:         iOS 15.4.1

SIGABRT: 

0   libsystem_kernel.dylib  ___pthread_kill
1   libsystem_pthread.dylib _pthread_kill
2   libsystem_c.dylib       _abort
[...]
21  JavaScriptCore          JSC::JSCallbackObject<JSC::JSNonFinalObject>::getOwnPropertySlot(JSC::JSObject*, JSC::JSGlobalObject*, JSC::PropertyName, JSC::PropertySlot&)
22  JavaScriptCore          JSC::JSCallbackObject<JSC::JSNonFinalObject>::getOwnPropertySlotByIndex(JSC::JSObject*, JSC::JSGlobalObject*, unsigned int, JSC::PropertySlot&)
23  JavaScriptCore          _llint_slow_path_get_by_val
24  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
25  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
26  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
27  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
28  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
29  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
30  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
31  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
32  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
33  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
34  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
35  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
36  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
37  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
38  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
39  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
40  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
41  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
42  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
43  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
44  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
45  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
46  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
47  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
48  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
49  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
50  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
51  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
52  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
53  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
54  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
55  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
56  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
57  JavaScriptCore          _vmEntryToJavaScriptTrampoline
58  JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
59  JavaScriptCore          JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*)
60  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
61  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
62  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
63  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
64  JavaScriptCore          _vmEntryToJavaScriptTrampoline
65  JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
66  JavaScriptCore          JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*)
67  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
68  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
69  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
70  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
71  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
72  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
73  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
74  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
75  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
76  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
77  JavaScriptCore          _vmEntryToJavaScriptTrampoline
78  JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
79  JavaScriptCore          JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*)
80  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
81  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
82  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
83  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
84  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
85  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
86  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
87  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
88  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
89  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
90  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
91  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
92  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
93  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
94  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
95  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
96  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
97  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
98  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
99  JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
100 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
101 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
102 JavaScriptCore          _vmEntryToJavaScriptTrampoline
103 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
104 JavaScriptCore          JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*)
105 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
106 JavaScriptCore          _vmEntryToJavaScriptTrampoline
107 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
108 JavaScriptCore          JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*)
109 JavaScriptCore          _vmEntryToNative
110 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
111 JavaScriptCore          JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
112 JavaScriptCore          _JSObjectCallAsFunction
[...]
119 CoreFoundation          ___CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__
120 CoreFoundation          ___CFRunLoopDoBlocks
121 CoreFoundation          ___CFRunLoopRun
122 CoreFoundation          _CFRunLoopRunSpecific
123 driversnote             0x100339374 (0x100339270 + 260) (driversnote)
124 Foundation              ___NSThread__start__
125 libsystem_pthread.dylib __pthread_start

Here are a few crash reports retrieved through XCode which mention Realm in the stack trace - they are all from the app version which uses realm v. 10.16.0: 2022-04-2311-24-19.2673-0500-2fd0a5349d21e8624bedea7cadd05249a7ef257e.txt 2022-04-2409-49-16.5911+0800-5d54e08447eada3d190a81ad0583993fbed9e685.txt 2022-04-2411-06-35.7773+0800-1dc9a5cb656aa8f4597272dea4f4e2fd2fe4b7d3.txt 2022-04-2411-51-44.3257-0500-e80fd319087391b20fa73e248a7f66e80b34afa0.txt 2022-04-2413-26-48.1968+0200-00cc3ee3534c38956fa8190f226d1dd5d1a04af5.txt 2022-04-2510-50-14.0976+0200-10370900cb31f02fbe46c189a186c85709ec1532.txt

We realise that this issue is somewhat vague but unfortunately we haven't yet found a way to reproduce the crashes. Our hope is that some of the attached crash reports will be meaningful for the Realm team and either point to a Realm problem - or to something which we could be doing wrong but which only causes problems in these new realm versions.

We use Realm with react-native v. 0.65.2 (without Hermes)

fronck commented 2 years ago

@martinpoulsen Thanks for reporting. We will look into the issue. As always, if you find further information or a reproduction, please let us know.

kneth commented 2 years ago

I have investigated the stack traces.

Two stack traces (2022-04-25_10-50-14.0976_+0200-10370900cb31f02fbe46c189a186c85709ec1532.txt and 2022-04-25_10-50-14.0976_+0200-10370900cb31f02fbe46c189a186c85709ec1532.txt) is similar to https://github.com/realm/realm-core/issues/5344 - the realm::Array::init_from_ref() call is in both.

Moreover, the stack traces 2022-04-24_11-06-35.7773_+0800-1dc9a5cb656aa8f4597272dea4f4e2fd2fe4b7d3.txt and 2022-04-24_09-49-16.5911_+0800-5d54e08447eada3d190a81ad0583993fbed9e685.txt have some similarity (memmove() in particular).

martinpoulsen commented 2 years ago

Thanks @kneth for investigating. I have a hard time evaluating the resemblance of the stack traces, but I see from the error report bread crumbs in our most frequent crash that - like https://github.com/realm/realm-core/issues/5344 - it also happens on app launch (where we create a Realm instance).

I get a little nervous if our stability issues share root cause with https://github.com/realm/realm-core/issues/5344 as it has been open for more than a month without being updated - is it still being investigated?

@fronck We still didn't find a way to reproduce the issue, but we got symbolication of the native iOS stack trace working in the Bugsnag error reports and this is an example of the stack trace of the crash which we see most (and very) frequently:

CrashReporter Key:  136e360b0870ada379b77b35b182e3cf0bea5445
Hardware Model:     iPhone14,3
Process:            driversnote
Identifier:         com.driversnote.driversnote
Version:            4.4.1
Role:               Background
OS Version:         iOS 15.4.1

SIGABRT: 

0  libsystem_kernel.dylib  ___pthread_kill
1  libsystem_pthread.dylib _pthread_kill
2  libsystem_c.dylib       _abort
3  driversnote             please_report_this_issue_in_github_realm_realm_core (driversnote)
4  driversnote             realm::util::terminate_internal(std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) (driversnote)
5  driversnote             realm::util::terminate(char const*, char const*, long, std::initializer_list<realm::util::Printable>&&) (driversnote)
6  driversnote             void realm::util::terminate<unsigned long, unsigned long>(char const*, char const*, long, unsigned long, unsigned long) (driversnote)
7  driversnote             realm::ArraySmallBlobs::insert(unsigned long, realm::BinaryData, bool) (driversnote)
8  driversnote             void realm::Cluster::do_insert_row<realm::ArrayString>(unsigned long, realm::ColKey, realm::Mixed, bool) (driversnote)
9  driversnote             realm::util::FunctionRef<bool (realm::ColKey)>::FunctionRef<realm::Cluster::insert_row(unsigned long, realm::ObjKey, std::__1::vector<realm::FieldValue, std::__1::allocator<realm::FieldValue> > const&)::$_1&>(realm::Cluster::insert_row(unsigned long, realm::ObjKey, std::__1::vector<realm::FieldValue, std::__1::allocator<realm::FieldValue> > const&)::$_1&)::{lambda(void*, realm::ColKey)#1}::__invoke(void*, realm::ColKey) (driversnote)
10 driversnote             realm::TableClusterTree::for_each_and_every_column(realm::util::FunctionRef<bool (realm::ColKey)>) const (driversnote)
11 driversnote             realm::Cluster::insert_row(unsigned long, realm::ObjKey, std::__1::vector<realm::FieldValue, std::__1::allocator<realm::FieldValue> > const&) (driversnote)
12 driversnote             realm::Cluster::insert(realm::ObjKey, std::__1::vector<realm::FieldValue, std::__1::allocator<realm::FieldValue> > const&, realm::ClusterNode::State&) (driversnote)
13 driversnote             realm::ClusterNodeInner::insert(realm::ObjKey, std::__1::vector<realm::FieldValue, std::__1::allocator<realm::FieldValue> > const&, realm::ClusterNode::State&)::$_1::operator()(realm::ClusterNode*, realm::ClusterNodeInner::ChildInfo&) const (driversnote)
14 driversnote             realm::ClusterNodeInner::insert(realm::ObjKey, std::__1::vector<realm::FieldValue, std::__1::allocator<realm::FieldValue> > const&, realm::ClusterNode::State&) (driversnote)
15 driversnote             realm::ClusterTree::insert_fast(realm::ObjKey, std::__1::vector<realm::FieldValue, std::__1::allocator<realm::FieldValue> > const&, realm::ClusterNode::State&) (driversnote)
16 driversnote             realm::ClusterTree::insert(realm::ObjKey, std::__1::vector<realm::FieldValue, std::__1::allocator<realm::FieldValue> > const&) (driversnote)
17 driversnote             realm::TableClusterTree::insert(realm::ObjKey, std::__1::vector<realm::FieldValue, std::__1::allocator<realm::FieldValue> > const&) (driversnote)
18 driversnote             realm::Table::create_object_with_primary_key(realm::Mixed const&, std::__1::vector<realm::FieldValue, std::__1::allocator<realm::FieldValue> >&&, bool*) (driversnote)
19 driversnote             realm::Object realm::Object::create<OpaqueJSValue const*, realm::js::NativeAccessor<realm::jsc::Types> >(realm::js::NativeAccessor<realm::jsc::Types>&, std::__1::shared_ptr<realm::Realm> const&, realm::ObjectSchema const&, OpaqueJSValue const*, realm::CreatePolicy, realm::ObjKey, realm::Obj*) (driversnote)
20 driversnote             realm::js::_impl::Unbox<realm::jsc::Types, realm::Obj>::call(realm::js::NativeAccessor<realm::jsc::Types>*, OpaqueJSValue const* const&, realm::CreatePolicy, realm::ObjKey) (driversnote)
21 driversnote             auto realm::switch_on_type<realm::Obj, void realm::List::add<OpaqueJSValue const*&, realm::js::NativeAccessor<realm::jsc::Types> >(realm::js::NativeAccessor<realm::jsc::Types>&, OpaqueJSValue const*&, realm::CreatePolicy)::{lambda(auto:1)#1}>(realm::PropertyType, realm::js::NativeAccessor<realm::jsc::Types>&&) (driversnote)
22 driversnote             void realm::List::add<OpaqueJSValue const*&, realm::js::NativeAccessor<realm::jsc::Types> >(realm::js::NativeAccessor<realm::jsc::Types>&, OpaqueJSValue const*&, realm::CreatePolicy) (driversnote)
23 driversnote             void realm::List::assign<OpaqueJSValue const*&, realm::js::NativeAccessor<realm::jsc::Types> >(realm::js::NativeAccessor<realm::jsc::Types>&, OpaqueJSValue const*&, realm::CreatePolicy) (driversnote)
24 driversnote             void realm::Object::set_property_value_impl<OpaqueJSValue const*, realm::js::NativeAccessor<realm::jsc::Types> >(realm::js::NativeAccessor<realm::jsc::Types>&, realm::Property const&, OpaqueJSValue const*, realm::CreatePolicy, bool) (driversnote)
25 driversnote             realm::js::RealmObjectClass<realm::jsc::Types>::set_property(OpaqueJSContext const*, OpaqueJSValue*, realm::js::String<realm::jsc::Types> const&, OpaqueJSValue const*) (driversnote)
26 driversnote             bool realm::js::wrap<&realm::js::RealmObjectClass<realm::jsc::Types>::set_property>(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSString*, OpaqueJSValue const*, OpaqueJSValue const**) (driversnote)
27 driversnote             realm::jsc::ObjectWrap<realm::js::RealmObjectClass<realm::jsc::Types> >::accessor_setter(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) (driversnote)
28 JavaScriptCore          JSC::JSCallbackObject<JSC::JSNonFinalObject>::callImpl(JSC::JSGlobalObject*, JSC::CallFrame*)
29 JavaScriptCore          _vmEntryToNative
30 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
31 JavaScriptCore          JSC::GetterSetter::callSetter(JSC::JSGlobalObject*, JSC::JSValue, JSC::JSValue, bool)
32 JavaScriptCore          JSC::JSObject::putInlineSlow(JSC::JSGlobalObject*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&)
33 JavaScriptCore          JSC::JSObject::putInlineSlow(JSC::JSGlobalObject*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&)
34 JavaScriptCore          JSC::JSCallbackObject<JSC::JSNonFinalObject>::put(JSC::JSCell*, JSC::JSGlobalObject*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&)
35 JavaScriptCore          _llint_slow_path_put_by_val
36 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
37 JavaScriptCore          _vmEntryToJavaScriptTrampoline
38 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
39 JavaScriptCore          JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
40 JavaScriptCore          _JSObjectCallAsFunction
41 driversnote             realm::js::RealmClass<realm::jsc::Types>::write(OpaqueJSContext const*, OpaqueJSValue*, realm::js::Arguments<realm::jsc::Types>&, realm::js::ReturnValue<realm::jsc::Types>&) (driversnote)
42 driversnote             OpaqueJSValue const* realm::js::wrap<&realm::js::RealmClass<realm::jsc::Types>::write>(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) (driversnote)
43 JavaScriptCore          long long JSC::APICallbackFunction::callImpl<JSC::JSCallbackFunction>(JSC::JSGlobalObject*, JSC::CallFrame*)
44 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
45 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
46 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
47 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
48 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
49 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
50 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
51 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
52 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
53 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
54 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
55 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
56 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
57 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
58 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
59 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
60 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
61 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
62 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
63 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
64 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
65 JavaScriptCore          _vmEntryToJavaScriptTrampoline
66 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
67 JavaScriptCore          JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*)
68 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
69 JavaScriptCore          _vmEntryToJavaScriptTrampoline
70 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
71 JavaScriptCore          JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*)
72 JavaScriptCore          _vmEntryToNative
73 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
74 JavaScriptCore          JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
75 JavaScriptCore          _JSObjectCallAsFunction
76 driversnote             call (JSCRuntime.cpp:1260:14)
77 driversnote             call (jsi-inl.h:228:18)
78 driversnote             operator() (functional:1885:16)
79 driversnote             operator() (functional:1885:16)
80 driversnote             tryFunc (RCTMessageThread.mm:69:20)
81 driversnote             operator() (functional:1885:16)
82 CoreFoundation          ___CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__
83 CoreFoundation          ___CFRunLoopDoBlocks
84 CoreFoundation          ___CFRunLoopRun
85 CoreFoundation          _CFRunLoopRunSpecific
86 driversnote             +[RCTCxxBridge runRunLoop] (RCTCxxBridge.mm:324:12)
87 Foundation              ___NSThread__start__
88 libsystem_pthread.dylib __pthread_start

Is there anything else I can do to help? E.g. would it be helpful if I pulled and attached more crash reports like the 6 reports I already attached earlier? Or more stack traces (they vary slightly) from Bugsnag like the example above?

martinpoulsen commented 2 years ago

In addition to the stack trace for the SIGABRT crash above (the most frequent crash), let me also add symbolicated stack traces for the two other realm crashes we started seeing after upgrading to realm v. 10.13.0 and which we still see in v. 10.16.0:

realm::NoSuchTable

CrashReporter Key:  6481e054aa0562a8025e98fb004d838332067af1
Hardware Model:     iPhone13,2
Process:            driversnote
Identifier:         com.driversnote.driversnote
Version:            4.4.1
Role:               Background
OS Version:         iOS 15.4.1

realm::NoSuchTable: No such table exists
Exception backtrace:
0   driversnote                         0x00000001009b6ab8 _ZN8facebook5react11JSIExecutor21defaultTimeoutInvokerERKNSt3__18functionIFvvEEENS3_IFNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEvEEE + 4790788
1   driversnote                         0x00000001009b6c44 _ZN8facebook5react11JSIExecutor21defaultTimeoutInvokerERKNSt3__18functionIFvvEEENS3_IFNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEvEEE + 4791184
2   driversnote                         0x0000000100a5f178 _ZN8facebook5react11JSIExecutor21defaultTimeoutInvokerERKNSt3__18functionIFvvEEENS3_IFNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEvEEE + 5480644
3   driversnote                         0x0000000100a69a54 _ZN8facebook5react11JSIExecutor21defaultTimeoutInvokerERKNSt3__18functionIFvvEEENS3_IFNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEvEEE + 5523872
4   driversnote                         0x00000001007d2064 _ZN8facebook5r

0  driversnote    realm::Group::key2ndx_checked(realm::TableKey) const (driversnote)
1  driversnote    realm::Table::get_opposite_table(realm::ColKey) const (driversnote)
2  driversnote    realm::Table::get_link_target(realm::ColKey) (driversnote)
3  driversnote    realm::ObjectSchema::ObjectSchema(realm::Group const&, realm::StringData, realm::TableKey) (driversnote)
4  driversnote    realm::ObjectStore::schema_from_group(realm::Group const&) (driversnote)
5  driversnote    realm::Realm::read_schema_from_group_if_needed() (driversnote)
6  driversnote    realm::Realm::Realm(realm::Realm::Config, realm::util::Optional<realm::VersionID>, std::__1::shared_ptr<realm::_impl::RealmCoordinator>, realm::Realm::MakeSharedTag) (driversnote)
7  driversnote    realm::Realm::make_shared_realm(realm::Realm::Config, realm::util::Optional<realm::VersionID>, std::__1::shared_ptr<realm::_impl::RealmCoordinator>) (driversnote)
8  driversnote    realm::_impl::RealmCoordinator::do_get_realm(realm::Realm::Config, std::__1::shared_ptr<realm::Realm>&, realm::util::Optional<realm::VersionID>, realm::util::CheckedUniqueLock&) (driversnote)
9  driversnote    realm::_impl::RealmCoordinator::get_realm(realm::Realm::Config, realm::util::Optional<realm::VersionID>) (driversnote)
10 driversnote    realm::Realm::get_shared_realm(realm::Realm::Config) (driversnote)
11 driversnote    realm::js::RealmClass<realm::jsc::Types>::create_shared_realm(OpaqueJSContext const*, realm::Realm::Config, bool, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, realm::js::Protected<OpaqueJSValue const*>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, realm::js::Protected<OpaqueJSValue const*> > > >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, realm::js::Protected<OpaqueJSValue const*>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, realm::js::Protected<OpaqueJSValue const*> > > > > > >&&, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, realm::js::Protected<OpaqueJSValue*>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, realm::js::Protected<OpaqueJSValue*> > > >&&) (driversnote)
12 driversnote    realm::js::RealmClass<realm::jsc::Types>::constructor(OpaqueJSContext const*, OpaqueJSValue*, realm::js::Arguments<realm::jsc::Types>&) (driversnote)
13 driversnote    realm::jsc::ObjectWrap<realm::js::RealmClass<realm::jsc::Types> >::construct(OpaqueJSContext const*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) (driversnote)
14 JavaScriptCore JSC::JSCallbackObject<JSC::JSNonFinalObject>::constructImpl(JSC::JSGlobalObject*, JSC::CallFrame*)
15 JavaScriptCore JSC::handleHostCall(JSC::JSGlobalObject*, JSC::CallFrame*, JSC::JSValue, JSC::CallLinkInfo*)
16 JavaScriptCore _llint_link_call
17 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
18 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
19 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
20 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
21 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
22 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
23 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
24 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
25 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
26 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
27 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
28 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter

realm::KeyNotFound

CrashReporter Key:  a6cddb4e55c838449c1539bb4860bb756b586aca
Hardware Model:     iPhone13,4
Process:            driversnote
Identifier:         com.driversnote.driversnote
Version:            4.4.1
Role:               Background
OS Version:         iOS 15.3.1

realm::KeyNotFound: No object with key '430133' in 'class_RoutePoint'

0  driversnote    realm::ClusterNode::get(realm::ObjKey, realm::ClusterNode::State&) const (driversnote)
1  driversnote    non-virtual thunk to realm::LnkLst::get_object(unsigned long) const (driversnote)
2  driversnote    realm::ObjList::try_get_object(unsigned long) const (driversnote)
3  driversnote    realm::Query::do_find_all(realm::TableView&, unsigned long) const (driversnote)
4  driversnote    realm::TableView::do_sync() (driversnote)
5  driversnote    realm::Query::find_all(unsigned long) (driversnote)
6  driversnote    realm::Query::find_all(realm::DescriptorOrdering const&) (driversnote)
7  driversnote    realm::Results::ensure_up_to_date(realm::Results::EvaluateMode) (driversnote)
8  driversnote    realm::Results::snapshot() && (driversnote)
9  driversnote    realm::object_store::Collection::snapshot() const (driversnote)
10 driversnote    OpaqueJSValue const* realm::js::wrap<&realm::js::ListClass<realm::jsc::Types>::snapshot>(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) (driversnote)
11 JavaScriptCore long long JSC::APICallbackFunction::callImpl<JSC::JSCallbackFunction>(JSC::JSGlobalObject*, JSC::CallFrame*)
12 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
13 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
14 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
15 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
16 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
17 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
18 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
19 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
20 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
21 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
22 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
23 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
24 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
25 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
26 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
27 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
28 JavaScriptCore _llint_function_for_construct_arity_checkTagGateAfter
andrei-tofan commented 2 years ago

We are having the same issue since upgrading.

jaltin commented 2 years ago

@kneth do you have any more information about this and any timeline for a possible fix?

Thx!

martinpoulsen commented 2 years ago

Hi again @kneth @fronck.

Unfortunately we still haven't been able to reproduce the crashes. But let me add some information from looking at the breadcrumbs of the SIGABRT crash reports: The app seems to always be in the background when it occurs - and it's either triggered when reading/writing or when instantiating the realm object during app launch (we perform this app launch initialization in the background when our app is woken up by an iBeacon or location event).

To me, the stack traces look a bit different for the SIGABRT crash - in hope of that being true and helpful, here are a few more example stack traces:

CrashReporter Key:  d71fabb196c2486a7e520189b1185243f37a0fa8
Hardware Model:     iPhone13,2
Process:            driversnote
Identifier:         com.driversnote.driversnote
Version:            4.4.1
Role:               Background
OS Version:         iOS 15.4.1

SIGABRT: 

0  libsystem_kernel.dylib  ___pthread_kill
1  libsystem_pthread.dylib _pthread_kill
2  libsystem_c.dylib       _abort
3  driversnote             please_report_this_issue_in_github_realm_realm_core (driversnote)
4  driversnote             realm::util::terminate_internal(std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) (driversnote)
5  driversnote             realm::util::terminate(char const*, char const*, long, std::initializer_list<realm::util::Printable>&&) (driversnote)
6  driversnote             realm::ArrayIntNull::init_from_ref(unsigned long) (driversnote)
7  driversnote             realm::ArrayTimestamp::init_from_mem(realm::MemRef) (driversnote)
8  driversnote             realm::ArrayTimestamp::init_from_ref(unsigned long) (driversnote)
9  driversnote             realm::Cluster::init_leaf(realm::ColKey, realm::ArrayPayload*) const (driversnote)
10 driversnote             realm::TimestampNodeBase::cluster_changed() (driversnote)
11 driversnote             realm::util::FunctionRef<bool (realm::Cluster const*)>::FunctionRef<realm::Query::do_count(unsigned long) const::$_4&>(realm::Query::do_count(unsigned long) const::$_4&)::{lambda(void*, realm::Cluster const*)#1}::__invoke(void*, realm::Cluster const*) (driversnote)
12 driversnote             realm::Query::do_count(unsigned long) const (driversnote)
13 driversnote             realm::Query::count(realm::DescriptorOrdering const&) (driversnote)
14 driversnote             realm::Results::size() (driversnote)
15 driversnote             OpaqueJSValue const* realm::js::wrap<&realm::js::ResultsClass<realm::jsc::Types>::get_length>(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSString*, OpaqueJSValue const**) (driversnote)
16 JavaScriptCore          JSC::JSCallbackObject<JSC::JSNonFinalObject>::getStaticValue(JSC::JSGlobalObject*, JSC::PropertyName)
17 JavaScriptCore          JSC::JSCallbackObject<JSC::JSNonFinalObject>::getOwnPropertySlot(JSC::JSObject*, JSC::JSGlobalObject*, JSC::PropertyName, JSC::PropertySlot&)
18 JavaScriptCore          JSC::LLInt::performLLIntGetByID(JSC::Instruction const*, JSC::CodeBlock*, JSC::JSGlobalObject*, JSC::JSValue, JSC::Identifier const&, JSC::GetByIdModeMetadata&)
19 JavaScriptCore          _llint_slow_path_get_by_id
20 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
21 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
22 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
23 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
24 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
25 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
26 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
27 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
28 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
29 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
30 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
31 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
32 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
33 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
34 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
35 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
36 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
37 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
38 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
39 JavaScriptCore          _vmEntryToJavaScriptTrampoline
40 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
41 JavaScriptCore          JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*)
42 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
43 JavaScriptCore          _vmEntryToJavaScriptTrampoline
44 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
45 JavaScriptCore          JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*)
46 JavaScriptCore          _vmEntryToNative
47 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
48 JavaScriptCore          JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
49 JavaScriptCore          _JSObjectCallAsFunction
50 driversnote             call (JSCRuntime.cpp:1260:14)
51 driversnote             call (jsi-inl.h:228:18)
52 driversnote             operator() (functional:1885:16)
53 driversnote             operator() (functional:1885:16)
54 driversnote             tryFunc (RCTMessageThread.mm:69:20)
55 driversnote             operator() (functional:1885:16)
56 CoreFoundation          ___CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__
57 CoreFoundation          ___CFRunLoopDoBlocks
58 CoreFoundation          ___CFRunLoopRun
59 CoreFoundation          _CFRunLoopRunSpecific
60 driversnote             +[RCTCxxBridge runRunLoop] (RCTCxxBridge.mm:324:12)
61 Foundation              ___NSThread__start__
62 libsystem_pthread.dylib __pthread_start
CrashReporter Key:  5fa580bcd0050e6da9c7b14bf3e57b79c64768d3
Hardware Model:     iPhone14,3
Process:            driversnote
Identifier:         com.driversnote.driversnote
Version:            4.4.1
Role:               Background
OS Version:         iOS 15.4.1

SIGABRT: 

0  libsystem_kernel.dylib  ___pthread_kill
1  libsystem_pthread.dylib _pthread_kill
2  libsystem_c.dylib       _abort
3  driversnote             please_report_this_issue_in_github_realm_realm_core (driversnote)
4  driversnote             realm::util::terminate_internal(std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) (driversnote)
5  driversnote             realm::util::terminate_with_info(char const*, char const*, long, char const*, std::initializer_list<realm::util::Printable>&&) (driversnote)
6  driversnote             void realm::util::terminate_with_info<unsigned long&, unsigned long>(char const*, int, char const*, char const*, unsigned long&, unsigned long&&) (driversnote)
7  driversnote             realm::StringIndex::StringIndex(unsigned long, realm::ArrayParent*, unsigned long, realm::ClusterColumn const&, realm::Allocator&) (driversnote)
8  driversnote             realm::Table::refresh_index_accessors() (driversnote)
9  driversnote             realm::Group::create_table_accessor(unsigned long) (driversnote)
10 driversnote             realm::Group::do_get_table(unsigned long) (driversnote)
11 driversnote             realm::ObjectSchema::ObjectSchema(realm::Group const&, realm::StringData, realm::TableKey) (driversnote)
12 driversnote             realm::ObjectStore::schema_from_group(realm::Group const&) (driversnote)
13 driversnote             realm::Realm::read_schema_from_group_if_needed() (driversnote)
14 driversnote             realm::Realm::Realm(realm::Realm::Config, realm::util::Optional<realm::VersionID>, std::__1::shared_ptr<realm::_impl::RealmCoordinator>, realm::Realm::MakeSharedTag) (driversnote)
15 driversnote             realm::Realm::make_shared_realm(realm::Realm::Config, realm::util::Optional<realm::VersionID>, std::__1::shared_ptr<realm::_impl::RealmCoordinator>) (driversnote)
16 driversnote             realm::_impl::RealmCoordinator::do_get_realm(realm::Realm::Config, std::__1::shared_ptr<realm::Realm>&, realm::util::Optional<realm::VersionID>, realm::util::CheckedUniqueLock&) (driversnote)
17 driversnote             realm::_impl::RealmCoordinator::get_realm(realm::Realm::Config, realm::util::Optional<realm::VersionID>) (driversnote)
18 driversnote             realm::Realm::get_shared_realm(realm::Realm::Config) (driversnote)
19 driversnote             realm::js::RealmClass<realm::jsc::Types>::create_shared_realm(OpaqueJSContext const*, realm::Realm::Config, bool, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, realm::js::Protected<OpaqueJSValue const*>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, realm::js::Protected<OpaqueJSValue const*> > > >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, realm::js::Protected<OpaqueJSValue const*>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, realm::js::Protected<OpaqueJSValue const*> > > > > > >&&, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, realm::js::Protected<OpaqueJSValue*>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, realm::js::Protected<OpaqueJSValue*> > > >&&) (driversnote)
20 driversnote             realm::js::RealmClass<realm::jsc::Types>::constructor(OpaqueJSContext const*, OpaqueJSValue*, realm::js::Arguments<realm::jsc::Types>&) (driversnote)
21 driversnote             realm::jsc::ObjectWrap<realm::js::RealmClass<realm::jsc::Types> >::construct(OpaqueJSContext const*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) (driversnote)
22 JavaScriptCore          JSC::JSCallbackObject<JSC::JSNonFinalObject>::constructImpl(JSC::JSGlobalObject*, JSC::CallFrame*)
23 JavaScriptCore          JSC::handleHostCall(JSC::JSGlobalObject*, JSC::CallFrame*, JSC::JSValue, JSC::CallLinkInfo*)
24 JavaScriptCore          _llint_link_call
25 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
26 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
27 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
28 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
29 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
30 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
31 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
32 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
33 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
34 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
35 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
36 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
37 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
38 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
39 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
40 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
41 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
42 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
43 JavaScriptCore          _vmEntryToJavaScriptTrampoline
44 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
45 JavaScriptCore          JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*)
46 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
47 JavaScriptCore          _vmEntryToJavaScriptTrampoline
48 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
49 JavaScriptCore          JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*)
50 JavaScriptCore          _vmEntryToNative
51 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
52 JavaScriptCore          JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
53 JavaScriptCore          _JSObjectCallAsFunction
54 driversnote             call (JSCRuntime.cpp:1260:14)
55 driversnote             call (jsi-inl.h:228:18)
56 driversnote             operator() (functional:1885:16)
57 driversnote             operator() (functional:1885:16)
58 driversnote             tryFunc (RCTMessageThread.mm:69:20)
59 driversnote             operator() (functional:1885:16)
60 CoreFoundation          ___CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__
61 CoreFoundation          ___CFRunLoopDoBlocks
62 CoreFoundation          ___CFRunLoopRun
63 CoreFoundation          _CFRunLoopRunSpecific
64 driversnote             +[RCTCxxBridge runRunLoop] (RCTCxxBridge.mm:324:12)
65 Foundation              ___NSThread__start__
66 libsystem_pthread.dylib __pthread_start
CrashReporter Key:  51a5d0e061e5e5c9629011176751bc299d75bca6
Hardware Model:     iPhone12,1
Process:            driversnote
Identifier:         com.driversnote.driversnote
Version:            4.4.1
Role:               Background
OS Version:         iOS 15.3.1

SIGABRT: 

0  libsystem_kernel.dylib  ___pthread_kill
1  libsystem_pthread.dylib _pthread_kill
2  libsystem_c.dylib       _abort
3  driversnote             please_report_this_issue_in_github_realm_realm_core (driversnote)
4  driversnote             realm::util::terminate_internal(std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) (driversnote)
5  driversnote             realm::util::terminate(char const*, char const*, long, std::initializer_list<realm::util::Printable>&&) (driversnote)
6  driversnote             realm::Cluster::init(realm::MemRef) (driversnote)
7  driversnote             realm::ClusterTree::create_root_from_parent(realm::ArrayParent*, unsigned long) (driversnote)
8  driversnote             realm::ClusterTree::init_from_parent() (driversnote)
9  driversnote             realm::Table::init(unsigned long, realm::ArrayParent*, unsigned long, bool, bool) (driversnote)
10 driversnote             realm::Group::create_table_accessor(unsigned long) (driversnote)
11 driversnote             realm::Group::do_get_table(unsigned long) (driversnote)
12 driversnote             realm::ObjectSchema::ObjectSchema(realm::Group const&, realm::StringData, realm::TableKey) (driversnote)
13 driversnote             realm::ObjectStore::schema_from_group(realm::Group const&) (driversnote)
14 driversnote             realm::Realm::read_schema_from_group_if_needed() (driversnote)
15 driversnote             realm::Realm::Realm(realm::Realm::Config, realm::util::Optional<realm::VersionID>, std::__1::shared_ptr<realm::_impl::RealmCoordinator>, realm::Realm::MakeSharedTag) (driversnote)
16 driversnote             realm::Realm::make_shared_realm(realm::Realm::Config, realm::util::Optional<realm::VersionID>, std::__1::shared_ptr<realm::_impl::RealmCoordinator>) (driversnote)
17 driversnote             realm::_impl::RealmCoordinator::do_get_realm(realm::Realm::Config, std::__1::shared_ptr<realm::Realm>&, realm::util::Optional<realm::VersionID>, realm::util::CheckedUniqueLock&) (driversnote)
18 driversnote             realm::_impl::RealmCoordinator::get_realm(realm::Realm::Config, realm::util::Optional<realm::VersionID>) (driversnote)
19 driversnote             realm::Realm::get_shared_realm(realm::Realm::Config) (driversnote)
20 driversnote             realm::js::RealmClass<realm::jsc::Types>::create_shared_realm(OpaqueJSContext const*, realm::Realm::Config, bool, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, realm::js::Protected<OpaqueJSValue const*>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, realm::js::Protected<OpaqueJSValue const*> > > >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, realm::js::Protected<OpaqueJSValue const*>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, realm::js::Protected<OpaqueJSValue const*> > > > > > >&&, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, realm::js::Protected<OpaqueJSValue*>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, realm::js::Protected<OpaqueJSValue*> > > >&&) (driversnote)
21 driversnote             realm::js::RealmClass<realm::jsc::Types>::constructor(OpaqueJSContext const*, OpaqueJSValue*, realm::js::Arguments<realm::jsc::Types>&) (driversnote)
22 driversnote             realm::jsc::ObjectWrap<realm::js::RealmClass<realm::jsc::Types> >::construct(OpaqueJSContext const*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) (driversnote)
23 JavaScriptCore          JSC::JSCallbackObject<JSC::JSNonFinalObject>::constructImpl(JSC::JSGlobalObject*, JSC::CallFrame*)
24 JavaScriptCore          JSC::LLInt::setUpCall(JSC::CallFrame*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*)
25 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
26 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
27 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
28 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
29 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
30 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
31 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
32 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
33 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
34 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
35 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
36 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
37 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
38 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
39 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
40 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
41 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
42 JavaScriptCore          _vmEntryToJavaScriptTrampoline
43 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
44 JavaScriptCore          JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*)
45 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
46 JavaScriptCore          _vmEntryToJavaScriptTrampoline
47 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
48 JavaScriptCore          JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*)
49 JavaScriptCore          _vmEntryToNative
50 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
51 JavaScriptCore          JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
52 JavaScriptCore          _JSObjectCallAsFunction
53 driversnote             call (JSCRuntime.cpp:1260:14)
54 driversnote             call (jsi-inl.h:228:18)
55 driversnote             operator() (functional:1885:16)
56 driversnote             operator() (functional:1885:16)
57 driversnote             tryFunc (RCTMessageThread.mm:69:20)
58 driversnote             operator() (functional:1885:16)
59 CoreFoundation          ___CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__
60 CoreFoundation          ___CFRunLoopDoBlocks
61 CoreFoundation          ___CFRunLoopRun
62 CoreFoundation          _CFRunLoopRunSpecific
63 driversnote             +[RCTCxxBridge runRunLoop] (RCTCxxBridge.mm:324:12)
64 Foundation              ___NSThread__start__
65 libsystem_pthread.dylib __pthread_start
CrashReporter Key:  6f05378ed065c91f17d072b3ceac8112eb6cac6b
Hardware Model:     iPhone14,3
Process:            driversnote
Identifier:         com.driversnote.driversnote
Version:            4.4.1
Role:               Background
OS Version:         iOS 15.4.1

SIGABRT: 

0  libsystem_kernel.dylib  ___pthread_kill
1  libsystem_pthread.dylib _pthread_kill
2  libsystem_c.dylib       _abort
3  driversnote             please_report_this_issue_in_github_realm_realm_core (driversnote)
4  driversnote             realm::util::terminate_internal(std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) (driversnote)
5  driversnote             realm::util::terminate(char const*, char const*, long, std::initializer_list<realm::util::Printable>&&) (driversnote)
6  driversnote             realm::StringData realm::Obj::_get<realm::StringData>(realm::ColKey::Idx) const (driversnote)
7  driversnote             OpaqueJSValue const* realm::Object::get_property_value_impl<OpaqueJSValue const*, realm::js::NativeAccessor<realm::jsc::Types> >(realm::js::NativeAccessor<realm::jsc::Types>&, realm::Property const&) const (driversnote)
8  driversnote             realm::js::RealmObjectClass<realm::jsc::Types>::get_property(OpaqueJSContext const*, OpaqueJSValue*, realm::js::String<realm::jsc::Types> const&, realm::js::ReturnValue<realm::jsc::Types>&) (driversnote)
9  driversnote             OpaqueJSValue const* realm::js::wrap<&realm::js::RealmObjectClass<realm::jsc::Types>::get_property>(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSString*, OpaqueJSValue const**) (driversnote)
10 JavaScriptCore          JSC::JSCallbackObject<JSC::JSNonFinalObject>::callImpl(JSC::JSGlobalObject*, JSC::CallFrame*)
11 JavaScriptCore          _vmEntryToNative
12 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
13 JavaScriptCore          JSC::GetterSetter::callGetter(JSC::JSGlobalObject*, JSC::JSValue)
14 JavaScriptCore          JSC::LLInt::performLLIntGetByID(JSC::Instruction const*, JSC::CodeBlock*, JSC::JSGlobalObject*, JSC::JSValue, JSC::Identifier const&, JSC::GetByIdModeMetadata&)
15 JavaScriptCore          _llint_slow_path_get_by_id
16 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
17 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
18 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
19 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
20 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
21 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
22 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
23 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
24 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
25 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
26 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
27 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
28 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
29 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
30 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
31 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
32 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
33 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
34 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
35 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
36 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
37 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
38 JavaScriptCore          _vmEntryToJavaScriptTrampoline
39 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
40 JavaScriptCore          JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*)
41 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
42 JavaScriptCore          _vmEntryToJavaScriptTrampoline
43 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
44 JavaScriptCore          JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*)
45 JavaScriptCore          _vmEntryToNative
46 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
47 JavaScriptCore          JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
48 JavaScriptCore          _JSObjectCallAsFunction
49 driversnote             call (JSCRuntime.cpp:1260:14)
50 driversnote             call (jsi-inl.h:228:18)
51 driversnote             operator() (functional:1885:16)
52 driversnote             operator() (functional:1885:16)
53 driversnote             tryFunc (RCTMessageThread.mm:69:20)
54 driversnote             operator() (functional:1885:16)
55 CoreFoundation          ___CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__
56 CoreFoundation          ___CFRunLoopDoBlocks
57 CoreFoundation          ___CFRunLoopRun
58 CoreFoundation          _CFRunLoopRunSpecific
59 driversnote             +[RCTCxxBridge runRunLoop] (RCTCxxBridge.mm:324:12)
60 Foundation              ___NSThread__start__
61 libsystem_pthread.dylib __pthread_start
CrashReporter Key:  7c40561d7a04681124cc302542e771933332e46a
Hardware Model:     iPhone9,2
Process:            driversnote
Identifier:         com.driversnote.driversnote
Version:            4.4.1
Role:               Background
OS Version:         iOS 15.3.1

SIGABRT: 

0  libsystem_kernel.dylib  ___pthread_kill
1  libsystem_pthread.dylib _pthread_kill
2  libsystem_c.dylib       _abort
3  driversnote             please_report_this_issue_in_github_realm_realm_core (driversnote)
4  driversnote             realm::util::terminate_internal(std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) (driversnote)
5  driversnote             realm::util::terminate(char const*, char const*, long, std::initializer_list<realm::util::Printable>&&) (driversnote)
6  driversnote             realm::Spec::init(realm::MemRef) (driversnote)
7  driversnote             realm::Spec::init(unsigned long) (driversnote)
8  driversnote             realm::Table::init(unsigned long, realm::ArrayParent*, unsigned long, bool, bool) (driversnote)
9  driversnote             realm::Group::create_table_accessor(unsigned long) (driversnote)
10 driversnote             realm::Group::do_get_table(realm::StringData) (driversnote)
11 driversnote             realm::ObjectStore::get_schema_version(realm::Group const&) (driversnote)
12 driversnote             realm::Realm::read_schema_from_group_if_needed() (driversnote)
13 driversnote             realm::Realm::Realm(realm::Realm::Config, realm::util::Optional<realm::VersionID>, std::__1::shared_ptr<realm::_impl::RealmCoordinator>, realm::Realm::MakeSharedTag) (driversnote)
14 driversnote             realm::Realm::make_shared_realm(realm::Realm::Config, realm::util::Optional<realm::VersionID>, std::__1::shared_ptr<realm::_impl::RealmCoordinator>) (driversnote)
15 driversnote             realm::_impl::RealmCoordinator::do_get_realm(realm::Realm::Config, std::__1::shared_ptr<realm::Realm>&, realm::util::Optional<realm::VersionID>, realm::util::CheckedUniqueLock&) (driversnote)
16 driversnote             realm::_impl::RealmCoordinator::get_realm(realm::Realm::Config, realm::util::Optional<realm::VersionID>) (driversnote)
17 driversnote             realm::Realm::get_shared_realm(realm::Realm::Config) (driversnote)
18 driversnote             realm::js::RealmClass<realm::jsc::Types>::create_shared_realm(OpaqueJSContext const*, realm::Realm::Config, bool, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, realm::js::Protected<OpaqueJSValue const*>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, realm::js::Protected<OpaqueJSValue const*> > > >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, realm::js::Protected<OpaqueJSValue const*>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, realm::js::Protected<OpaqueJSValue const*> > > > > > >&&, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, realm::js::Protected<OpaqueJSValue*>, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, realm::js::Protected<OpaqueJSValue*> > > >&&) (driversnote)
19 driversnote             realm::js::RealmClass<realm::jsc::Types>::constructor(OpaqueJSContext const*, OpaqueJSValue*, realm::js::Arguments<realm::jsc::Types>&) (driversnote)
20 driversnote             realm::jsc::ObjectWrap<realm::js::RealmClass<realm::jsc::Types> >::construct(OpaqueJSContext const*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) (driversnote)
21 JavaScriptCore          JSC::JSCallbackObject<JSC::JSNonFinalObject>::constructImpl(JSC::JSGlobalObject*, JSC::CallFrame*)
22 JavaScriptCore          JSC::LLInt::setUpCall(JSC::CallFrame*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*)
23 JavaScriptCore          _llint_entry
24 JavaScriptCore          _llint_entry
25 JavaScriptCore          _llint_entry
26 JavaScriptCore          _llint_entry
27 JavaScriptCore          _llint_entry
28 JavaScriptCore          _llint_entry
29 JavaScriptCore          _llint_entry
30 JavaScriptCore          _llint_entry
31 JavaScriptCore          _llint_entry
32 JavaScriptCore          _llint_entry
33 JavaScriptCore          _llint_entry
34 JavaScriptCore          _llint_entry
35 JavaScriptCore          _llint_entry
36 JavaScriptCore          _llint_entry
37 JavaScriptCore          _llint_entry
38 JavaScriptCore          _llint_entry
39 JavaScriptCore          _llint_entry
40 JavaScriptCore          _vmEntryToJavaScript
41 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
42 JavaScriptCore          JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*)
43 JavaScriptCore          _llint_entry
44 JavaScriptCore          _vmEntryToJavaScript
45 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
46 JavaScriptCore          JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*)
47 JavaScriptCore          _vmEntryToNative
48 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
49 JavaScriptCore          JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
50 JavaScriptCore          _JSObjectCallAsFunction
51 driversnote             call (JSCRuntime.cpp:1260:14)
52 driversnote             call (jsi-inl.h:228:18)
53 driversnote             operator() (functional:1885:16)
54 driversnote             operator() (functional:1885:16)
55 driversnote             tryFunc (RCTMessageThread.mm:69:20)
56 driversnote             operator() (functional:1885:16)
57 CoreFoundation          ___CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__
58 CoreFoundation          ___CFRunLoopDoBlocks
59 CoreFoundation          ___CFRunLoopRun
60 CoreFoundation          _CFRunLoopRunSpecific
61 driversnote             +[RCTCxxBridge runRunLoop] (RCTCxxBridge.mm:324:12)
62 Foundation              ___NSThread__start__
63 libsystem_pthread.dylib __pthread_start
tomduncalf commented 2 years ago

Hi @martinpoulsen, thanks for all the details. We are doing some investigation into this issue right now.

Are you able to share more information about what your app is doing when it receives a location event? If you have some sample code for how you are handling this, that would be interesting.

Our prime suspect is that the app's data could be being encrypted by iOS when it goes into the background, then when it tries to interact with the Realm in the background, the (still open) Realm is reading OS-encrypted data rather than what it expects, and so crashes in seemingly random places – because it is receiving garbage data, essentially. The Realm Swift docs talk about this encryption issue.

However, I created a simple test app which is woken from the background via a silent push notification (this seemed like it would be easier to test than location) and writes and reads from the Realm when it is awoken, and I haven't seen any issues so far. If you can share a bit more about what your app is doing when awoken, then we can try to simulate a more realistic workload. I can also try using location instead of push notification, in case this has any bearing on how iOS behaves – if you have tips on how best to test location events, that would save me some research!

martinpoulsen commented 2 years ago

Hi @tomduncalf, happy to hear you are investigating this issue πŸ™

Essentially, what our app does is tracking trips for our users for mileage reimbursement purposes. When resumed or woken up by a location (or an iBeacon or a geofence) it decides whether it should be record as part of a trip. If that's the case (i.e. the user is currently tracking a trip), it will be stored on a Trip realm model which has a route property (i.e. a list of locations). However, if the app is not initialized when receiving the location, it will first instantiate a Realm instance for the user - we do this only in the app launch flow.

One thing that seems important when talking about reproducing the crashes is that they are not evenly distributed across our users. It is "only" affecting ~ 2% of our iOS users (and no Android users) but those 2% experience enough crashes that our session stability is down from ~ 99% to ~ 90% across all iOS users. So unfortunately that might mean that it's hard to reproduce the crashes in a basic sample app. Btw, the users we have been in contact with and who have been hit by these crashes were able to get rid of them by deleting => reinstalling the app.

About the iOS file encryption, I'm wondering how that suddenly could start causing this magnitude of crashes after upgrading Realm from v. 10.10.1 => 10.13.0 (and still seeing them in v. 10.16.0) while seeing them very rarely before the upgrade.

I will continue to try and reproduce the crashes and also keep looking for patterns giving some clue about the cause.

tomduncalf commented 2 years ago

Thanks for the additional details @martinpoulsen, indeed that does make the iOS encryption thing seem a little less likely, though there could be some weird interaction of things. We're looking into what changed in Realm core between those versions but are yet to find anything suspicious.

Are you using encrypted Realms?

tomduncalf commented 2 years ago

One other question, when you say "seeing them very rarely before the upgrade" – were you seeing these crashes in some smaller volume before the upgrade, or not at all?

martinpoulsen commented 2 years ago

Hi @tomduncalf thanks again for looking into this!

We are not using encrypted realms.

And sorry for being vague about whether we have seen the errors before. It's only recently that we got the native side of iOS crash report stack traces symbolicated in our error reporting setup using Bugsnag (we did this when we recently saw a massive increase in iOS native crashes). We do have some SIGABRT crash reports from older app versions, but we don't know if they come from Realm. At least they are very infrequent.

I have now setup symbolication for the most recent build before the Realm upgrade so for future crashes from that app version, we will know - and I will make sure to update you on that.

tomduncalf commented 2 years ago

Got it, no worries @martinpoulsen and thanks for confirming re: encryption. We're continuing to investigate as a priority, so I will keep you udpated and let you know if we have any other questions.

tomduncalf commented 2 years ago

@martinpoulsen Are you able to confirm if the realm::KeyNotFound errors all have different error messages, or are there clusters of similar messages? If you could supply a screenshot/copy of a sampling of them that would be interesting.

It looks like the realm::NoSuchTable errors don't have any specific data in the error message, just a generic error, but if you could validate that too it would be great!

tomduncalf commented 2 years ago

Also, if it's easy for you to supply some more stack traces (for any of the errors), that would be great so I can see if I can spot any patterns – if it's not convenient to do so via Github then you can email to realm-help@mongodb.com

tomduncalf commented 2 years ago

One other question @martinpoulsen, are you using Realm Sync?

tomduncalf commented 2 years ago

Sorry for the bombardment of messages @martinpoulsen, I'm asking questions as I think of them so I hope you don't mind! Are the users who hit this issue then unable to open your app at all? Or is it an intermittent issue (i.e. they get some crashes but can sometimes open the app fine)?

And do you see any crash logs for starting with Unable to open realm or Unable to open a realm? (This would indicate that the Realm is corrupted when we tried to open it)

martinpoulsen commented 2 years ago

@tomduncalf, I'm more than happy to assist in any way I can to get these issues resolved, please keep asking anything that could be useful!

The KeyNotFound and NoSuchTable seem to me to have pretty consistent stack traces. However, the KeyNotFound has been observed with at least two different realm models (RoutePoint and LogItem). I can confirm that the NoSuchTable error does not contain any specific error message in any of the stack traces that I've seen.

The SIGABRT crash looks more varying in its stack trace and so does a EXC_BAD_ACCESS crash which is about as frequent as KeyNotFound/NoSuchTable.

I have attached a sample of 10 stack traces for each of the crashes in the bottom. If it's helpful with a larger sample, just let me know. We would also be happy to give you access to our Bugsnag error reporting tool - again, just let me know.

We are not using Realm Sync, only a local database.

One thing I thought of mentioning is that we have two realm database instances running at all times - one for some global state (e.g. to keep track of currently logged in user) and one for user data (trips, etc).

I see very few errors with the Unable to open (a) realm message - around 1 per day (while the SIGABRT crash occurred almost 10.000 times the last 24 hours).

The few users we have been contacted by have experienced frequent crashes but not consistently in a way where they can never open the app. The breadcrumbs of the error reports supports this - the crashes are sometimes early in a session but usually not immediately when we create the realm instance. In many cases it happens when accessing realm to read/write at (for now) seemingly random times.

EXC_BAD_ACCESS_1.txt EXC_BAD_ACCESS_2.txt EXC_BAD_ACCESS_3.txt EXC_BAD_ACCESS_4.txt EXC_BAD_ACCESS_5.txt EXC_BAD_ACCESS_6.txt EXC_BAD_ACCESS_7.txt EXC_BAD_ACCESS_8.txt EXC_BAD_ACCESS_9.txt EXC_BAD_ACCESS_10.txt KeyNotFound_1.txt KeyNotFound_2.txt KeyNotFound_3.txt KeyNotFound_4.txt KeyNotFound_5.txt KeyNotFound_6.txt KeyNotFound_7.txt KeyNotFound_8.txt KeyNotFound_9.txt KeyNotFound_10.txt NoSuchTable_1.txt NoSuchTable_2.txt NoSuchTable_3.txt NoSuchTable_4.txt NoSuchTable_5.txt NoSuchTable_6.txt NoSuchTable_7.txt NoSuchTable_8.txt NoSuchTable_9.txt NoSuchTable_10.txt SIGABRT_1.txt SIGABRT_2.txt SIGABRT_3.txt SIGABRT_4.txt SIGABRT_5.txt SIGABRT_6.txt SIGABRT_7.txt SIGABRT_8.txt SIGABRT_9.txt SIGABRT_10.txt

tomduncalf commented 2 years ago

Thanks for all the details and crash reports @martinpoulsen, that's really useful. I think this is plenty to go on, but if we determine that having access to your bug reporting tool would be useful we will let you know, thanks for the offer!

In the interim, I would suggest you advise users who have the issue to reinstall the app – is all your data being synced to your server by some other means so users should not lose data?

Do you know if you've had any incidences of users who have had to uninstall and reinstall hitting this same problem for a second time? Especially users who reinstalled a version of your app which uses Realm v10.16.0.

tomduncalf commented 2 years ago

A related question, are you aware of any new users who started with the latest version of your app (i.e. the one using Realm v10.16.0, rather than upgrading from an older version) hitting this issue? I'm wondering if the issue could be related to an older version of Realm and is now fixed (if the file is created with v10.16.0), or if it is still occurring with v10.16.0

martinpoulsen commented 2 years ago

Thanks @tomduncalf, advicing to reinstall the app is what our support team is currently doing when we get contacted by users who face these crashes - I'm not aware of a case where a user kept seeing the crashes after a reinstall, but we have only been in contact with a relatively small amount of users so far. If I see such a case at some point, I will let you know.

User data is synced to our servers via a custom sync API so luckily a reinstall will not cause loss of data.

Regarding new users (who started with v.10.16.0) facing the crash, this is one of the patterns I'm currently looking into, I will get back to you on that.

martinpoulsen commented 2 years ago

Btw, since adding symbolication yesterday for the most recent app version before we upgraded realm (back then we were on v. 10.10.1) a single crash has been reported and it turned out to be a realm native one:

CrashReporter Key:  5f043bc92fd4affaa90fe8f8d2f4fc19831c0d33
Hardware Model:     iPhone13,2
Process:            driversnote
Identifier:         com.driversnote.driversnote
Version:            4.3.2
Role:               Background
OS Version:         iOS 15.3.1
Exception Type:     EXC_BAD_ACCESS 
Exception Subtype:  KERN_INVALID_ADDRESS

EXC_BAD_ACCESS: Attempted to dereference garbage pointer 0x118.

0  driversnote             std::__1::__hash_const_iterator<std::__1::__hash_node<std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, realm::js::String<realm::jsc::Types>*>, void*>*> std::__1::__hash_table<std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, realm::js::String<realm::jsc::Types>*>, std::__1::__unordered_map_hasher<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, realm::js::String<realm::jsc::Types>*>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, true>, std::__1::__unordered_map_equal<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, realm::js::String<realm::jsc::Types>*>, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, true>, std::__1::allocator<std::__1::__hash_value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, realm::js::String<realm::jsc::Types>*> > >::find<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const (driversnote)
1  driversnote             realm::jsc::get_cached_property_name(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) (driversnote)
2  driversnote             realm::jsc::ObjectWrap<realm::js::RealmObjectClass<realm::jsc::Types> >::get_internal(OpaqueJSContext const*, OpaqueJSValue* const&) (driversnote)
3  driversnote             realm::js::RealmObjectClass<realm::jsc::Types>::get_property(OpaqueJSContext const*, OpaqueJSValue*, realm::js::String<realm::jsc::Types> const&, realm::js::ReturnValue<realm::jsc::Types>&) (driversnote)
4  driversnote             OpaqueJSValue const* realm::js::wrap<&realm::js::RealmObjectClass<realm::jsc::Types>::get_property>(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSString*, OpaqueJSValue const**) (driversnote)
5  JavaScriptCore          JSC::JSCallbackObject<JSC::JSNonFinalObject>::callImpl(JSC::JSGlobalObject*, JSC::CallFrame*)
6  JavaScriptCore          _vmEntryToNative
7  JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
8  JavaScriptCore          JSC::GetterSetter::callGetter(JSC::JSGlobalObject*, JSC::JSValue)
9  JavaScriptCore          JSC::LLInt::performLLIntGetByID(JSC::Instruction const*, JSC::CodeBlock*, JSC::JSGlobalObject*, JSC::JSValue, JSC::Identifier const&, JSC::GetByIdModeMetadata&)
10 JavaScriptCore          _llint_slow_path_get_by_id
11 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
12 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
13 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
14 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
15 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
16 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
17 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
18 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
19 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
20 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
21 JavaScriptCore          _vmEntryToJavaScriptTrampoline
22 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
23 JavaScriptCore          JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*)
24 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
25 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
26 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
27 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
28 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
29 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
30 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
31 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
32 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
33 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
34 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
35 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
36 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
37 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
38 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
39 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
40 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
41 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
42 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
43 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
44 JavaScriptCore          _vmEntryToJavaScriptTrampoline
45 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
46 JavaScriptCore          JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*)
47 JavaScriptCore          _llint_function_for_construct_arity_checkTagGateAfter
48 JavaScriptCore          _vmEntryToJavaScriptTrampoline
49 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
50 JavaScriptCore          JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*)
51 JavaScriptCore          _vmEntryToNative
52 JavaScriptCore          JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
53 JavaScriptCore          JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
54 JavaScriptCore          _JSObjectCallAsFunction
55 driversnote             call (JSCRuntime.cpp:1260:14)
56 driversnote             call (jsi-inl.h:228:18)
57 driversnote             operator() (JSIExecutor.cpp:256:50)
58 driversnote             __invoke<void (*&)(const std::function<void ()> &, std::function<std::string ()>), const std::function<void ()> &, std::function<std::string ()> > (type_traits:3694:1)
59 driversnote             operator() (functional:1885:16)
60 driversnote             operator() (functional:1885:16)
61 driversnote             operator() (functional:1885:16)
62 driversnote             tryFunc (RCTMessageThread.mm:69:20)
63 driversnote             operator() (functional:1885:16)
64 CoreFoundation          ___CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__
65 CoreFoundation          ___CFRunLoopDoBlocks
66 CoreFoundation          ___CFRunLoopRun
67 CoreFoundation          _CFRunLoopRunSpecific
68 driversnote             +[RCTCxxBridge runRunLoop] (RCTCxxBridge.mm:324:12)
69 Foundation              ___NSThread__start__
70 libsystem_pthread.dylib __pthread_start
tomduncalf commented 2 years ago

Thanks @martinpoulsen, that would be interesting to know.

Thanks for your patience while we investigate this, it's obviously a tricky one until we find a way to reproduce it but we are actively investigating!

martinpoulsen commented 2 years ago

@tomduncalf we're just really happy that you are working on this! - and we know very well how hard it is to investigate issues without knowing a consistent way to reproduce πŸ˜…

martinpoulsen commented 2 years ago

Hi again @tomduncalf I have looked at a sample of 200 SIGABRT crashes and made some observations:

It appears that there is a pattern of users being less likely to get the crash if they created their Realm db with 10.13.0 and much less likely if they created it with 10.16.0. Our app realm version release timeline looks like this:

Looking at the signup time of the users behind the 200 crash reports, it seems there are fewer than expected who signed up between April 1. and April 21. (where Realm was created with 10.13.0) - and much fewer than expected (none in the sample) created after April 21. (where Realm was created with 10.16.0). I'm comparing against a significant amount of users who signed up in March, February, January, etc:

image

I will increase the sample size and see if the pattern still holds.

tomduncalf commented 2 years ago

Thanks for your investigation @martinpoulsen, that is indeed very interesting. I'll focus my testing in on what happens when a Realm gets upgraded from 10.10.1 to 10.16.0 and let you know if I find anything

tomduncalf commented 2 years ago

@martinpoulsen Is there any pattern to the devices which are experiencing issues or is it a cross section of all iOS devices?

martinpoulsen commented 2 years ago

@tomduncalf they seem pretty distributed across devices, here's the device distribution for the SIGABRT crash:

image
martinpoulsen commented 2 years ago

@tomduncalf here's the OS version distribution for the SIGABRT crash:

image
martinpoulsen commented 2 years ago

@tomduncalf I now looked at ~450 users who got the SIGABRT crash. The pattern seems to still hold up pretty well. Only a single user in this sample signed up using (and only ever used) the most recent app version (which includes Realm 10.16.0) - this user has experienced both the SIGABRT crash and the EXC_BAD_ACCESS crash.

This is the user creation date of the of the sample:

image
tomduncalf commented 2 years ago

Thanks @martinpoulsen!

I'm wondering if the "app was in background when it happened" element is a useful clue, or irrelevant... does your app frequently write to Realm when it's in the foreground too, or would the normal use case be with it in the background?

martinpoulsen commented 2 years ago

@tomduncalf it's not rare that the app writes to Realm while in foreground - e.g. when updating recorded trips (every trip is usually edited one or more times) or when the user creates trips by means of just inputting start/stop location rather than tracking GPS data. But most frequently we write GPS data to realm while the app is in the background, so I'm not sure if it's just a coincidence that the reports I have seen mostly happens in background.

I will follow up and investigate this more closely.

martinpoulsen commented 1 year ago

Hi @tomduncalf,

I have indexed the crash reports on whether the app is in foreground/background and they happen during app launch.

SIGABRT crash foreground/background distribution:

SIGABRT_foreground

SIGABRT crash distribution on whether the app is launching:

SIGABRT_launch

The other crashes look similar in distribution though the relative amount of crashes in foreground is a little bit higher for realm::NoSuchTable / realm::KeyNotFound (around 1.5%).

In case it's interesting, here are a few stack traces from the SIGABRT crash while the app is in the foreground:

SIGABRT_foreground_1.txt SIGABRT_foreground_2.txt SIGABRT_foreground_3.txt

tomduncalf commented 1 year ago

Thanks @martinpoulsen – seems like a pretty strong correlation there! I wonder if there's anything else that the cohort of users who are experiencing this issue have in common – for example are they all in the same country? Might sound weird but I've dealt with some really strange issues in my time and country was part of the cause of one so I never rule anything out, haha

martinpoulsen commented 1 year ago

Hi @tomduncalf.

I have also been wondering about what those users who experience the crashes could have in common but haven't found anything yet. The distribution of countries match our relative presence in those markets:

country_distribution

Btw, I am now looking at all ~850 users who experienced the SIGABRT crash. The pattern that these users primarily started using Realm 10.10.1 or earlier still holds. Here is the nr of affected users by signup week (notice that not a single user who signed up in May is affected):

user_signup_per_week
cristianoccazinsp commented 1 year ago

Leaving some comments here to be updated of progress as we have similar issues with random crashes in background and foreground, or even corrupted realm instances. However, we are using the beta/hermes version.

0x079 commented 1 year ago

@martinpoulsen Thank you for providing all the information. Did you end up working around this issue? Does upgrade work? I'm wondering if we should upgrade to v10.19.5.

martinpoulsen commented 1 year ago

@0x079 We still face this issue and haven't found a way to work around it besides telling our iOS customers who contact us about the crash that they need to delete and reinstall our app. We haven't tried upgrading Realm version recently.

martinpoulsen commented 1 year ago

@tomduncalf just wanted to let you know that we have observed several instances of these crashes for users who only used the app with realm v. 10.16.0. There certainly seems to be a correlation between getting these crashes and going through a realm version migration, but it doesn't seem to be a necessary condition.

tomduncalf commented 1 year ago

Thanks for the update @martinpoulsen and I'm sorry to hear you are still having issues. I'm going to discuss this with the team again in light of that information, I'm afraid we didn't make any progress on tracking down the root cause so far.

Pingou commented 1 year ago

Do we know how prevalent this issue is? The majority of our users are long term users and started with an older version of realm, I am scared to upgrade on iOS. @martinpoulsen could you confirm that the crashes only happen when app is in the background?

tomduncalf commented 1 year ago

@Pingou we've not had any other reports of this exact issue.

We are aware of a few reports which seem related to memory leaks or crashes related to accessing freed memory, the ones we are tracking are:

The difficulty with all of these has been that they are relatively very rare, and we have been unable to reproduce them – we've tried various approaches to stress testing Realm JS and have not been successful. Also note that some of these are quite old and could have been fixed, but we are unable to prove that.

Our upcoming Hermes release changes quite a few things related to object ownership etc. in our C++ layer, so we hope should solve many such issues.

In the case of Martin's issue, we are not sure exactly what the cause is and again have not been able to reproduce it despite stress testing opening a Realm JS app in the background repeatedly, upgrading Realm between various versions etc.

This is something we are still investigating, obviously any crashes are a concern for us, but what I would say is that the volume of reports of such crashes is very low compared to the number of users we have. This issue is the first one that I am aware of where there has been any hypothetical link to Realm upgrades causing issues, and we've so far not been able to prove that.

Pingou commented 1 year ago

@tomduncalf Hi Tom, thank you very much for the detailed reply.

martinpoulsen commented 1 year ago

@Pingou 99.5% of these issues happen in the background in our case (see my update in this issue from May 23). But our app will continuously try to launch itself if terminated so that might be the reason why so many of the crashes happen while in background.

tomduncalf commented 1 year ago

@martinpoulsen Could you elaborate a little on what you mean by

But our app will continuously try to launch itself if terminated so that might be the reason why so many of the crashes happen while in background.

please?

martinpoulsen commented 1 year ago

@tomduncalf sure, our app is (under certain configurations) aiming to be active at all times to monitor the activity of the user (specifically to detect whether the user is driving). This includes launching itself from process death. So what happens for some of our users with these realm issues is that the app get's stuck in a loop where it crashes during app startup every time it tries to launch itself.

tomduncalf commented 1 year ago

Ah OK, how do you go about reopening the app when it has been terminated?

martinpoulsen commented 1 year ago

We are listening for various events such as location updates, phone movements, power source change and iBeacon region state changes which will launch the app if terminated before the event gets delivered.

tomduncalf commented 1 year ago

Ahh I see, thanks!

kneth commented 1 year ago

@martinpoulsen Related to iBeacon, the trick mentioned in https://github.com/realm/realm-core/issues/5731#issuecomment-1224285742 might help you. We are considering adding a configuration option to do it so you don't have to deal with Objective C or Swift code.