Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

iOS realm crash on production jsc_value.hpp line 31 #3602

Closed
warety opened this issue Feb 20, 2021 · 13 comments
Closed

iOS realm crash on production jsc_value.hpp line 31 #3602

warety opened this issue Feb 20, 2021 · 13 comments

Comments

@warety
Copy link

warety commented Feb 20, 2021

Goals

Regular use

Expected Results

Regular use

Actual Results

Firebase crashlytics reported the following iOS crash/exception coming from RealmJS. A crash happened when the app was started

crashlog from crashlytics:
Crashed: com.facebook.react.JavaScript
0 JavaScriptCore 0x1b164c548 bool JSC::symbolTableGetJSC::JSGlobalObject(JSC::JSGlobalObject*, JSC::PropertyName, JSC::PropertySlot&) + 88
1 JavaScriptCore 0x1b0e80f14 JSC::JSObject::get(JSC::JSGlobalObject*, JSC::PropertyName) const + 2516
2 JavaScriptCore 0x1b0e80f14 JSC::JSObject::get(JSC::JSGlobalObject*, JSC::PropertyName) const + 2516
3 JavaScriptCore 0x1b0e80490 JSObjectGetProperty + 144
4 PlusCards 0x104f13a6c realm::js::is_object_of_type(OpaqueJSContext const_, OpaqueJSValue const_, realm::js::Stringrealm::jsc::Types) + 31 (jsc_value.hpp:31)
5 PlusCards 0x104f13998 realm::js::Valuerealm::jsc::Types::is_array(OpaqueJSContext const_, OpaqueJSValue const_ const&) + 63 (jsc_value.hpp:63)
6 PlusCards 0x104f5f258 realm::js::RealmClassrealm::jsc::Types::create(OpaqueJSContext const_, OpaqueJSValue_, realm::js::Argumentsrealm::jsc::Types&, realm::js::ReturnValuerealm::jsc::Types&) + 1028 (js_realm.hpp:1028)
7 PlusCards 0x104f59e84 OpaqueJSValue const* realm::js::wrap<&(realm::js::RealmClassrealm::jsc::Types::create(OpaqueJSContext const_, OpaqueJSValue_, realm::js::Argumentsrealm::jsc::Types&, realm::js::ReturnValuerealm::jsc::Types&))>(OpaqueJSContext const_, OpaqueJSValue_, OpaqueJSValue_, unsigned long, OpaqueJSValue const_ const_, OpaqueJSValue const_) + 77 (jsc_return_value.hpp:77)
8 JavaScriptCore 0x1b0e6e85c long long JSC::APICallbackFunction::callJSC::JSCallbackFunction(JSC::JSGlobalObject_, JSC::CallFrame_) + 420
9 JavaScriptCore 0x1b0e238d8 llint_entry + 135240
10 JavaScriptCore 0x1b0e20f68 llint_entry + 124632
11 JavaScriptCore 0x1b0e02648 vmEntryToJavaScript + 248
12 JavaScriptCore 0x1b13b1718 JSC::Interpreter::executeCall(JSC::JSGlobalObject_, JSC::JSObject_, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 444
13 JavaScriptCore 0x1b15971a8 JSC::profiledCall(JSC::JSGlobalObject
, JSC::ProfilingReason, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 168
14 JavaScriptCore 0x1b0e834e0 JSObjectCallAsFunction + 504
15 PlusCards 0x104f5fdbc realm::js::RealmClassrealm::jsc::Types::write(OpaqueJSContext const_, OpaqueJSValue_, realm::js::Argumentsrealm::jsc::Types&, realm::js::ReturnValuerealm::jsc::Types&) + 30 (jsc_function.hpp:30)
16 PlusCards 0x104f5a04c OpaqueJSValue const* realm::js::wrap<&(realm::js::RealmClassrealm::jsc::Types::write(OpaqueJSContext const_, OpaqueJSValue_, realm::js::Argumentsrealm::jsc::Types&, realm::js::ReturnValuerealm::jsc::Types&))>(OpaqueJSContext const_, OpaqueJSValue_, OpaqueJSValue_, unsigned long, OpaqueJSValue const_ const_, OpaqueJSValue const_) + 77 (jsc_return_value.hpp:77)
17 JavaScriptCore 0x1b0e6e85c long long JSC::APICallbackFunction::callJSC::JSCallbackFunction(JSC::JSGlobalObject_, JSC::CallFrame_) + 420
18 JavaScriptCore 0x1b0e238d8 llint_entry + 135240
19 JavaScriptCore 0x1b0e20f68 llint_entry + 124632
20 JavaScriptCore 0x1b0e20f68 llint_entry + 124632
21 JavaScriptCore 0x1b0e20f68 llint_entry + 124632
22 JavaScriptCore 0x1b0e20f68 llint_entry + 124632
23 JavaScriptCore 0x1b0e20f68 llint_entry + 124632
24 JavaScriptCore 0x1b0e21010 llint_entry + 124800
25 JavaScriptCore 0x1b0e20f68 llint_entry + 124632
26 JavaScriptCore 0x1b0e21010 llint_entry + 124800
27 JavaScriptCore 0x1b0e20f68 llint_entry + 124632
28 JavaScriptCore 0x1b0e21010 llint_entry + 124800
29 JavaScriptCore 0x1b0e21010 llint_entry + 124800
30 JavaScriptCore 0x1b0e20f68 llint_entry + 124632
31 JavaScriptCore 0x1b0e21f14 llint_entry + 128644
32 JavaScriptCore 0x1b0e21010 llint_entry + 124800
33 JavaScriptCore 0x1b0e20f68 llint_entry + 124632
34 JavaScriptCore 0x1b0e20f68 llint_entry + 124632
35 JavaScriptCore 0x1b0e20f68 llint_entry + 124632
36 JavaScriptCore 0x1b0e21010 llint_entry + 124800
37 JavaScriptCore 0x1b0e20f68 llint_entry + 124632
38 JavaScriptCore 0x1b0e22444 llint_entry + 129972
39 JavaScriptCore 0x1b0e20f68 llint_entry + 124632
40 JavaScriptCore 0x1b0e21010 llint_entry + 124800
41 JavaScriptCore 0x1b0e20f68 llint_entry + 124632
42 JavaScriptCore 0x1b0e02648 vmEntryToJavaScript + 248
43 JavaScriptCore 0x1b13b1718 JSC::Interpreter::executeCall(JSC::JSGlobalObject_, JSC::JSObject_, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 444
44 JavaScriptCore 0x1b162ffc8 JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject_, JSC::CallFrame_) + 712
45 JavaScriptCore 0x1b0e027c4 vmEntryToNative + 260
46 JavaScriptCore 0x1b13b176c JSC::Interpreter::executeCall(JSC::JSGlobalObject_, JSC::JSObject_, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 528
47 JavaScriptCore 0x1b15971a8 JSC::profiledCall(JSC::JSGlobalObject
, JSC::ProfilingReason, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 168
48 JavaScriptCore 0x1b0e834e0 JSObjectCallAsFunction + 504
49 PlusCards 0x104ea2034 facebook::jsc::JSCRuntime::call(facebook::jsi::Function const&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) + 1208 (JSCRuntime.cpp:1208)
50 PlusCards 0x104eaa3d8 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, std::*1::allocator > const&, facebook::jsi::Value>(facebook::jsi::Runtime&, std::*1::basic_string<char, std::*1::char_traits, std::*1::allocator > const&, std::*1::basic_string<char, std::*1::char_traits, std::*1::allocator > const&, facebook::jsi::Value&&) const + 224 (jsi-inl.h:224)
51 PlusCards 0x104eaa238 std::*1::*function::*func<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, std::*1::allocator > const&, folly::dynamic const&)::$4, std::*1::allocator<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, std::*1::allocator > const&, folly::dynamic const&)::$4>, void ()>::operator()() + 217 (JSIExecutor.cpp:217)
52 PlusCards 0x104dd4b30 void std::*1::*invoke_void_return_wrapper::*call<void (
&)(std::*1::function<void ()> const&, std::*1::function<std::*1::basic_string<char, std::*1::char_traits, std::*1::allocator > ()>), std::*1::function<void ()> const&, std::*1::function<std::*1::basic_string<char, std::*1::char_traits, std::*1::allocator > ()> >(void (
&)(std::*1::function<void ()> const&, std::*1::function<std::*1::basic_string<char, std::*1::char_traits, std::*1::allocator > ()>), std::*1::function<void ()> const&, std::*1::function<std::*1::basic_string<char, std::*1::char_traits, std::_1::allocator > ()>&&) + 1831 (functional:1831)
53 PlusCards 0x104ea8240 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, std::*1::allocator > const&, folly::dynamic const&) + 1831 (functional:1831)
54 PlusCards 0x104e9e678 std::*1::*function::*func<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::*1::function<void (facebook::react::JSExecutor
)>)::$7, std::*1::allocator<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::*1::function<void (facebook::react::JSExecutor)>)::$_7>, void ()>::operator()() + 1720 (functional:1720)
55 PlusCards 0x104df0750 facebook::react::tryAndReturnError(std::__1::function<void ()> const&) + 114464 (RCTCxxUtils.mm:114464)
56 PlusCards 0x104dfcf18 facebook::react::RCTMessageThread::tryFunc(std::__1::function<void ()> const&) + 59 (RCTMessageThread.mm:59)
57 CoreFoundation 0x1a1caf90c CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK

  • 20
    58 CoreFoundation 0x1a1caf098 __CFRunLoopDoBlocks + 264
    59 CoreFoundation 0x1a1caa1d8 __CFRunLoopRun + 772
    60 CoreFoundation 0x1a1ca9ba8 CFRunLoopRunSpecific + 424
    61 PlusCards 0x104de6148 ﹍[RCTCxxBridge runRunLoop]﹍ 269 (RCTCxxBridge.mm:269)
    62 Foundation 0x1a2129e20 NSThread__start + 848
    63 libsystem_pthread.dylib 0x1a1a47d98 _pthread_start + 156
    64 libsystem_pthread.dylib 0x1a1a4b74c thread_start + 8
    1. Steps to Reproduce
      No idea. It happens sometime

Code Sample

--

Version of Realm and Tooling

  • Realm JS SDK Version: 10.1.3
  • Node or React Native: 0.62.2
  • Client OS & Version: iOS 13.6.0, 13.5.1, 14.4.0
  • Which debugger for React Native: None
@Hannes-Endare
Copy link

We are facing this crash too. We can't reproduce it but we can see it happening in crashlytics. First crash happened in mid januari.

@kneth
Copy link
Contributor

kneth commented Mar 1, 2021

It looks like it is similar to #3112. We have been able to reproduce it but we haven't find the root cause yet.

@N3TC4T
Copy link

N3TC4T commented Apr 22, 2021

@kneth I'm seeing same crashes with latest realm version and it's only happening on iOS devices with version between 14.4.0 and 14.4.2.

I'm leaving my crash log here, please let me know if you needed any other information.

Thanks

EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000010
Crashed: com.facebook.react.JavaScript
0  JavaScriptCore                 0x1a97b9e04 bool JSC::symbolTableGet<JSC::JSGlobalObject>(JSC::JSGlobalObject*, JSC::PropertyName, JSC::PropertySlot&) + 76
1  JavaScriptCore                 0x1a8f2dfd4 JSC::JSObject::get(JSC::JSGlobalObject*, JSC::PropertyName) const + 2100
2  JavaScriptCore                 0x1a8f2dfd4 JSC::JSObject::get(JSC::JSGlobalObject*, JSC::PropertyName) const + 2100
3  JavaScriptCore                 0x1a8f2d6f4 JSObjectGetProperty + 152
4  MYAPP                           0x102679610 realm::js::is_object_of_type(OpaqueJSContext const*, OpaqueJSValue const*, realm::js::String<realm::jsc::Types>) + 3199256
5  MYAPP                           0x102679528 realm::js::Value<realm::jsc::Types>::is_array(OpaqueJSContext const*, OpaqueJSValue const* const&) + 3199024
6  MYAPP                           0x1026dfdb4 realm::js::RealmClass<realm::jsc::Types>::create(OpaqueJSContext const*, OpaqueJSValue*, realm::js::Arguments<realm::jsc::Types>&, realm::js::ReturnValue<realm::jsc::Types>&) + 3619004
7  MYAPP                           0x1026d968c OpaqueJSValue const* realm::js::wrap<&(realm::js::RealmClass<realm::jsc::Types>::create(OpaqueJSContext const*, OpaqueJSValue*, realm::js::Arguments<realm::jsc::Types>&, realm::js::ReturnValue<realm::jsc::Types>&))>(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) + 3592596
8  JavaScriptCore                 0x1a8f1bc34 long long JSC::APICallbackFunction::call<JSC::JSCallbackFunction>(JSC::JSGlobalObject*, JSC::CallFrame*) + 420
9  JavaScriptCore                 0x1a8ec7ee4 llint_entry + 159908
10 JavaScriptCore                 0x1a8ec51a4 llint_entry + 148324
11 JavaScriptCore                 0x1a8ec5258 llint_entry + 148504
12 JavaScriptCore                 0x1a8ea0b94 vmEntryToJavaScript + 276
13 JavaScriptCore                 0x1a94e22ac JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 488
14 JavaScriptCore                 0x1a96ef0d0 JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 164
15 JavaScriptCore                 0x1a8f3071c JSObjectCallAsFunction + 568
16 MYAPP                           0x1026e0b68 realm::js::RealmClass<realm::jsc::Types>::write(OpaqueJSContext const*, OpaqueJSValue*, realm::js::Arguments<realm::jsc::Types>&, realm::js::ReturnValue<realm::jsc::Types>&) + 3622512
17 MYAPP                           0x1026d9854 OpaqueJSValue const* realm::js::wrap<&(realm::js::RealmClass<realm::jsc::Types>::write(OpaqueJSContext const*, OpaqueJSValue*, realm::js::Arguments<realm::jsc::Types>&, realm::js::ReturnValue<realm::jsc::Types>&))>(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) + 3593052
18 JavaScriptCore                 0x1a8f1bc34 long long JSC::APICallbackFunction::call<JSC::JSCallbackFunction>(JSC::JSGlobalObject*, JSC::CallFrame*) + 420
19 JavaScriptCore                 0x1a8ec7ee4 llint_entry + 159908
20 JavaScriptCore                 0x1a8ec51a4 llint_entry + 148324
21 JavaScriptCore                 0x1a8ec51a4 llint_entry + 148324
22 JavaScriptCore                 0x1a8ec5258 llint_entry + 148504
23 JavaScriptCore                 0x1a8ec51a4 llint_entry + 148324
24 JavaScriptCore                 0x1a8ec51a4 llint_entry + 148324
25 JavaScriptCore                 0x1a8ec6324 llint_entry + 152804
26 JavaScriptCore                 0x1a8ec51a4 llint_entry + 148324
27 JavaScriptCore                 0x1a8ec5258 llint_entry + 148504
28 JavaScriptCore                 0x1a8ec5258 llint_entry + 148504
29 JavaScriptCore                 0x1a8ec51a4 llint_entry + 148324
30 JavaScriptCore                 0x1a8ec5258 llint_entry + 148504
31 JavaScriptCore                 0x1a8ec51a4 llint_entry + 148324
32 JavaScriptCore                 0x1a8ec5258 llint_entry + 148504
33 JavaScriptCore                 0x1a8ec5258 llint_entry + 148504
34 JavaScriptCore                 0x1a8ec51a4 llint_entry + 148324
35 JavaScriptCore                 0x1a8ec5258 llint_entry + 148504
36 JavaScriptCore                 0x1a8ec51a4 llint_entry + 148324
37 JavaScriptCore                 0x1a8ec51a4 llint_entry + 148324
38 JavaScriptCore                 0x1a8ec51a4 llint_entry + 148324
39 JavaScriptCore                 0x1a8ec51a4 llint_entry + 148324
40 JavaScriptCore                 0x1a8ec5258 llint_entry + 148504
41 JavaScriptCore                 0x1a8ec51a4 llint_entry + 148324
42 JavaScriptCore                 0x1a8ea0b94 vmEntryToJavaScript + 276
43 JavaScriptCore                 0x1a94e22ac JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 488
44 JavaScriptCore                 0x1a9793f1c JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*) + 676
45 JavaScriptCore                 0x1a8ec7de4 llint_entry + 159652
46 JavaScriptCore                 0x1a8ea0b94 vmEntryToJavaScript + 276
47 JavaScriptCore                 0x1a94e22ac JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 488
48 JavaScriptCore                 0x1a9793f1c JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*) + 676
49 JavaScriptCore                 0x1a8ea0d50 vmEntryToNative + 288
50 JavaScriptCore                 0x1a94e22dc JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 536
51 JavaScriptCore                 0x1a96ef0d0 JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 164
52 JavaScriptCore                 0x1a8f3071c JSObjectCallAsFunction + 568
53 MYAPP                           0x102446154 facebook::jsc::JSCRuntime::call(facebook::jsi::Function const&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) + 1253 (JSCRuntime.cpp:1253)
54 MYAPP                           0x1024509e8 facebook::jsi::Value facebook::jsi::Function::call<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, facebook::jsi::Value>(facebook::jsi::Runtime&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, facebook::jsi::Value&&) const + 228 (jsi-inl.h:228)
55 MYAPP                           0x102450848 std::__1::__function::__func<facebook::react::JSIExecutor::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, folly::dynamic const&)::$_4, std::__1::allocator<facebook::react::JSIExecutor::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, folly::dynamic const&)::$_4>, void ()>::operator()() + 231 (JSIExecutor.cpp:231)
56 MYAPP                           0x10236c794 void std::__1::__invoke_void_return_wrapper<void>::__call<void (*&)(std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>), std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()> >(void (*&)(std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>), std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>&&) + 1831 (functional:1831)
57 MYAPP                           0x10244df00 facebook::react::JSIExecutor::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, folly::dynamic const&) + 1831 (functional:1831)
58 MYAPP                           0x102442590 std::__1::__function::__func<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8, std::__1::allocator<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8>, void ()>::operator()() + 1720 (functional:1720)
59 MYAPP                           0x10238afa8 facebook::react::tryAndReturnError(std::__1::function<void ()> const&) + 125616 (RCTCxxUtils.mm:125616)
60 MYAPP                           0x1023972fc facebook::react::RCTMessageThread::tryFunc(std::__1::function<void ()> const&) + 69 (RCTMessageThread.mm:69)
61 MYAPP                           0x1023970bc invocation function for block in facebook::react::RCTMessageThread::runAsync(std::__1::function<void ()>) + 46 (RCTMessageThread.mm:46)
62 CoreFoundation                 0x19f7a949c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28
63 CoreFoundation                 0x19f7a86e4 __CFRunLoopDoBlocks + 408
64 CoreFoundation                 0x19f7a2e18 __CFRunLoopRun + 1732
65 CoreFoundation                 0x19f7a221c CFRunLoopRunSpecific + 600
66 MYAPP                           0x10237fdf4 +[RCTCxxBridge runRunLoop] + 308 (RCTCxxBridge.mm:308)
67 Foundation                     0x1a0bc3a34 __NSThread__start__ + 864
68 libsystem_pthread.dylib        0x1eb2d7cb0 _pthread_start + 320
69 libsystem_pthread.dylib        0x1eb2e0778 thread_start + 8

