realm-js: [iOS only] Realm crash: EXC_BAD_ACCESS KERN_INVALID_ADDRESS
How frequently does the bug occur?
Sometimes
Description
I have 26 crashes in production precisely like this from 23 different uses. The crashes happened in various stages of the user journey, so I can not pinpoint it to any specific time when my code is interacting with Realm…
One user reported that the app crashes after using it for a long time (the whole day). The app would not open again after the crash. Just deleting and installing would fix the problem. -> This somehow sounds like the database would be corrupt, which would be the only reason to prevent the app from launching again.
Stacktrace & log output
0 MYAPP 0x100b74bd4 realm::js::MixedLink<realm::jsc::Types>::add_strategy(std::__1::shared_ptr<realm::Realm>) + 1544580
1 MYAPP 0x100b93f94 realm::js::NativeAccessor<realm::jsc::Types>::NativeAccessor(OpaqueJSContext const*, std::__1::shared_ptr<realm::Realm>, realm::ObjectSchema const&) + 1672516
2 MYAPP 0x100b9e818 realm::js::RealmObjectClass<realm::jsc::Types>::get_property(OpaqueJSContext const*, OpaqueJSValue*, realm::js::String<realm::jsc::Types> const&, realm::js::ReturnValue<realm::jsc::Types>&) + 1715656
3 MYAPP 0x100b9de08 OpaqueJSValue const* realm::js::wrap<&(realm::js::RealmObjectClass<realm::jsc::Types>::get_property(OpaqueJSContext const*, OpaqueJSValue*, realm::js::String<realm::jsc::Types> const&, realm::js::ReturnValue<realm::jsc::Types>&))>(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSString*, OpaqueJSValue const**) + 1713080
Can you reproduce the bug?
Not yet
Reproduction Steps
None.
Version
10.6.0
What SDK flavour are you using?
Local Database only
Are you using encryption?
No, not using encryption
Platform OS and version(s)
iOS: 14.6.0 & 14.7.1 (nearly 50/50 distribution)
Build environment
"react": "^17.0.1",
"react-native": "^0.64.2",
"realm": "^10.6.0",
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 29 (7 by maintainers)
@taikim8484 Unfortunately I couldn’t find the cause of this crashes so I kinda gave up, it’s effected more than 10k of our user base, but we haven’t received any report regarding this crashes from our users, so I assume user’s are not noticing this crashes as all of them happening in the background. looks like this crash started to appear after upgrading from
10.8.0to10.9.1.Getting same crash reports same as @mklb posted. crash analytics indicates this happens 100% when device states is background.
Realm
v10.9.1React Native0.66.1Crash report
Thanks all for reporting this issue!
We’ve released Realm-JS v10.9.1, which addresses a memory leak in the
add_strategy/remove_strategycode. Please try out the new version and feel free to re-open this issue if you are still seeing the problems above.Hi @kneth could I know how is the issue going? I also faced the same. @N3TC4T do you have any workaround solution or any suspect on this one?
@fronck I have other users with the same crash. Considering the very limited amount of people I released the app to, the fix seems to make the app crash even more than the original bug. Can I rollback to 10.0.3 which was working fine for me, or has the data structure changed? I’d like to avoid #4016, #3913 and #4007.
@fronck I have just released my app with realm 10.9.1 to 1% of iOS users. Have already one user crashing, but in a different place this time, so not sure it is related to this issue and this fix.
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000118
Crashed: com.facebook.react.JavaScript 0 row_counter 0x4a5e18 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 + 2035140 1 row_counter 0x4a5928 realm::jsc::get_cached_property_name(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 2033876 2 row_counter 0x4b8fe8 realm::jsc::ObjectWrap<realm::js::RealmObjectClass<realm::jsc::Types> >::set_internal_property(OpaqueJSContext const*, OpaqueJSValue*&, realm::js::RealmObject<realm::jsc::Types>*) + 2113428 3 row_counter 0x4b7c2c realm::jsc::ObjectWrap<realm::js::RealmObjectClass<realm::jsc::Types> >::create_instance_by_schema(OpaqueJSContext const*, OpaqueJSValue*&, realm::ObjectSchema const&, realm::js::RealmObject<realm::jsc::Types>*) + 2108376 4 row_counter 0x4b7550 realm::js::RealmObjectClass<realm::jsc::Types>::create_instance(OpaqueJSContext const*, realm::js::RealmObject<realm::jsc::Types>) + 2106620 5 row_counter 0x4c79c8 realm::js::NativeAccessor<realm::jsc::Types>::box(realm::Obj) + 2173300 6 row_counter 0x4d2684 realm::js::NativeAccessor<realm::jsc::Types> realm::Results::dispatch<auto realm::Results::get<realm::js::NativeAccessor<realm::jsc::Types> >(realm::js::NativeAccessor<realm::jsc::Types>&, unsigned long)::'lambda'(realm::js::NativeAccessor<realm::jsc::Types>&)>(realm::js::NativeAccessor<realm::jsc::Types>&) const + 2217520 7 row_counter 0x4d2460 realm::js::ResultsClass<realm::jsc::Types>::get_index(OpaqueJSContext const*, OpaqueJSValue*, unsigned int, realm::js::ReturnValue<realm::jsc::Types>&) + 2216972 8 row_counter 0x4cbf80 OpaqueJSValue const* realm::js::wrap<&(realm::js::ResultsClass<realm::jsc::Types>::get_index(OpaqueJSContext const*, OpaqueJSValue*, unsigned int, realm::js::ReturnValue<realm::jsc::Types>&))>(OpaqueJSContext const*, OpaqueJSValue*, unsigned int, OpaqueJSValue const**) + 2191148 9 JavaScriptCore 0x34cb88 JSC::JSCallbackObject<JSC::JSNonFinalObject>::getOwnPropertySlot(JSC::JSObject*, JSC::JSGlobalObject*, JSC::PropertyName, JSC::PropertySlot&) + 348 10 JavaScriptCore 0x34d460 JSC::JSCallbackObject<JSC::JSNonFinalObject>::getOwnPropertySlotByIndex(JSC::JSObject*, JSC::JSGlobalObject*, unsigned int, JSC::PropertySlot&) + 124 11 JavaScriptCore 0xb0cebc llint_slow_path_get_by_val + 4460 12 JavaScriptCore 0x295538 llint_function_for_construct_arity_checkTagGateAfter + 37992 13 JavaScriptCore 0x2ae69c llint_function_for_construct_arity_checkTagGateAfter + 140748 14 JavaScriptCore 0x2ae69c llint_function_for_construct_arity_checkTagGateAfter + 140748 15 JavaScriptCore 0x2ae69c llint_function_for_construct_arity_checkTagGateAfter + 140748 16 JavaScriptCore 0x2ae69c llint_function_for_construct_arity_checkTagGateAfter + 140748 17 JavaScriptCore 0x2ae764 llint_function_for_construct_arity_checkTagGateAfter + 140948 18 JavaScriptCore 0x2ae69c llint_function_for_construct_arity_checkTagGateAfter + 140748 19 JavaScriptCore 0x2ae69c llint_function_for_construct_arity_checkTagGateAfter + 140748 20 JavaScriptCore 0x2ae69c llint_function_for_construct_arity_checkTagGateAfter + 140748 21 JavaScriptCore 0x2ae69c llint_function_for_construct_arity_checkTagGateAfter + 140748 22 JavaScriptCore 0x2ae69c llint_function_for_construct_arity_checkTagGateAfter + 140748 23 JavaScriptCore 0x285b88 vmEntryToJavaScriptTrampoline + 8 24 JavaScriptCore 0x9b8cf0 JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 488 25 JavaScriptCore 0xd1289c JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*) + 668 26 JavaScriptCore 0x2b1604 llint_function_for_construct_arity_checkTagGateAfter + 152884Hey! I’m having the exact same crash log. For me this crash happens when app is woken in background by
BGAppRefreshTask