Crashing app when arguments from onTouchesXXX handlers from RNGH are used by the callback
Description
App crashes when callback is using the second argument from onTouchesXXX handler from react-native-gesture-handler.
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Incident Identifier: 5881C8CC-559B-465F-800D-5283AC171DE6
CrashReporter Key: 43558FAC-4244-E29D-0613-D4A42B21649B
Hardware Model: MacBookPro18,3
Process: ReanimatedRNGHBug [62381]
Path: /Users/USER/Library/Developer/CoreSimulator/Devices/05B6EFA3-BBE0-46C4-B25E-51691DC6183F/data/Containers/Bundle/Application/DB3A75D5-B46D-4BA3-A73E-C286E25F268C/ReanimatedRNGHBug.app/ReanimatedRNGHBug
Identifier: com.tmaszko.ReanimatedRNGHBug
Version: 1.0.0 (1)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd_sim [24123]
Coalition: com.apple.CoreSimulator.SimDevice.05B6EFA3-BBE0-46C4-B25E-51691DC6183F [160074]
Responsible Process: SimulatorTrampoline [1215]
Date/Time: 2025-11-07 23:59:20.3911 +0100
Launch Time: 2025-11-07 23:58:24.5971 +0100
OS Version: macOS 15.0 (24A335)
Release Type: User
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: SIGNAL 6 Abort trap: 6
Terminating Process: ReanimatedRNGHBug [62381]
Triggered by Thread: 3
Thread 0:: Dispatch queue: com.apple.main-thread
0 libsystem_pthread.dylib 0x10419a9b0 pthread_getspecific + 0
1 libobjc.A.dylib 0x1800922b8 objc_unsafeClaimAutoreleasedReturnValue + 32
2 UIKitCore 0x18573f3f0 isDescendantOfContainer + 132
3 UIKitCore 0x18566a514 -[UIGestureRecognizer _affectedByGesture:] + 316
4 UIKitCore 0x18565c308 _UIGestureEnvironmentUpdate + 672
5 UIKitCore 0x18565bd84 -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 324
6 UIKitCore 0x18565bad0 -[UIGestureEnvironment _updateForEvent:window:] + 156
7 UIKitCore 0x185b735b4 -[UIWindow sendEvent:] + 2824
8 UIKitCore 0x185b52fb0 -[UIApplication sendEvent:] + 376
9 UIKitCore 0x185bdd420 __dispatchPreprocessedEventFromEventQueue + 1156
10 UIKitCore 0x185be03b0 __processEventQueue + 5592
11 UIKitCore 0x185bd86c0 updateCycleEntry + 156
12 UIKitCore 0x1850ab55c _UIUpdateSequenceRun + 76
13 UIKitCore 0x185a67cec schedulerStepScheduledMainSection + 168
14 UIKitCore 0x185a67124 runloopSourceCallback + 80
15 CoreFoundation 0x18041d2a4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
16 CoreFoundation 0x18041d1ec __CFRunLoopDoSource0 + 172
17 CoreFoundation 0x18041c950 __CFRunLoopDoSources0 + 232
18 CoreFoundation 0x180416e94 __CFRunLoopRun + 788
19 CoreFoundation 0x180416704 CFRunLoopRunSpecific + 552
20 GraphicsServices 0x190604b10 GSEventRunModal + 160
21 UIKitCore 0x185b39180 -[UIApplication _run] + 796
22 UIKitCore 0x185b3d378 UIApplicationMain + 124
23 ReanimatedRNGHBug.debug.dylib 0x106c7a46c __debug_main_executable_dylib_entry_point + 64 (AppDelegate.swift:6)
24 dyld_sim 0x1042f1410 start_sim + 20
25 dyld 0x104542274 start + 2840
Thread 1:
0 libsystem_pthread.dylib 0x10419a92c start_wqthread + 0
Thread 2:: com.apple.uikit.eventfetch-thread
0 libsystem_kernel.dylib 0x104215290 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x1042266c4 mach_msg2_internal + 76
2 libsystem_kernel.dylib 0x10421d3f4 mach_msg_overwrite + 536
3 libsystem_kernel.dylib 0x1042155cc mach_msg + 20
4 CoreFoundation 0x18041cae0 __CFRunLoopServiceMachPort + 156
5 CoreFoundation 0x180417008 __CFRunLoopRun + 1160
6 CoreFoundation 0x180416704 CFRunLoopRunSpecific + 552
7 Foundation 0x180f1f490 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 208
8 Foundation 0x180f1f6b0 -[NSRunLoop(NSRunLoop) runUntilDate:] + 60
9 UIKitCore 0x185be6a34 -[UIEventFetcher threadMain] + 404
10 Foundation 0x180f462d8 __NSThread__start__ + 720
11 libsystem_pthread.dylib 0x10419f6f8 _pthread_start + 104
12 libsystem_pthread.dylib 0x10419a940 thread_start + 8
Thread 3 Crashed:: com.facebook.react.runtime.JavaScript
0 libsystem_kernel.dylib 0x10421d008 __pthread_kill + 8
1 libsystem_pthread.dylib 0x10419f408 pthread_kill + 256
2 libsystem_c.dylib 0x1801704ec abort + 104
3 libsystem_c.dylib 0x18016f934 __assert_rtn + 268
4 ReanimatedRNGHBug.debug.dylib 0x10731a3ac worklets::getValueUnpacker(facebook::jsi::Runtime&) + 312 (Serializable.cpp:10)
5 ReanimatedRNGHBug.debug.dylib 0x10731fec0 worklets::SerializableWorklet::toJSValue(facebook::jsi::Runtime&) + 364 (Serializable.cpp:443)
6 ReanimatedRNGHBug.debug.dylib 0x10731ea18 worklets::SerializableObject::toJSValue(facebook::jsi::Runtime&) + 192 (Serializable.cpp:362)
7 ReanimatedRNGHBug.debug.dylib 0x10731daec worklets::SerializableArray::toJSValue(facebook::jsi::Runtime&) + 152 (Serializable.cpp:312)
8 ReanimatedRNGHBug.debug.dylib 0x107383068 worklets::parseArgs(facebook::jsi::Runtime&, std::__1::shared_ptr<worklets::SerializableArray>) + 108 (WorkletRuntimeDecorator.cpp:32)
9 ReanimatedRNGHBug.debug.dylib 0x107382efc worklets::WorkletRuntimeDecorator::decorate(facebook::jsi::Runtime&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::shared_ptr<worklets::JSScheduler> const&, bool, facebook::jsi::Object&&, std::__1::shared_ptr<worklets::EventLoop> const&)::$_17::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const&) const::'lambda'(facebook::jsi::Runtime&)::operator()(facebook::jsi::Runtime&) const + 280 (WorkletRuntimeDecorator.cpp:232)
10 ReanimatedRNGHBug.debug.dylib 0x107382dd8 decltype(std::declval<worklets::WorkletRuntimeDecorator::decorate(facebook::jsi::Runtime&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::shared_ptr<worklets::JSScheduler> const&, bool, facebook::jsi::Object&&, std::__1::shared_ptr<worklets::EventLoop> const&)::$_17::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const&) const::'lambda'(facebook::jsi::Runtime&)&>()(std::declval<facebook::jsi::Runtime&>())) std::__1::__invoke[abi:de180100]<worklets::WorkletRuntimeDecorator::decorate(facebook::jsi::Runtime&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::shared_ptr<worklets::JSScheduler> const&, bool, facebook::jsi::Object&&, std::__1::shared_ptr<worklets::EventLoop> const&)::$_17::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const&) const::'lambda'(facebook::jsi::Runtime&)&, facebook::jsi::Runtime&>(worklets::WorkletRuntimeDecorator::decorate(facebook::jsi::Runtime&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::shared_ptr<worklets::JSScheduler> const&, bool, facebook::jsi::Object&&, std::__1::shared_ptr<worklets::EventLoop> const&)::$_17::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const&) const::'lambda'(facebook::jsi::Runtime&)&, facebook::jsi::Runtime&) + 32 (invoke.h:344)
11 ReanimatedRNGHBug.debug.dylib 0x107382d88 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:de180100]<worklets::WorkletRuntimeDecorator::decorate(facebook::jsi::Runtime&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::shared_ptr<worklets::JSScheduler> const&, bool, facebook::jsi::Object&&, std::__1::shared_ptr<worklets::EventLoop> const&)::$_17::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const&) const::'lambda'(facebook::jsi::Runtime&)&, facebook::jsi::Runtime&>(worklets::WorkletRuntimeDecorator::decorate(facebook::jsi::Runtime&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::shared_ptr<worklets::JSScheduler> const&, bool, facebook::jsi::Object&&, std::__1::shared_ptr<worklets::EventLoop> const&)::$_17::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const&) const::'lambda'(facebook::jsi::Runtime&)&, facebook::jsi::Runtime&) + 32 (invoke.h:419)
12 ReanimatedRNGHBug.debug.dylib 0x107382d5c std::__1::__function::__alloc_func<worklets::WorkletRuntimeDecorator::decorate(facebook::jsi::Runtime&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::shared_ptr<worklets::JSScheduler> const&, bool, facebook::jsi::Object&&, std::__1::shared_ptr<worklets::EventLoop> const&)::$_17::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const&) const::'lambda'(facebook::jsi::Runtime&), std::__1::allocator<worklets::WorkletRuntimeDecorator::decorate(facebook::jsi::Runtime&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::shared_ptr<worklets::JSScheduler> const&, bool, facebook::jsi::Object&&, std::__1::shared_ptr<worklets::EventLoop> const&)::$_17::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const&) const::'lambda'(facebook::jsi::Runtime&)>, void (facebook::jsi::Runtime&)>::operator()[abi:de180100](facebook::jsi::Runtime&) + 36 (function.h:169)
13 ReanimatedRNGHBug.debug.dylib 0x107381a30 std::__1::__function::__func<worklets::WorkletRuntimeDecorator::decorate(facebook::jsi::Runtime&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::shared_ptr<worklets::JSScheduler> const&, bool, facebook::jsi::Object&&, std::__1::shared_ptr<worklets::EventLoop> const&)::$_17::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const&) const::'lambda'(facebook::jsi::Runtime&), std::__1::allocator<worklets::WorkletRuntimeDecorator::decorate(facebook::jsi::Runtime&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::shared_ptr<worklets::JSScheduler> const&, bool, facebook::jsi::Object&&, std::__1::shared_ptr<worklets::EventLoop> const&)::$_17::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const&) const::'lambda'(facebook::jsi::Runtime&)>, void (facebook::jsi::Runtime&)>::operator()(facebook::jsi::Runtime&) + 36 (function.h:311)
14 ReanimatedRNGHBug.debug.dylib 0x106d87700 std::__1::__function::__value_func<void (facebook::jsi::Runtime&)>::operator()[abi:de180100](facebook::jsi::Runtime&) const + 76 (function.h:428)
15 ReanimatedRNGHBug.debug.dylib 0x106d876a8 std::__1::function<void (facebook::jsi::Runtime&)>::operator()(facebook::jsi::Runtime&) const + 32 (function.h:981)
16 ReanimatedRNGHBug.debug.dylib 0x107310f80 worklets::JSScheduler::scheduleOnJS(std::__1::function<void (facebook::jsi::Runtime&)>)::$_0::operator()() const + 28 (JSScheduler.cpp:10)
17 ReanimatedRNGHBug.debug.dylib 0x107310f58 decltype(std::declval<worklets::JSScheduler::scheduleOnJS(std::__1::function<void (facebook::jsi::Runtime&)>)::$_0&>()()) std::__1::__invoke[abi:de180100]<worklets::JSScheduler::scheduleOnJS(std::__1::function<void (facebook::jsi::Runtime&)>)::$_0&>(worklets::JSScheduler::scheduleOnJS(std::__1::function<void (facebook::jsi::Runtime&)>)::$_0&) + 24 (invoke.h:344)
18 ReanimatedRNGHBug.debug.dylib 0x107310f10 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:de180100]<worklets::JSScheduler::scheduleOnJS(std::__1::function<void (facebook::jsi::Runtime&)>)::$_0&>(worklets::JSScheduler::scheduleOnJS(std::__1::function<void (facebook::jsi::Runtime&)>)::$_0&) + 24 (invoke.h:419)
19 ReanimatedRNGHBug.debug.dylib 0x107310eec std::__1::__function::__alloc_func<worklets::JSScheduler::scheduleOnJS(std::__1::function<void (facebook::jsi::Runtime&)>)::$_0, std::__1::allocator<worklets::JSScheduler::scheduleOnJS(std::__1::function<void (facebook::jsi::Runtime&)>)::$_0>, void ()>::operator()[abi:de180100]() + 28 (function.h:169)
20 ReanimatedRNGHBug.debug.dylib 0x10730fcc0 std::__1::__function::__func<worklets::JSScheduler::scheduleOnJS(std::__1::function<void (facebook::jsi::Runtime&)>)::$_0, std::__1::allocator<worklets::JSScheduler::scheduleOnJS(std::__1::function<void (facebook::jsi::Runtime&)>)::$_0>, void ()>::operator()() + 28 (function.h:311)
21 React 0x10d1013b0 std::__1::__function::__value_func<void ()>::operator()[abi:de180100]() const + 68
22 React 0x10d101360 std::__1::function<void ()>::operator()() const + 24
23 React 0x10d10133c facebook::react::CallInvoker::invokeAsync(std::__1::function<void ()>&&)::'lambda'(facebook::jsi::Runtime&)::operator()(facebook::jsi::Runtime&) const + 28
24 React 0x10d101314 decltype(std::declval<facebook::react::CallInvoker::invokeAsync(std::__1::function<void ()>&&)::'lambda'(facebook::jsi::Runtime&)&>()(std::declval<facebook::jsi::Runtime&>())) std::__1::__invoke[abi:de180100]<facebook::react::CallInvoker::invokeAsync(std::__1::function<void ()>&&)::'lambda'(facebook::jsi::Runtime&)&, facebook::jsi::Runtime&>(facebook::react::CallInvoker::invokeAsync(std::__1::function<void ()>&&)::'lambda'(facebook::jsi::Runtime&)&, facebook::jsi::Runtime&) + 32
25 React 0x10d1012c4 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:de180100]<facebook::react::CallInvoker::invokeAsync(std::__1::function<void ()>&&)::'lambda'(facebook::jsi::Runtime&)&, facebook::jsi::Runtime&>(facebook::react::CallInvoker::invokeAsync(std::__1::function<void ()>&&)::'lambda'(facebook::jsi::Runtime&)&, facebook::jsi::Runtime&) + 32
26 React 0x10d101298 std::__1::__function::__alloc_func<facebook::react::CallInvoker::invokeAsync(std::__1::function<void ()>&&)::'lambda'(facebook::jsi::Runtime&), std::__1::allocator<facebook::react::CallInvoker::invokeAsync(std::__1::function<void ()>&&)::'lambda'(facebook::jsi::Runtime&)>, void (facebook::jsi::Runtime&)>::operator()[abi:de180100](facebook::jsi::Runtime&) + 36
27 React 0x10d0fff1c std::__1::__function::__func<facebook::react::CallInvoker::invokeAsync(std::__1::function<void ()>&&)::'lambda'(facebook::jsi::Runtime&), std::__1::allocator<facebook::react::CallInvoker::invokeAsync(std::__1::function<void ()>&&)::'lambda'(facebook::jsi::Runtime&)>, void (facebook::jsi::Runtime&)>::operator()(facebook::jsi::Runtime&) + 36
28 React 0x10d105438 std::__1::__function::__value_func<void (facebook::jsi::Runtime&)>::operator()[abi:de180100](facebook::jsi::Runtime&) const + 76
29 React 0x10d1053e0 std::__1::function<void (facebook::jsi::Runtime&)>::operator()(facebook::jsi::Runtime&) const + 32
30 React 0x10d1053b4 facebook::react::RuntimeSchedulerCallInvoker::invokeAsync(std::__1::function<void (facebook::jsi::Runtime&)>&&)::$_0::operator()(facebook::jsi::Runtime&) const + 32
31 React 0x10d105388 decltype(std::declval<facebook::react::RuntimeSchedulerCallInvoker::invokeAsync(std::__1::function<void (facebook::jsi::Runtime&)>&&)::$_0&>()(std::declval<facebook::jsi::Runtime&>())) std::__1::__invoke[abi:de180100]<facebook::react::RuntimeSchedulerCallInvoker::invokeAsync(std::__1::function<void (facebook::jsi::Runtime&)>&&)::$_0&, facebook::jsi::Runtime&>(facebook::react::RuntimeSchedulerCallInvoker::invokeAsync(std::__1::function<void (facebook::jsi::Runtime&)>&&)::$_0&, facebook::jsi::Runtime&) + 32
32 React 0x10d105338 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:de180100]<facebook::react::RuntimeSchedulerCallInvoker::invokeAsync(std::__1::function<void (facebook::jsi::Runtime&)>&&)::$_0&, facebook::jsi::Runtime&>(facebook::react::RuntimeSchedulerCallInvoker::invokeAsync(std::__1::function<void (facebook::jsi::Runtime&)>&&)::$_0&, facebook::jsi::Runtime&) + 32
33 React 0x10d10530c std::__1::__function::__alloc_func<facebook::react::RuntimeSchedulerCallInvoker::invokeAsync(std::__1::function<void (facebook::jsi::Runtime&)>&&)::$_0, std::__1::allocator<facebook::react::RuntimeSchedulerCallInvoker::invokeAsync(std::__1::function<void (facebook::jsi::Runtime&)>&&)::$_0>, void (facebook::jsi::Runtime&)>::operator()[abi:de180100](facebook::jsi::Runtime&) + 36
34 React 0x10d103f94 std::__1::__function::__func<facebook::react::RuntimeSchedulerCallInvoker::invokeAsync(std::__1::function<void (facebook::jsi::Runtime&)>&&)::$_0, std::__1::allocator<facebook::react::RuntimeSchedulerCallInvoker::invokeAsync(std::__1::function<void (facebook::jsi::Runtime&)>&&)::$_0>, void (facebook::jsi::Runtime&)>::operator()(facebook::jsi::Runtime&) + 36
35 React 0x10d105438 std::__1::__function::__value_func<void (facebook::jsi::Runtime&)>::operator()[abi:de180100](facebook::jsi::Runtime&) const + 76
36 React 0x10d1053e0 std::__1::function<void (facebook::jsi::Runtime&)>::operator()(facebook::jsi::Runtime&) const + 32
37 React 0x10d126424 facebook::react::Task::execute(facebook::jsi::Runtime&, bool) + 592
38 React 0x10d11b5fc facebook::react::RuntimeScheduler_Modern::executeTask(facebook::jsi::Runtime&, facebook::react::Task&, bool) const + 160
39 React 0x10d11c144 facebook::react::RuntimeScheduler_Modern::runEventLoopTick(facebook::jsi::Runtime&, facebook::react::Task&) + 244
40 React 0x10d11be74 facebook::react::RuntimeScheduler_Modern::runEventLoop(facebook::jsi::Runtime&) + 168
41 React 0x10d1254e0 facebook::react::RuntimeScheduler_Modern::scheduleEventLoop()::$_0::operator()(facebook::jsi::Runtime&) const + 36
42 React 0x10d1254b0 decltype(std::declval<facebook::react::RuntimeScheduler_Modern::scheduleEventLoop()::$_0&>()(std::declval<facebook::jsi::Runtime&>())) std::__1::__invoke[abi:de180100]<facebook::react::RuntimeScheduler_Modern::scheduleEventLoop()::$_0&, facebook::jsi::Runtime&>(facebook::react::RuntimeScheduler_Modern::scheduleEventLoop()::$_0&, facebook::jsi::Runtime&) + 32
43 React 0x10d125460 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:de180100]<facebook::react::RuntimeScheduler_Modern::scheduleEventLoop()::$_0&, facebook::jsi::Runtime&>(facebook::react::RuntimeScheduler_Modern::scheduleEventLoop()::$_0&, facebook::jsi::Runtime&) + 32
44 React 0x10d125434 std::__1::__function::__alloc_func<facebook::react::RuntimeScheduler_Modern::scheduleEventLoop()::$_0, std::__1::allocator<facebook::react::RuntimeScheduler_Modern::scheduleEventLoop()::$_0>, void (facebook::jsi::Runtime&)>::operator()[abi:de180100](facebook::jsi::Runtime&) + 36
45 React 0x10d1242c0 std::__1::__function::__func<facebook::react::RuntimeScheduler_Modern::scheduleEventLoop()::$_0, std::__1::allocator<facebook::react::RuntimeScheduler_Modern::scheduleEventLoop()::$_0>, void (facebook::jsi::Runtime&)>::operator()(facebook::jsi::Runtime&) + 36
46 React 0x10d1adc90 std::__1::__function::__value_func<void (facebook::jsi::Runtime&)>::operator()[abi:de180100](facebook::jsi::Runtime&) const + 76
47 React 0x10d1abdf8 std::__1::function<void (facebook::jsi::Runtime&)>::operator()(facebook::jsi::Runtime&) const + 32
48 React 0x10d1aba78 _ZZZN8facebook5react13ReactInstanceC1ENSt3__110unique_ptrINS0_9JSRuntimeENS2_14default_deleteIS4_EEEENS2_10shared_ptrINS0_18MessageQueueThreadEEENS8_INS0_12TimerManagerEEENS2_8functionIFvRNS_3jsi7RuntimeERKNS0_14JsErrorHandler14ProcessedErrorEEEEPNS0_18jsinspector_modern10HostTargetEENK3$_0clINSD_IFvSG_EEEEEDaT_ENKUlvE_clEv + 148
49 React 0x10d1ab9d8 _ZNSt3__18__invokeB8de180100IRZZN8facebook5react13ReactInstanceC1ENS_10unique_ptrINS2_9JSRuntimeENS_14default_deleteIS5_EEEENS_10shared_ptrINS2_18MessageQueueThreadEEENS9_INS2_12TimerManagerEEENS_8functionIFvRNS1_3jsi7RuntimeERKNS2_14JsErrorHandler14ProcessedErrorEEEEPNS2_18jsinspector_modern10HostTargetEENK3$_0clINSE_IFvSH_EEEEEDaT_EUlvE_JEEEDTclclsr3stdE7declvalISW_EEspclsr3stdE7declvalIT0_EEEEOSW_DpOSZ_ + 24
50 React 0x10d1ab990 _ZNSt3__128__invoke_void_return_wrapperIvLb1EE6__callB8de180100IJRZZN8facebook5react13ReactInstanceC1ENS_10unique_ptrINS4_9JSRuntimeENS_14default_deleteIS7_EEEENS_10shared_ptrINS4_18MessageQueueThreadEEENSB_INS4_12TimerManagerEEENS_8functionIFvRNS3_3jsi7RuntimeERKNS4_14JsErrorHandler14ProcessedErrorEEEEPNS4_18jsinspector_modern10HostTargetEENK3$_0clINSG_IFvSJ_EEEEEDaT_EUlvE_EEEvDpOT_ + 24
51 React 0x10d1ab96c _ZNSt3__110__function12__alloc_funcIZZN8facebook5react13ReactInstanceC1ENS_10unique_ptrINS3_9JSRuntimeENS_14default_deleteIS6_EEEENS_10shared_ptrINS3_18MessageQueueThreadEEENSA_INS3_12TimerManagerEEENS_8functionIFvRNS2_3jsi7RuntimeERKNS3_14JsErrorHandler14ProcessedErrorEEEEPNS3_18jsinspector_modern10HostTargetEENK3$_0clINSF_IFvSI_EEEEEDaT_EUlvE_NS_9allocatorISY_EEFvvEEclB8de180100Ev + 28
52 React 0x10d1aa6a4 _ZNSt3__110__function6__funcIZZN8facebook5react13ReactInstanceC1ENS_10unique_ptrINS3_9JSRuntimeENS_14default_deleteIS6_EEEENS_10shared_ptrINS3_18MessageQueueThreadEEENSA_INS3_12TimerManagerEEENS_8functionIFvRNS2_3jsi7RuntimeERKNS3_14JsErrorHandler14ProcessedErrorEEEEPNS3_18jsinspector_modern10HostTargetEENK3$_0clINSF_IFvSI_EEEEEDaT_EUlvE_NS_9allocatorISY_EEFvvEEclEv + 28
53 React 0x10c9d1ee8 std::__1::__function::__value_func<void ()>::operator()[abi:de180100]() const + 68
54 React 0x10c9d1e08 std::__1::function<void ()>::operator()() const + 24
55 React 0x10ca6492c facebook::react::tryAndReturnError(std::__1::function<void ()> const&) + 24
56 React 0x10ca4d140 facebook::react::RCTMessageThread::tryFunc(std::__1::function<void ()> const&) + 36
57 React 0x10ca51ea8 facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_0::operator()() const + 80
58 React 0x10ca51e4c decltype(std::declval<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_0&>()()) std::__1::__invoke[abi:de180100]<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_0&>(facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_0&) + 24
59 React 0x10ca51e04 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:de180100]<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_0&>(facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_0&) + 24
60 React 0x10ca51de0 std::__1::__function::__alloc_func<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_0, std::__1::allocator<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_0>, void ()>::operator()[abi:de180100]() + 28
61 React 0x10ca50b00 std::__1::__function::__func<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_0, std::__1::allocator<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_0>, void ()>::operator()() + 28
62 React 0x10c9d1ee8 std::__1::__function::__value_func<void ()>::operator()[abi:de180100]() const + 68
63 React 0x10c9d1e08 std::__1::function<void ()>::operator()() const + 24
64 React 0x10ca4ced8 invocation function for block in facebook::react::RCTMessageThread::runAsync(std::__1::function<void ()>) + 48
65 CoreFoundation 0x18041d06c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 20
66 CoreFoundation 0x18041c7a4 __CFRunLoopDoBlocks + 352
67 CoreFoundation 0x1804174bc __CFRunLoopRun + 2364
68 CoreFoundation 0x180416704 CFRunLoopRunSpecific + 552
69 React 0x10d240508 +[RCTJSThreadManager runRunLoop] + 292
70 Foundation 0x180f462d8 __NSThread__start__ + 720
71 libsystem_pthread.dylib 0x10419f6f8 _pthread_start + 104
72 libsystem_pthread.dylib 0x10419a940 thread_start + 8
...
TLDR:
//This works! (Notice that we use only first argument, it also works without any arguments)
nativeGesture.onTouchesDown((e) => {
"worklet";
console.log("hi from worklet", e);
runOnJS(onTouchJS)();
});
// This doesn't work! I discovered that using (...args) rest operator in my app code
nativeGesture.onTouchesDown((e, manager) => {
"worklet";
console.log("hi from worklet", e, manager);
runOnJS(onTouchJS)();
});
Error from the XCode debugger:
Debugger console:
STDERR
E1108 00:10:58.400416 1851846656 Serializable.cpp:10] react_native_assert failure: valueUnpacker.isObject() && "valueUnpacker not found"
Assertion failed: (valueUnpacker.isObject() && "valueUnpacker not found"), function getValueUnpacker, file Serializable.cpp, line 10.
Looks like we're checking for __valueUnpacker property in the global object even for the new architecture for some reason.
Call stack screen from the XCode Debugger:
May be fixed by #8555
Steps to reproduce
- Build app
- Open app
- Press on the yellow scroll view
Snack or a link to a repository
https://github.com/TMaszko/ReanimatedRNGHBug
Reanimated version
4.1.3
Worklets version
0.6.1
React Native version
0.81.5
Platforms
iOS
JavaScript runtime
Hermes
Workflow
Expo Dev Client
Architecture
New Architecture (Fabric renderer)
Reanimated feature flags
None
React Native release level
Stable
Build type
Debug app & dev bundle
Device
iOS simulator
Host machine
macOS
Device model
iPhone 16 Pro iOS 18.3
Acknowledgements
Yes
cc @tjzel
Thanks for the report @TMaszko. I'm aware of this issue and the PR you linked is actually addressing it. The reason for the crash is that there's a code path that looks for the valueUnpacker on the RN Runtime when it shouldn't.
When executing this line:
console.log("hi from worklet", e, manager);
if I recall correctly, the problem is that the manager object isn't serializable and instead of throwing an error we go through the fallback that tries to invoke valueUnpacker on the wrong runtime.
@tjzel That was also my guess ;) Thanks for the explanation !