@kneth
Copy link
Contributor

kneth commented Apr 22, 2021

@N3TC4T Do you know the circumstances of the crash? For example, the app was closed/swiped out?

@N3TC4T
Copy link

N3TC4T commented Apr 22, 2021

Thanks Kenneth, Not really, I couldn't find anything that can help to find the cause of the crash, all the crashes happens when app is on foreground and also random screens, the only thing I realised is I don't have any crash report from users with iOS < 14.4, if there is anything specific I should look at or test please let me know.

@N3TC4T
Copy link

N3TC4T commented Apr 22, 2021

@kneth sorry, my bad, I'm just checked and 100% of this crash happened in background and only for users with iOS >= 14.4.0, I asked our support team and no user actually reported this, so I guess they even didn't noticed it. I will try to reproduce it.

Screenshot 2021-04-22 at 14 09 52

@mklb
Copy link

mklb commented Jul 9, 2021

I have the same issue. 100% background, 100% iOS 14.

"react": "^17.0.1",
"react-native": "^0.64.2",
"realm": "^10.4.2",

Crashed: com.facebook.react.JavaScript
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000010

0  JavaScriptCore                 0x19538ca80 <redacted> + 88
1  JavaScriptCore                 0x1950da344 <redacted> + 2084
2  JavaScriptCore                 0x1950da344 <redacted> + 2084
3  JavaScriptCore                 0x194b6a6f0 JSObjectGetProperty + 148
4  MYAPP                       0x101207e84 realm::js::is_object_of_type(OpaqueJSContext const*, OpaqueJSValue const*, realm::js::String<realm::jsc::Types>) + 1265160
5  MYAPP                       0x101246238 realm::js::Value<realm::jsc::Types>::is_date(OpaqueJSContext const*, OpaqueJSValue const* const&) + 1520060
6  MYAPP                       0x101245e3c auto realm::js::Value<realm::jsc::Types>::is_valid_for_property_type(OpaqueJSContext const*, OpaqueJSValue const* const&, realm::PropertyType, realm::StringData)::'lambda'(auto&&)::operator()<OpaqueJSValue const* const&>(auto&&) const + 1519040
7  MYAPP                       0x1012459ac realm::js::Value<realm::jsc::Types>::is_valid_for_property_type(OpaqueJSContext const*, OpaqueJSValue const* const&, realm::PropertyType, realm::StringData) + 1517872
8  MYAPP                       0x10125efd4 realm::js::RealmObjectClass<realm::jsc::Types>::set_property(OpaqueJSContext const*, OpaqueJSValue*, realm::js::String<realm::jsc::Types> const&, OpaqueJSValue const*) + 1621848
9  MYAPP                       0x10125e458 bool realm::js::wrap<&(realm::js::RealmObjectClass<realm::jsc::Types>::set_property(OpaqueJSContext const*, OpaqueJSValue*, realm::js::String<realm::jsc::Types> const&, OpaqueJSValue const*))>(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSString*, OpaqueJSValue const*, OpaqueJSValue const**) + 1618908
10 MYAPP                       0x101215cd4 realm::jsc::ObjectWrap<realm::js::RealmObjectClass<realm::jsc::Types> >::accessor_setter(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) + 1322072
11 JavaScriptCore                 0x194b5f1d8 <redacted> + 420
12 JavaScriptCore                 0x194ae7f44 <redacted> + 276
13 JavaScriptCore                 0x1950d565c <redacted> + 528
14 JavaScriptCore                 0x195329da0 JSC::callSetter(JSC::JSGlobalObject*, JSC::JSValue, JSC::JSValue, JSC::JSValue, JSC::ECMAMode) + 304
15 JavaScriptCore                 0x1953d1b50 JSC::JSObject::putInlineSlow(JSC::JSGlobalObject*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&) + 984
16 JavaScriptCore                 0x1953c5450 JSC::JSObject::put(JSC::JSCell*, JSC::JSGlobalObject*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&) + 372
17 JavaScriptCore                 0x194b59688 <redacted> + 816
18 JavaScriptCore                 0x19519910c <redacted> + 2096
19 JavaScriptCore                 0x194af378c <redacted> + 46924
20 JavaScriptCore                 0x194ae7d98 <redacted> + 264
21 JavaScriptCore                 0x1950d562c <redacted> + 480
22 JavaScriptCore                 0x1952c5a1c JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 156
23 JavaScriptCore                 0x194b6c824 JSObjectCallAsFunction + 560
24 MYAPP                       0x10126f44c realm::js::RealmClass<realm::jsc::Types>::write(OpaqueJSContext const*, OpaqueJSValue*, realm::js::Arguments<realm::jsc::Types>&, realm::js::ReturnValue<realm::jsc::Types>&) + 1688528
25 MYAPP                       0x101268184 OpaqueJSValue const* realm::js::wrap<&(realm::js::RealmClass<realm::jsc::Types>::write(OpaqueJSContext const*, OpaqueJSValue*, realm::js::Arguments<realm::jsc::Types>&, realm::js::ReturnValue<realm::jsc::Types>&))>(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) + 1659144
26 JavaScriptCore                 0x194b58f9c <redacted> + 412
27 JavaScriptCore                 0x194b0caf4 <redacted> + 150196
28 JavaScriptCore                 0x194b0a064 <redacted> + 139300
29 JavaScriptCore                 0x194b0a064 <redacted> + 139300
30 JavaScriptCore                 0x194b0b660 <redacted> + 144928
31 JavaScriptCore                 0x194b0a064 <redacted> + 139300
32 JavaScriptCore                 0x194b0a064 <redacted> + 139300
33 JavaScriptCore                 0x194b0a10c <redacted> + 139468
34 JavaScriptCore                 0x194b0a064 <redacted> + 139300
35 JavaScriptCore                 0x194b0b660 <redacted> + 144928
36 JavaScriptCore                 0x194b0a064 <redacted> + 139300
37 JavaScriptCore                 0x194b0a10c <redacted> + 139468
38 JavaScriptCore                 0x194b0a064 <redacted> + 139300
39 JavaScriptCore                 0x194ae7d98 <redacted> + 264
40 JavaScriptCore                 0x1950d562c <redacted> + 480
41 JavaScriptCore                 0x195367928 <redacted> + 672
42 JavaScriptCore                 0x194ae7f44 <redacted> + 276
43 JavaScriptCore                 0x1950d565c <redacted> + 528
44 JavaScriptCore                 0x1952c5a1c JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 156
45 JavaScriptCore                 0x194b6c824 JSObjectCallAsFunction + 560
46 MYAPP                       0x1011abef8 facebook::jsc::JSCRuntime::call(facebook::jsi::Function const&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) + 1253 (JSCRuntime.cpp:1253)
47 MYAPP                       0x1011b6758 facebook::jsi::Value facebook::jsi::Function::call<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, facebook::jsi::Value>(facebook::jsi::Runtime&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, facebook::jsi::Value&&) const + 228 (jsi-inl.h:228)
48 MYAPP                       0x1011b65b8 std::__1::__function::__func<facebook::react::JSIExecutor::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, folly::dynamic const&)::$_4, std::__1::allocator<facebook::react::JSIExecutor::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, folly::dynamic const&)::$_4>, void ()>::operator()() + 231 (JSIExecutor.cpp:231)
49 MYAPP                       0x1010d3314 void std::__1::__invoke_void_return_wrapper<void>::__call<void (*&)(std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>), std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()> >(void (*&)(std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>), std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>&&) + 1838 (functional:1838)
50 MYAPP                       0x1011b3c7c facebook::react::JSIExecutor::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, folly::dynamic const&) + 1838 (functional:1838)
51 MYAPP                       0x1011a8328 std::__1::__function::__func<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8, std::__1::allocator<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8>, void ()>::operator()() + 1727 (functional:1727)
52 MYAPP                       0x1010f18c8 facebook::react::tryAndReturnError(std::__1::function<void ()> const&) + 125004 (RCTCxxUtils.mm:125004)
53 MYAPP                       0x1010fdb28 facebook::react::RCTMessageThread::tryFunc(std::__1::function<void ()> const&) + 69 (RCTMessageThread.mm:69)
54 MYAPP                       0x1010fd8e8 invocation function for block in facebook::react::RCTMessageThread::runAsync(std::__1::function<void ()>) + 46 (RCTMessageThread.mm:46)
55 CoreFoundation                 0x18bb45950 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 20
56 CoreFoundation                 0x18bb44bd8 __CFRunLoopDoBlocks + 404
57 CoreFoundation                 0x18bb3f784 __CFRunLoopRun + 1708
58 CoreFoundation                 0x18bb3eba0 CFRunLoopRunSpecific + 572
59 MYAPP                       0x1010e67f4 +[RCTCxxBridge runRunLoop] + 308 (RCTCxxBridge.mm:308)
60 Foundation                     0x18cebb4bc __NSThread__start__ + 848
61 libsystem_pthread.dylib        0x1d43e7c9c _pthread_start + 288
62 libsystem_pthread.dylib        0x1d43ec880 thread_start + 8

@brunomartinezciompi
Copy link

brunomartinezciompi commented Sep 15, 2021

Received the same fatal event on crashlytics today ( iOS 14.7.1 & app in background as well)

Crashed: com.facebook.react.JavaScript
0  JavaScriptCore                 0x19fe725a8 bool JSC::symbolTableGet<JSC::JSGlobalObject>(JSC::JSGlobalObject*, JSC::PropertyName, JSC::PropertySlot&) + 88
1  JavaScriptCore                 0x19f573600 JSC::JSObject::get(JSC::JSGlobalObject*, JSC::PropertyName) const + 2176
2  JavaScriptCore                 0x19f573600 JSC::JSObject::get(JSC::JSGlobalObject*, JSC::PropertyName) const + 2176
3  JavaScriptCore                 0x19f62c530 JSObjectGetProperty + 148
4  ViviCompanion                  0x102b25e50 realm::js::is_object_of_type(OpaqueJSContext const*, OpaqueJSValue const*, realm::js::String<realm::jsc::Types>) + 1306228
5  ViviCompanion                  0x102b25d68 realm::js::Value<realm::jsc::Types>::is_array(OpaqueJSContext const*, OpaqueJSValue const* const&) + 1305996
6  ViviCompanion                  0x102ba2304 realm::js::RealmClass<realm::jsc::Types>::create(OpaqueJSContext const*, OpaqueJSValue*, realm::js::Arguments<realm::jsc::Types>&, realm::js::ReturnValue<realm::jsc::Types>&) + 1815336
7  ViviCompanion                  0x102b9a9d0 OpaqueJSValue const* realm::js::wrap<&(realm::js::RealmClass<realm::jsc::Types>::create(OpaqueJSContext const*, OpaqueJSValue*, realm::js::Arguments<realm::jsc::Types>&, realm::js::ReturnValue<realm::jsc::Types>&))>(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) + 1784308
8  JavaScriptCore                 0x19f62157c long long JSC::APICallbackFunction::callImpl<JSC::JSCallbackFunction>(JSC::JSGlobalObject*, JSC::CallFrame*) + 412
9  JavaScriptCore                 0x19f599820 llint_entry + 149712
10 JavaScriptCore                 0x19f596da8 llint_entry + 138840
11 JavaScriptCore                 0x19f574c88 vmEntryToJavaScript + 264
12 JavaScriptCore                 0x19fba2da0 JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 480
13 JavaScriptCore                 0x19fda8bdc JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 156
14 JavaScriptCore                 0x19f62e92c JSObjectCallAsFunction + 648
15 ViviCompanion                  0x102ba3060 realm::js::RealmClass<realm::jsc::Types>::write(OpaqueJSContext const*, OpaqueJSValue*, realm::js::Arguments<realm::jsc::Types>&, realm::js::ReturnValue<realm::jsc::Types>&) + 1818756
16 ViviCompanion                  0x102b9ab98 OpaqueJSValue const* realm::js::wrap<&(realm::js::RealmClass<realm::jsc::Types>::write(OpaqueJSContext const*, OpaqueJSValue*, realm::js::Arguments<realm::jsc::Types>&, realm::js::ReturnValue<realm::jsc::Types>&))>(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) + 1784764
17 JavaScriptCore                 0x19f62157c long long JSC::APICallbackFunction::callImpl<JSC::JSCallbackFunction>(JSC::JSGlobalObject*, JSC::CallFrame*) + 412
18 JavaScriptCore                 0x19f599820 llint_entry + 149712
19 JavaScriptCore                 0x19f596da8 llint_entry + 138840
20 JavaScriptCore                 0x19f5983a4 llint_entry + 144468
21 JavaScriptCore                 0x19f5983a4 llint_entry + 144468
22 JavaScriptCore                 0x19f596da8 llint_entry + 138840
23 JavaScriptCore                 0x19f596e50 llint_entry + 139008
24 JavaScriptCore                 0x19f596da8 llint_entry + 138840
25 JavaScriptCore                 0x19f574c88 vmEntryToJavaScript + 264
26 JavaScriptCore                 0x19fba2da0 JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 480
27 JavaScriptCore                 0x19fe4da20 JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*) + 672
28 JavaScriptCore                 0x19f574e38 vmEntryToNative + 280
29 JavaScriptCore                 0x19fba2dd0 JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 528
30 JavaScriptCore                 0x19fda8bdc JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 156
31 JavaScriptCore                 0x19f62e92c JSObjectCallAsFunction + 648
32 ViviCompanion                  0x1028a1bb4 facebook::jsc::JSCRuntime::call(facebook::jsi::Function const&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) + 1253 (JSCRuntime.cpp:1253)
33 ViviCompanion                  0x1028ac424 facebook::jsi::Value facebook::jsi::Function::call<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, facebook::jsi::Value>(facebook::jsi::Runtime&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, facebook::jsi::Value&&) const + 228 (jsi-inl.h:228)
34 ViviCompanion                  0x1028ac284 std::__1::__function::__func<facebook::react::JSIExecutor::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, folly::dynamic const&)::$_4, std::__1::allocator<facebook::react::JSIExecutor::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, folly::dynamic const&)::$_4>, void ()>::operator()() + 231 (JSIExecutor.cpp:231)
35 ViviCompanion                  0x1027c980c void std::__1::__invoke_void_return_wrapper<void>::__call<void (*&)(std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>), std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()> >(void (*&)(std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>), std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>&&) + 1831 (functional:1831)
36 ViviCompanion                  0x1028a993c facebook::react::JSIExecutor::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, folly::dynamic const&) + 1831 (functional:1831)
37 ViviCompanion                  0x10289e0ec std::__1::__function::__func<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8, std::__1::allocator<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8>, void ()>::operator()() + 1720 (functional:1720)
38 ViviCompanion                  0x1027e7dd4 facebook::react::tryAndReturnError(std::__1::function<void ()> const&) + 125000 (RCTCxxUtils.mm:125000)
39 ViviCompanion                  0x1027f40d0 facebook::react::RCTMessageThread::tryFunc(std::__1::function<void ()> const&) + 69 (RCTMessageThread.mm:69)
40 ViviCompanion                  0x1027f3e90 ___ZN8facebook5react16RCTMessageThread8runAsyncENSt3__18functionIFvvEEE_block_invoke + 46 (RCTMessageThread.mm:46)
41 CoreFoundation                 0x196672608 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 20
42 CoreFoundation                 0x19667189c __CFRunLoopDoBlocks + 404
43 CoreFoundation                 0x19666c008 __CFRunLoopRun + 752
44 CoreFoundation                 0x19666b7d0 CFRunLoopRunSpecific + 572
45 ViviCompanion                  0x1027dce38 +[RCTCxxBridge runRunLoop] + 308 (RCTCxxBridge.mm:308)
46 Foundation                     0x197a25d90 __NSThread__start__ + 848
47 libsystem_pthread.dylib        0x1dec23c74 _pthread_start + 288
48 libsystem_pthread.dylib        0x1dec28878 thread_start + 8

@Rajai-Sunnyclock
Copy link

@mklb Did u get it resolved?

@mklb
Copy link

mklb commented Oct 30, 2021

@Rajai-Sunnyclock no I did not resolve it. I thought the bug was fixed because I did not see them coming up any more.. However I just experienced 3 crashes in production on the latest realm version 10.9.1 (see mention above). iOS: 14.8.0, 15.1.0, 15.0.2.

All 100% background state!

Edit: as of now there are 13 crashes already @fronck

@Rajai-Sunnyclock
Copy link

@mklb Thanks for the reply.

The only workaround I could think is to not use realm particularly inserting data while in background.

@mklb
Copy link

mklb commented Nov 2, 2021

I am not using any background tasks so I guess it is code that is executed when users close my app. There is a small time window where this would be possible.

@kneth
Copy link
Contributor

kneth commented Oct 20, 2022

We have released v11.0.0 which has a complete rewrite of the integration with JSC. I am closing the issue, and ask you to upgrade. If the issue is still observed, please create a new issue.

@sync-by-unito sync-by-unito bot closed this as completed Oct 20, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants