Crash on RuntimeDecorator::isUIRuntime(rt) / find
See original GitHub issueDescription
We are experiencing crashes after upgrading to 2.3.0. Screenshots and traces are below.
Expected behavior
No crash.
Actual behavior & steps to reproduce
Crash.
Snack or minimal code example
I’m not sure when it happens, probably quite random because there are not that many of them. Xcode organizer:

We also received a few of these in sentry, not sure if they are the same because the sentry ones have no useful trace.

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000008
Exception Codes: 0x0000000000000001, 0x0000000000000008
VM Region Info: 0x8 is not in any region. Bytes before following region: 4375904248
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
--->
__TEXT 104d30000-104d34000 [ 16K] r-x/r-x SM=COW ...ggo.app/App
Exception Note: EXC_CORPSE_NOTIFY
Terminating Process: exc handler [27768]
Triggered by Thread: 2
Thread 2 name:
Thread 2 Crashed:
0 App 0x00000001050e3140 std::__1::__hash_iterator<std::__1::__hash_node<std::__1::__hash_value_type<facebook::jsi::Runtime*, reanimated::RuntimeType>, void*>*> std::__1::__hash_table<std::__1::__hash_value_type<facebook::... + 124 (__hash_table:2394)
1 App 0x00000001050e2770 find + 8 (unordered_map:1352)
2 App 0x00000001050e2770 isUIRuntime + 16 (RuntimeDecorator.h:66)
3 App 0x00000001050e2770 reanimated::MutableValue::get(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&) + 132 (MutableValue.cpp:88)
4 App 0x00000001052258b8 facebook::jsc::JSCRuntime::createObject(std::__1::shared_ptr<facebook::jsi::HostObject>)::HostObjectProxy::getProperty(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSString*, OpaqueJSValue const**) + 120 (JSCRuntime.cpp:723)
5 JavaScriptCore 0x000000018be90e88 JSC::JSCallbackObject<JSC::JSNonFinalObject>::getOwnPropertySlot(JSC::JSObject*, JSC::JSGlobalObject*, JSC::PropertyName, JSC::PropertySlot&) + 344 (JSCallbackObjectFunctions.h:173)
6 JavaScriptCore 0x000000018bdd8eb4 JSC::JSObject::get(JSC::JSGlobalObject*, JSC::PropertyName) const + 2644 (JSObjectInlines.h:162)
7 JavaScriptCore 0x000000018bea33c0 JSObjectGetProperty + 148 (JSObjectRef.cpp:353)
8 App 0x00000001052243f8 facebook::jsc::JSCRuntime::getProperty(facebook::jsi::Object const&, facebook::jsi::String const&) + 60 (JSCRuntime.cpp:855)
9 App 0x000000010510b6fc getProperty + 28 (jsi-inl.h:87)
10 App 0x000000010510b6fc getProperty + 64 (jsi-inl.h:83)
11 App 0x000000010510b6fc reanimated::ShareableValue::adapt(facebook::jsi::Runtime&, facebook::jsi::Value const&, reanimated::ValueType) + 152 (ShareableValue.cpp:62)
12 App 0x000000010510d850 reanimated::ShareableValue::adapt(facebook::jsi::Runtime&, facebook::jsi::Value const&, reanimated::RuntimeManager*, reanimated::ValueType) + 212 (ShareableValue.cpp:194)
13 App 0x00000001050db8cc reanimated::FrozenObject::FrozenObject(facebook::jsi::Runtime&, facebook::jsi::Object const&, reanimated::RuntimeManager*) + 640 (FrozenObject.cpp:19)
14 App 0x000000010510d6ac __shared_ptr_emplace<facebook::jsi::Runtime &, facebook::jsi::Object &, reanimated::RuntimeManager *&> + 36 (memory:2627)
15 App 0x000000010510d6ac __shared_ptr_emplace<facebook::jsi::Runtime &, facebook::jsi::Object &, reanimated::RuntimeManager *&> + 36 (memory:2621)
16 App 0x000000010510d6ac allocate_shared<reanimated::FrozenObject, std::allocator<reanimated::FrozenObject>, facebook::jsi::Runtime &, facebook::jsi::Object &, reanimated::RuntimeManager *&, void> + 48 (memory:3385)
17 App 0x000000010510d6ac std::__1::shared_ptr<reanimated::FrozenObject> std::__1::make_shared<reanimated::FrozenObject, facebook::jsi::Runtime&, facebook::jsi::Object&, reanimated::RuntimeManager*&, void>(facebook::jsi::Ru... + 84 (memory:3394)
18 App 0x000000010510ca20 reanimated::ShareableValue::adapt(facebook::jsi::Runtime&, facebook::jsi::Value const&, reanimated::ValueType) + 5052 (ShareableValue.cpp:164)
19 App 0x000000010510d850 reanimated::ShareableValue::adapt(facebook::jsi::Runtime&, facebook::jsi::Value const&, reanimated::RuntimeManager*, reanimated::ValueType) + 212 (ShareableValue.cpp:194)
20 App 0x00000001050db8cc reanimated::FrozenObject::FrozenObject(facebook::jsi::Runtime&, facebook::jsi::Object const&, reanimated::RuntimeManager*) + 640 (FrozenObject.cpp:19)
21 App 0x000000010510d6ac __shared_ptr_emplace<facebook::jsi::Runtime &, facebook::jsi::Object &, reanimated::RuntimeManager *&> + 36 (memory:2627)
22 App 0x000000010510d6ac __shared_ptr_emplace<facebook::jsi::Runtime &, facebook::jsi::Object &, reanimated::RuntimeManager *&> + 36 (memory:2621)
23 App 0x000000010510d6ac allocate_shared<reanimated::FrozenObject, std::allocator<reanimated::FrozenObject>, facebook::jsi::Runtime &, facebook::jsi::Object &, reanimated::RuntimeManager *&, void> + 48 (memory:3385)
24 App 0x000000010510d6ac std::__1::shared_ptr<reanimated::FrozenObject> std::__1::make_shared<reanimated::FrozenObject, facebook::jsi::Runtime&, facebook::jsi::Object&, reanimated::RuntimeManager*&, void>(facebook::jsi::Ru... + 84 (memory:3394)
25 App 0x000000010510bf34 reanimated::ShareableValue::adapt(facebook::jsi::Runtime&, facebook::jsi::Value const&, reanimated::ValueType) + 2256 (ShareableValue.cpp:124)
26 App 0x000000010510d850 reanimated::ShareableValue::adapt(facebook::jsi::Runtime&, facebook::jsi::Value const&, reanimated::RuntimeManager*, reanimated::ValueType) + 212 (ShareableValue.cpp:194)
27 App 0x00000001050db8cc reanimated::FrozenObject::FrozenObject(facebook::jsi::Runtime&, facebook::jsi::Object const&, reanimated::RuntimeManager*) + 640 (FrozenObject.cpp:19)
28 App 0x000000010510d6ac __shared_ptr_emplace<facebook::jsi::Runtime &, facebook::jsi::Object &, reanimated::RuntimeManager *&> + 36 (memory:2627)
29 App 0x000000010510d6ac __shared_ptr_emplace<facebook::jsi::Runtime &, facebook::jsi::Object &, reanimated::RuntimeManager *&> + 36 (memory:2621)
30 App 0x000000010510d6ac allocate_shared<reanimated::FrozenObject, std::allocator<reanimated::FrozenObject>, facebook::jsi::Runtime &, facebook::jsi::Object &, reanimated::RuntimeManager *&, void> + 48 (memory:3385)
31 App 0x000000010510d6ac std::__1::shared_ptr<reanimated::FrozenObject> std::__1::make_shared<reanimated::FrozenObject, facebook::jsi::Runtime&, facebook::jsi::Object&, reanimated::RuntimeManager*&, void>(facebook::jsi::Ru... + 84 (memory:3394)
32 App 0x000000010510ca20 reanimated::ShareableValue::adapt(facebook::jsi::Runtime&, facebook::jsi::Value const&, reanimated::ValueType) + 5052 (ShareableValue.cpp:164)
33 App 0x000000010510d850 reanimated::ShareableValue::adapt(facebook::jsi::Runtime&, facebook::jsi::Value const&, reanimated::RuntimeManager*, reanimated::ValueType) + 212 (ShareableValue.cpp:194)
34 App 0x00000001050db8cc reanimated::FrozenObject::FrozenObject(facebook::jsi::Runtime&, facebook::jsi::Object const&, reanimated::RuntimeManager*) + 640 (FrozenObject.cpp:19)
35 App 0x000000010510d6ac __shared_ptr_emplace<facebook::jsi::Runtime &, facebook::jsi::Object &, reanimated::RuntimeManager *&> + 36 (memory:2627)
36 App 0x000000010510d6ac __shared_ptr_emplace<facebook::jsi::Runtime &, facebook::jsi::Object &, reanimated::RuntimeManager *&> + 36 (memory:2621)
37 App 0x000000010510d6ac allocate_shared<reanimated::FrozenObject, std::allocator<reanimated::FrozenObject>, facebook::jsi::Runtime &, facebook::jsi::Object &, reanimated::RuntimeManager *&, void> + 48 (memory:3385)
38 App 0x000000010510d6ac std::__1::shared_ptr<reanimated::FrozenObject> std::__1::make_shared<reanimated::FrozenObject, facebook::jsi::Runtime&, facebook::jsi::Object&, reanimated::RuntimeManager*&, void>(facebook::jsi::Ru... + 84 (memory:3394)
39 App 0x000000010510ca20 reanimated::ShareableValue::adapt(facebook::jsi::Runtime&, facebook::jsi::Value const&, reanimated::ValueType) + 5052 (ShareableValue.cpp:164)
40 App 0x000000010510d850 reanimated::ShareableValue::adapt(facebook::jsi::Runtime&, facebook::jsi::Value const&, reanimated::RuntimeManager*, reanimated::ValueType) + 212 (ShareableValue.cpp:194)
41 App 0x00000001050db8cc reanimated::FrozenObject::FrozenObject(facebook::jsi::Runtime&, facebook::jsi::Object const&, reanimated::RuntimeManager*) + 640 (FrozenObject.cpp:19)
42 App 0x000000010510d6ac __shared_ptr_emplace<facebook::jsi::Runtime &, facebook::jsi::Object &, reanimated::RuntimeManager *&> + 36 (memory:2627)
43 App 0x000000010510d6ac __shared_ptr_emplace<facebook::jsi::Runtime &, facebook::jsi::Object &, reanimated::RuntimeManager *&> + 36 (memory:2621)
44 App 0x000000010510d6ac allocate_shared<reanimated::FrozenObject, std::allocator<reanimated::FrozenObject>, facebook::jsi::Runtime &, facebook::jsi::Object &, reanimated::RuntimeManager *&, void> + 48 (memory:3385)
45 App 0x000000010510d6ac std::__1::shared_ptr<reanimated::FrozenObject> std::__1::make_shared<reanimated::FrozenObject, facebook::jsi::Runtime&, facebook::jsi::Object&, reanimated::RuntimeManager*&, void>(facebook::jsi::Ru... + 84 (memory:3394)
46 App 0x000000010510bf34 reanimated::ShareableValue::adapt(facebook::jsi::Runtime&, facebook::jsi::Value const&, reanimated::ValueType) + 2256 (ShareableValue.cpp:124)
47 App 0x000000010510d850 reanimated::ShareableValue::adapt(facebook::jsi::Runtime&, facebook::jsi::Value const&, reanimated::RuntimeManager*, reanimated::ValueType) + 212 (ShareableValue.cpp:194)
48 App 0x00000001050eb160 reanimated::NativeReanimatedModule::registerEventHandler(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const&) + 152 (NativeReanimatedModule.cpp:190)
49 App 0x0000000105226f50 operator() + 28 (functional:1885)
50 App 0x0000000105226f50 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... + 44 (functional:2560)
51 App 0x0000000105226c98 facebook::jsc::JSCRuntime::createFunctionFromHostFunction(facebook::jsi::PropNameID const&, unsigned int, std::__1::function<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value cons... + 380 (JSCRuntime.cpp:1158)
52 JavaScriptCore 0x000000018be98090 JSC::JSCallbackObject<JSC::JSNonFinalObject>::callImpl(JSC::JSGlobalObject*, JSC::CallFrame*) + 456 (JSCallbackObjectFunctions.h:566)
53 JavaScriptCore 0x000000018c590f58 JSC::LLInt::setUpCall(JSC::CallFrame*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*) + 1188 (NativeFunction.h:50)
54 JavaScriptCore 0x000000018be086c4 llint_entry + 149564
55 JavaScriptCore 0x000000018be08624 llint_entry + 149404
56 JavaScriptCore 0x000000018be086d8 llint_entry + 149584
57 JavaScriptCore 0x000000018be08624 llint_entry + 149404
58 JavaScriptCore 0x000000018be086d8 llint_entry + 149584
59 JavaScriptCore 0x000000018be08624 llint_entry + 149404
60 JavaScriptCore 0x000000018bde3bec vmEntryToJavaScript + 264
61 JavaScriptCore 0x000000018c487130 JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 460 (JITCodeInlines.h:42)
62 JavaScriptCore 0x000000018c7640a8 JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*) + 656 (JSBoundFunction.cpp:60)
63 JavaScriptCore 0x000000018be0b240 llint_entry + 160696
64 JavaScriptCore 0x000000018be086d8 llint_entry + 149584
65 JavaScriptCore 0x000000018be08624 llint_entry + 149404
66 JavaScriptCore 0x000000018bde3bec vmEntryToJavaScript + 264
67 JavaScriptCore 0x000000018c487130 JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 460 (JITCodeInlines.h:42)
68 JavaScriptCore 0x000000018c7640a8 JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*) + 656 (JSBoundFunction.cpp:60)
69 JavaScriptCore 0x000000018be0b240 llint_entry + 160696
70 JavaScriptCore 0x000000018be086d8 llint_entry + 149584
71 JavaScriptCore 0x000000018be09ddc llint_entry + 155476
72 JavaScriptCore 0x000000018be08624 llint_entry + 149404
73 JavaScriptCore 0x000000018be086d8 llint_entry + 149584
74 JavaScriptCore 0x000000018be08624 llint_entry + 149404
75 JavaScriptCore 0x000000018bde3bec vmEntryToJavaScript + 264
76 JavaScriptCore 0x000000018c487130 JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 460 (JITCodeInlines.h:42)
77 JavaScriptCore 0x000000018c7640a8 JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*) + 656 (JSBoundFunction.cpp:60)
78 JavaScriptCore 0x000000018bde3d98 vmEntryToNative + 280
79 JavaScriptCore 0x000000018c487158 JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 500 (Interpreter.cpp:905)
80 JavaScriptCore 0x000000018c6b5624 JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 156 (CallData.cpp:57)
81 JavaScriptCore 0x000000018bea56fc JSObjectCallAsFunction + 560 (JSObjectRef.cpp:735)
82 App 0x0000000105225178 facebook::jsc::JSCRuntime::call(facebook::jsi::Function const&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) + 164 (JSCRuntime.cpp:1260)
83 App 0x0000000105230b88 call + 44 (jsi-inl.h:228)
84 App 0x0000000105230b88 call + 44 (jsi-inl.h:233)
85 App 0x0000000105230b88 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<c... + 244 (jsi-inl.h:241)
86 App 0x00000001052309ec operator() + 68 (JSIExecutor.cpp:256)
87 App 0x00000001052309ec __invoke<(lambda at /Users/app_loc/node_modules/react-native/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp:255:9) &> + 68 (type_traits:3694)
88 App 0x00000001052309ec __call<(lambda at /Users/app_loc/node_modules/react-native/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp:255:9) &> + 68 (__functional_base:348)
89 App 0x00000001052309ec operator() + 68 (functional:1558)
90 App 0x00000001052309ec 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, st... + 96 (functional:1732)
91 App 0x000000010514db20 __invoke<void (*&)(const std::function<void ()> &, std::function<std::string ()>), const std::function<void ()> &, std::function<std::string ()> > + 32 (type_traits:3694)
92 App 0x000000010514db20 void std::__1::__invoke_void_return_wrapper<void, true>::__call<void (*&)(std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::... + 72 (__functional_base:348)
93 App 0x000000010522ddb4 operator() + 32 (functional:1885)
94 App 0x000000010522ddb4 operator() + 32 (functional:2560)
95 App 0x000000010522ddb4 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>, st... + 356 (JSIExecutor.cpp:254)
96 App 0x00000001052217fc operator() + 24 (functional:1885)
97 App 0x00000001052217fc operator() + 24 (functional:2560)
98 App 0x00000001052217fc operator() + 48 (NativeToJsBridge.cpp:310)
99 App 0x00000001052217fc __invoke<(lambda at /Users/app_loc/node_modules/react-native/ReactCommon/cxxreact/NativeToJsBridge.cpp:300:7) &> + 48 (type_traits:3694)
100 App 0x00000001052217fc __call<(lambda at /Users/app_loc/node_modules/react-native/ReactCommon/cxxreact/NativeToJsBridge.cpp:300:7) &> + 48 (__functional_base:348)
101 App 0x00000001052217fc operator() + 48 (functional:1558)
102 App 0x00000001052217fc std::__1::__function::__func<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_8, std::__1::allocator<facebook::react::NativeToJsBrid... + 60 (functional:1732)
103 App 0x000000010516c958 operator() + 20 (functional:1885)
104 App 0x000000010516c958 operator() + 20 (functional:2560)
105 App 0x000000010516c958 facebook::react::tryAndReturnError(std::__1::function<void ()> const&) + 32 (RCTCxxUtils.mm:74)
106 App 0x0000000105178b1c facebook::react::RCTMessageThread::tryFunc(std::__1::function<void ()> const&) + 24 (RCTMessageThread.mm:69)
107 App 0x00000001051788d0 operator() + 20 (functional:1885)
108 App 0x00000001051788d0 operator() + 20 (functional:2560)
109 App 0x00000001051788d0 invocation function for block in facebook::react::RCTMessageThread::runAsync(std::__1::function<void ()>) + 44 (RCTMessageThread.mm:45)
110 CoreFoundation 0x0000000181650ce8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 20 (CFRunLoop.c:1820)
111 CoreFoundation 0x0000000181651abc __CFRunLoopDoBlocks + 408 (CFRunLoop.c:1862)
112 CoreFoundation 0x00000001815eedcc __CFRunLoopRun + 1732 (CFRunLoop.c:3198)
113 CoreFoundation 0x0000000181601d7c CFRunLoopRunSpecific + 572 (CFRunLoop.c:3268)
114 App 0x0000000105161ccc +[RCTCxxBridge runRunLoop] + 264 (RCTCxxBridge.mm:367)
115 Foundation 0x0000000182d86efc __NSThread__start__ + 792 (NSThread.m:972)
116 libsystem_pthread.dylib 0x00000001db6433a4 _pthread_start + 116 (pthread.c:891)
117 libsystem_pthread.dylib 0x00000001db6419fc thread_start + 8
Package versions
- React Native: 0.66.3
- React Native Reanimated: 2.3.0
- React Native Screens: 3.10.1
- NodeJS: 16.13.1
- Xcode: 13.1
- Java & Gradle: 15.0.1 & 6.7
Affected platforms
- Android
- iOS
- Web
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Decorator for Multiprocessing Lock crashes on runtime
Iam trying Multiprocessing and tried using Locks with decorator for ease but it crashes on run-time def lock_dec(func): def wrapper(*args ...
Read more >How to Fix a GPU Driver Crash - Unreal Engine Documentation
You need to add two registry keys to your graphics drivers. Follow these steps to add the registry keys. Type 'run' into the...
Read more >Python Decorators in 15 Minutes - YouTube
Decorators are an advanced feature of the Python language that allow you to modify the behavior of a function or method without touching...
Read more >Python Type Checking (Guide) - Real Python
Running a static type checker; Enforcing types at runtime. This is a comprehensive guide that will cover a lot of ground. If you...
Read more >typescript-cheatsheet - GitHub Pages
The cheatsheet contains references to types, classes, decorators, and many other ... It has no runtime impact, and is used purely by the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I worked on this, but like you said this is hard to reproduce. I will notify you about progress.
I’m seeing a similar crash to the one originally posted here in the description, and I noticed that it seems like the app is being terminated by the system during the crash. So it could be an issue in the order of operations for cleanup here.