-
Notifications
You must be signed in to change notification settings - Fork 577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS - Still receiving EXC_BAD_ACCESS when the app is being terminated #4473
Comments
@cristianoccazinsp Thank you for reporting. The line |
I am also having this issue while using 10.14.0.
|
Some additional crash traces, we continue to get this issue in version
|
Thanks @cristianoccazinsp, just to confirm is this just when the app is being terminated? |
@tomduncalf yes, this seems to be happening every time the app is about to be terminated, and is probably not visible to the user, but it causes a lot of noise in the crash reporting tool and even own Apple's crash statistics. |
OK thanks @cristianoccazinsp, we'll schedule some investigation into this one |
Here's a slightly different stack trace for the same issue that was reported today. Also right before the app was terminated while in background.
|
It certainly looks like some kind of memory (de)allocation bug. We'll see if we can repro it and track down the cause, sorry about that! |
As mentioned in #2828, upgrade to a version >= 11.0.0. If the problem persists please create a new issue. |
Description
This is related to #3112 and #2828 and has been observed since day 1 using RealmJS. Although there are different stack traces, and sometimes it may not even be Realm at all but a crash in JSC/Facebook code, I'm opening this one more time to see if the issue can be found.
In short, when the app goes to background and is getting terminated, native JSC pointer access seem to crash the entire app due to some null/memory checks missing, or freed-up memory being accessed. Even though Realm does not always appear in the stack trace, it may still be related to how it integrates itself with the JSC runtime.
Note that this happens since the beginning of times, but the current version reported is
10.20.0-beta.3
on iOS with Hermes disabled.Stacktrace & log output
The following are various crash stack traces, all with the same behaviour where the app is in background and being terminated:
Other crash, similar behaviour:
The same crashes are reported as follows within XCode's crash reporting, in which Realm code appears:
{code}
#0 (null) in std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, facebook::jsi::Function, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const, facebook::jsi::Function> > >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, facebook::jsi::Function, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const, facebook::jsi::Function> > > > > >::operator[]+ 2640948 (std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) ()
#1 (null) in std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, facebook::jsi::Function, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const, facebook::jsi::Function> > >, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const, std::__1::unordered_map<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, facebook::jsi::Function, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const, facebook::jsi::Function> > > > > >::operator[]+ 2640872 (std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) ()
#2 (null) in realm::js::realmjsi::ObjectWrap<realm::js::RealmObjectClassrealm::js::realmjsi::Types >::create_instance_by_schema+ 2637120 (realm::js::JsiEnv, realm::js::JsiFunc*, realm::ObjectSchema const&, realm::js::RealmObjectrealm::js::realmjsi::Types) ()
#3 (null) in realm::js::RealmObjectClassrealm::js::realmjsi::Types::create_instance+ 2629088 (realm::js::JsiEnv, realm::js::RealmObjectrealm::js::realmjsi::Types) ()
#4 (null) in realm::js::RealmClassrealm::js::realmjsi::Types::object_for_primary_key+ 2624760 (realm::js::JsiEnv, realm::js::JsiObj, realm::js::Argumentsrealm::js::realmjsi::Types&, realm::js::ReturnValuerealm::js::realmjsi::Types&) ()
#5 (null) in facebook::jsi::Value realm::js::wrap<&(realm::js::RealmClassrealm::js::realmjsi::Types::object_for_primary_key(realm::js::JsiEnv, realm::js::JsiObj, realm::js::Argumentsrealm::js::realmjsi::Types&, realm::js::ReturnValuerealm::js::realmjsi::Types&))>+ 2432624 (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const, unsigned long) ()
#6 0x00000001041de8dc in std::__1::__function::__value_func<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()(facebook::jsi::Runtime&, face... ()
#7 0x00000001041de8dc in std::__1::function<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()(facebook::jsi::Runtime&, facebook::jsi::Value... ()
#8 0x00000001041de624 in facebook::jsc::JSCRuntime::createFunctionFromHostFunction(facebook::jsi::PropNameID const&, unsigned int, std::__1::function<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value cons... at tmi3/node_modules/react-native/ReactCommon/jsi/JSCRuntime.cpp:1158
#9 (null) in JSC::JSCallbackObjectJSC::JSNonFinalObject::callImpl(JSC::JSGlobalObject*, JSC::CallFrame*) ()
#10 (null) in JSC::LLInt::setUpCall(JSC::CallFrame*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*) ()
#11 (null) in llint_function_for_construct_arity_checkTagGateAfter ()
#12 (null) in llint_function_for_construct_arity_checkTagGateAfter ()
#13 (null) in vmEntryToJavaScriptTrampoline ()
#14 (null) in JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) ()
#15 (null) in JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) ()
#16 (null) in JSObjectCallAsFunction ()
#17 0x00000001041dcad4 in facebook::jsc::JSCRuntime::call(facebook::jsi::Function const&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) at tmi3/node_modules/react-native/ReactCommon/jsi/JSCRuntime.cpp:1260
#18 (null) in realm::js::Functionrealm::js::realmjsi::Types::call+ 2755604 (realm::js::JsiEnv, realm::js::JsiFunc const&, realm::js::JsiObj const&, unsigned long, realm::js::JsiVal const*) ()
#19 (null) in realm::js::RealmClassrealm::js::realmjsi::Types::write+ 2755104 (realm::js::JsiEnv, realm::js::JsiObj, realm::js::Argumentsrealm::js::realmjsi::Types&, realm::js::ReturnValuerealm::js::realmjsi::Types&) ()
#20 (null) in facebook::jsi::Value realm::js::wrap<&(realm::js::RealmClassrealm::js::realmjsi::Types::write(realm::js::JsiEnv, realm::js::JsiObj, realm::js::Argumentsrealm::js::realmjsi::Types&, realm::js::ReturnValuerealm::js::realmjsi::Types&))>+ 2434608 (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) ()
#21 0x00000001041de8dc in std::__1::__function::__value_func<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()(facebook::jsi::Runtime&, face... ()
#22 0x00000001041de8dc in std::__1::function<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()(facebook::jsi::Runtime&, facebook::jsi::Value... ()
#23 0x00000001041de624 in facebook::jsc::JSCRuntime::createFunctionFromHostFunction(facebook::jsi::PropNameID const&, unsigned int, std::__1::function<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value cons... at tmi3/node_modules/react-native/ReactCommon/jsi/JSCRuntime.cpp:1158
#24 (null) in JSC::JSCallbackObjectJSC::JSNonFinalObject::callImpl(JSC::JSGlobalObject*, JSC::CallFrame*) ()
#25 (null) in JSC::LLInt::setUpCall(JSC::CallFrame*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*) ()
#26 (null) in llint_function_for_construct_arity_checkTagGateAfter ()
#27 (null) in llint_function_for_construct_arity_checkTagGateAfter ()
#28 (null) in llint_function_for_construct_arity_checkTagGateAfter ()
#29 (null) in llint_function_for_construct_arity_checkTagGateAfter ()
#30 (null) in llint_function_for_construct_arity_checkTagGateAfter ()
#31 (null) in llint_function_for_construct_arity_checkTagGateAfter ()
#32 (null) in llint_function_for_construct_arity_checkTagGateAfter ()
#33 (null) in llint_function_for_construct_arity_checkTagGateAfter ()
#34 (null) in llint_function_for_construct_arity_checkTagGateAfter ()
#35 (null) in llint_function_for_construct_arity_checkTagGateAfter ()
#36 (null) in llint_function_for_construct_arity_checkTagGateAfter ()
#37 (null) in llint_function_for_construct_arity_checkTagGateAfter ()
#38 (null) in llint_function_for_construct_arity_checkTagGateAfter ()
#39 (null) in llint_function_for_construct_arity_checkTagGateAfter ()
#40 (null) in llint_function_for_construct_arity_checkTagGateAfter ()
#41 (null) in llint_function_for_construct_arity_checkTagGateAfter ()
#42 (null) in llint_function_for_construct_arity_checkTagGateAfter ()
#43 (null) in llint_function_for_construct_arity_checkTagGateAfter ()
#44 (null) in vmEntryToJavaScriptTrampoline ()
#45 (null) in JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) ()
#46 (null) in JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*) ()
#47 (null) in llint_function_for_construct_arity_checkTagGateAfter ()
#48 (null) in llint_function_for_construct_arity_checkTagGateAfter ()
#49 (null) in llint_function_for_construct_arity_checkTagGateAfter ()
#50 (null) in llint_function_for_construct_arity_checkTagGateAfter ()
#51 (null) in llint_function_for_construct_arity_checkTagGateAfter ()
#52 (null) in llint_function_for_construct_arity_checkTagGateAfter ()
#53 (null) in vmEntryToJavaScriptTrampoline ()
#54 (null) in JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) ()
#55 (null) in JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*) ()
#56 (null) in vmEntryToNative ()
#57 (null) in JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) ()
#58 (null) in JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) ()
#59 (null) in JSObjectCallAsFunction ()
#60 0x00000001041dcad4 in facebook::jsc::JSCRuntime::call(facebook::jsi::Function const&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) at tmi3/node_modules/react-native/ReactCommon/jsi/JSCRuntime.cpp:1260
#61 0x00000001041e8d58 in facebook::jsi::Function::call(facebook::jsi::Runtime&, facebook::jsi::Value const*, unsigned long) const at tmi3/node_modules/react-native/ReactCommon/jsi/jsi/jsi-inl.h:228
#62 0x00000001041e8d58 in facebook::jsi::Function::call(facebook::jsi::Runtime&, std::initializer_listfacebook::jsi::Value) const at tmi3/node_modules/react-native/ReactCommon/jsi/jsi/jsi-inl.h:233
#63 0x00000001041e8d58 in facebook::jsi::Value facebook::jsi::Function::call<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::basic_string<char, std::__1::char_traits<c... at tmi3/node_modules/react-native/ReactCommon/jsi/jsi/jsi-inl.h:241
#64 0x00000001041e8bbc in facebook::react::JSIExecutor::callFunction(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::basic_string<char, std::__1::char_traits, st... at tmi3/node_modules/react-native/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp:256
#65 0x00000001041e8bbc in decltype(static_cast<facebook::react::JSIExecutor::callFunction(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::basic_string<char, std::__1::... ()
#66 0x00000001041e8bbc in void std::__1::__invoke_void_return_wrapper<void, true>::__call<facebook::react::JSIExecutor::callFunction(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > cons... ()
#67 0x00000001041e8bbc in std::__1::__function::__alloc_func<facebook::react::JSIExecutor::callFu
The text was updated successfully, but these errors were encountered: