realm / realm-js

Realm is a mobile database: an alternative to SQLite & key-value stores
https://realm.io
Apache License 2.0
5.62k stars 558 forks source link

[iOS][Expo SDK 46] SIGTRAP/SIGILL crash on Release Build Configuration #4735

Closed thespacemanatee closed 1 year ago

thespacemanatee commented 1 year ago

Description

After upgrading to Expo SDK 46 beta-6, we started getting a fatal crash on launch on iOS Release Configuration builds with realm@11.0.0-rc.1 and hermes enabled. We managed to reproduce this crash 100% of the time on all Apple devices and simulators that we have tried, and on iOS 14/15.

Stacktrace & log output

```

Translated Report (Full Report Below)

Incident Identifier: 2CB231A5-1C1C-4F62-B740-917566BF7B41 CrashReporter Key: 958937CA-AE6A-3DEE-5690-64CE79CEB162 Hardware Model: MacBookPro18,3 Process: exporepro18317 [50036] Path: /Users/USER/Library/Developer/CoreSimulator/Devices/18E2A611-92EA-4CA2-9D5C-6EF8793B6E39/data/Containers/Bundle/Application/57D7F7C5-E9F0-40EA-82DE-ADC91BBA095C/exporepro18317.app/exporepro18317 Identifier: com.exporepro18317.exporepro18317 Version: 1.0.0 (1) Code Type: ARM-64 (Native) Role: Foreground Parent Process: launchd_sim [75757] Coalition: com.apple.CoreSimulator.SimDevice.18E2A611-92EA-4CA2-9D5C-6EF8793B6E39 [25352] Responsible Process: SimulatorTrampoline [4038]

Date/Time: 2022-07-21 23:24:28.9015 +0800 Launch Time: 2022-07-21 23:24:28.7664 +0800 OS Version: macOS 12.4 (21F79) Release Type: User Report Version: 104

Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0000000000000001, 0x00000001026b75dc Exception Note: EXC_CORPSE_NOTIFY Termination Reason: SIGNAL 5 Trace/BPT trap: 5 Terminating Process: exc handler [50036]

Triggered by Thread: 9

Thread 0:: Dispatch queue: com.apple.main-thread 0 UIKitCore 0x1852ea448 ﹍[UIView(Animation) performWithoutAnimation:]﹍ 0 1 UIKitCore 0x184bbb668 ﹍[UIRemoteKeyboardWindow remoteKeyboardWindowForScreen:create:]﹍ 264 2 UIKitCore 0x184bc1b2c __44-[_UIRemoteKeyboards applicationWillResume:]_block_invoke + 172 3 libdispatch.dylib 0x18010ea98 _dispatch_client_callout + 16 4 libdispatch.dylib 0x180112268 _dispatch_block_invoke_direct + 244 5 FrontBoardServices 0x1861b8074 FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK

Thread 1: 0 libsystem_pthread.dylib 0x1cc0ac8fc start_wqthread + 0

Thread 2:: Dispatch queue: com.facebook.react.ShadowQueue 0 libdispatch.dylib 0x18010fff8 dispatch_once + 0 1 exporepro18317 0x1025dd5f8 dispatch_once + 16 (once.h:84) [inlined] 2 exporepro18317 0x1025dd5f8 ﹍[RCTI18nUtil sharedInstance]﹍ 112 (RCTI18nUtil.m:18) 3 exporepro18317 0x1025f43f8 -[RCTRootShadowView init] + 72 (RCTRootShadowView.m:18) 4 exporepro18317 0x10260fe14 __33-[RCTUIManager registerRootView:]_block_invoke + 52 (RCTUIManager.m:326) 5 libdispatch.dylib 0x18010d244 _dispatch_call_block_and_release + 24 6 libdispatch.dylib 0x18010ea98 _dispatch_client_callout + 16 7 libdispatch.dylib 0x180115acc _dispatch_lane_serial_drain + 652 8 libdispatch.dylib 0x180116648 _dispatch_lane_invoke + 400 9 libdispatch.dylib 0x180120e10 _dispatch_workloop_worker_thread + 736 10 libsystem_pthread.dylib 0x1cc0adb40 _pthread_wqthread + 284 11 libsystem_pthread.dylib 0x1cc0ac904 start_wqthread + 8

Thread 3: 0 libsystem_pthread.dylib 0x1cc0ac8fc start_wqthread + 0

Thread 4: 0 libsystem_pthread.dylib 0x1cc0ac8fc start_wqthread + 0

Thread 5:: Dispatch queue: com.apple.root.user-interactive-qos 0 hermes 0x10402de28 0x103f54000 + 892456 1 hermes 0x103f758f4 0x103f54000 + 137460 2 hermes 0x103f5ca14 0x103f54000 + 35348 3 exporepro18317 0x1026b61c0 facebook::jsi::RuntimeDecorator<facebook::jsi::Runtime, facebook::jsi::Runtime>::call(facebook::jsi::Function const&, facebook::jsi::Value const&, facebook::jsi::Value const, unsigned long) + 36 (decorator.h:300) [inlined] 4 exporepro18317 0x1026b61c0 facebook::jsi::WithRuntimeDecorator<facebook::react::(anonymous namespace)::ReentrancyCheck, facebook::jsi::Runtime, facebook::jsi::Runtime>::call(facebook::jsi::Function const&, facebook::jsi::Value const&, facebook::jsi::Value const, unsigned long) + 96 (decorator.h:703) 5 exporepro18317 0x102534478 facebook::jsi::Function::callWithThis(facebook::jsi::Runtime&, facebook::jsi::Object const&, facebook::jsi::Value const*, unsigned long) const + 68 (jsi-inl.h:249) [inlined] 6 exporepro18317 0x102534478 facebook::jsi::Function::callWithThis(facebook::jsi::Runtime&, facebook::jsi::Object const&, std::initializerlist) const + 68 (jsi-inl.h:256) [inlined] 7 exporepro18317 0x102534478 -[EXJavaScriptObject defineProperty:value:options:] + 480 (EXJavaScriptObject.mm:94) 8 exporepro18317 0x10253b444 ﹍[EXJavaScriptRuntimeManager installExpoModulesHostObject:]﹍ 300 (EXJSIInstaller.mm:49) 9 exporepro18317 0x102574e0c $s15ExpoModulesCore10AppContextC07installaB10HostObjectyyKF + 28 (AppContext.swift:290) [inlined] 10 exporepro18317 0x102574e0c $s15ExpoModulesCore10AppContextC7runtimeSo19EXJavaScriptRuntimeCSgvW + 32 (AppContext.swift:57) [inlined] 11 exporepro18317 0x102574e0c $s15ExpoModulesCore10AppContextC7runtimeSo19EXJavaScriptRuntimeCSgvs + 32 [inlined] 12 exporepro18317 0x102574e0c ExpoBridgeModule.javaScriptWillStartExecutingNotification(:) + 564 (ExpoBridgeModule.swift:76) 13 exporepro18317 0x102575014 @objc ExpoBridgeModule.javaScriptWillStartExecutingNotification(_:) + 112 14 CoreFoundation 0x180332f90 CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER

Thread 6:: com.apple.uikit.eventfetch-thread 0 libsystem_kernel.dylib 0x1cc055fcc mach_msg_trap + 8 1 libsystem_kernel.dylib 0x1cc056430 mach_msg + 72 2 CoreFoundation 0x18036176c CFRunLoopServiceMachPort + 368 3 CoreFoundation 0x18035bb78 CFRunLoopRun + 1096 4 CoreFoundation 0x18035b218 CFRunLoopRunSpecific + 572 5 Foundation 0x180827828 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 232 6 Foundation 0x180827ae0 -[NSRunLoop(NSRunLoop) runUntilDate:] + 88 7 UIKitCore 0x184e3f01c -[UIEventFetcher threadMain] + 472 8 Foundation 0x180851578 NSThread__start

Thread 7: 0 libsystem_pthread.dylib 0x1cc0ac8fc start_wqthread + 0

Thread 8: 0 libsystem_pthread.dylib 0x1cc0ac8fc start_wqthread + 0

Thread 9 Crashed:: com.facebook.react.JavaScript 0 exporepro18317 0x1026b75dc facebook::react::(anonymous namespace)::ReentrancyCheck::before() + 8 (HermesExecutorFactory.cpp:123) [inlined] 1 exporepro18317 0x1026b75dc facebook::jsi::detail::BeforeCaller<facebook::react::(anonymous namespace)::ReentrancyCheck, void>::before(facebook::react::(anonymous namespace)::ReentrancyCheck&) + 8 (decorator.h:418) [inlined] 2 exporepro18317 0x1026b75dc facebook::jsi::WithRuntimeDecorator<facebook::react::(anonymous namespace)::ReentrancyCheck, facebook::jsi::Runtime, facebook::jsi::Runtime>::Around::Around(facebook::react::(anonymous namespace)::ReentrancyCheck&) + 8 (decorator.h:743) [inlined] 3 exporepro18317 0x1026b75dc facebook::jsi::WithRuntimeDecorator<facebook::react::(anonymous namespace)::ReentrancyCheck, facebook::jsi::Runtime, facebook::jsi::Runtime>::Around::Around(facebook::react::(anonymous namespace)::ReentrancyCheck&) + 112 (decorator.h:742) 4 exporepro18317 0x1026b7588 std::1::libcpp_thread_get_current_id() + 4 (threading_support:426) [inlined] 5 exporepro18317 0x1026b7588 std::1::this_thread::get_id() + 4 (threading_support:715) [inlined] 6 exporepro18317 0x1026b7588 facebook::react::(anonymous namespace)::ReentrancyCheck::before() + 4 (HermesExecutorFactory.cpp:87) [inlined] 7 exporepro18317 0x1026b7588 facebook::jsi::detail::BeforeCaller<facebook::react::(anonymous namespace)::ReentrancyCheck, void>::before(facebook::react::(anonymous namespace)::ReentrancyCheck&) + 4 (decorator.h:418) [inlined] 8 exporepro18317 0x1026b7588 facebook::jsi::WithRuntimeDecorator<facebook::react::(anonymous namespace)::ReentrancyCheck, facebook::jsi::Runtime, facebook::jsi::Runtime>::Around::Around(facebook::react::(anonymous namespace)::ReentrancyCheck&) + 8 (decorator.h:743) [inlined] 9 exporepro18317 0x1026b7588 facebook::jsi::WithRuntimeDecorator<facebook::react::(anonymous namespace)::ReentrancyCheck, facebook::jsi::Runtime, facebook::jsi::Runtime>::Around::Around(facebook::react::(anonymous namespace)::ReentrancyCheck&) + 28 (decorator.h:742) 10 exporepro18317 0x1026b5400 facebook::jsi::WithRuntimeDecorator<facebook::react::(anonymous namespace)::ReentrancyCheck, facebook::jsi::Runtime, facebook::jsi::Runtime>::createStringFromAscii(char const, unsigned long) + 48 (decorator.h:574) 11 exporepro18317 0x10272f9e4 facebook::jsi::Value facebook::jsi::Function::call<char const (&) [11], std::1::basic_string<char, std::1::char_traits, std::1::allocator > >(facebook::jsi::Runtime&, char const (&) [11], std::1::basic_string<char, std::1::char_traits, std::*1::allocator >&&) const + 96 12 exporepro18317 0x102720ecc realm::js::realmjsi::ObjectWrap<realm::js::ObservableClass >::create_constructor(realm::js::JsiEnv) + 548 13 exporepro18317 0x10271eb70 realm::js::RealmClass::create_constructor(realm::js::JsiEnv) + 44 14 exporepro18317 0x10271e9ac realm_jsi_init + 184 15 exporepro18317 0x102701700 24-[RealmReact setBridge:]_block_invoke + 408 (RealmReact.mm:156) 16 exporepro18317 0x1025d7ae0 std::1::function::value_func<void ()>::operator()() const + 20 (function.h:505) [inlined] 17 exporepro18317 0x1025d7ae0 std::1::function<void ()>::operator()() const + 20 (function.h:1182) [inlined] 18 exporepro18317 0x1025d7ae0 facebook::react::tryAndReturnError(std::1::function<void ()> const&) + 32 (RCTCxxUtils.mm:74) 19 exporepro18317 0x1025cc604 -[RCTCxxBridge _tryAndHandleError:] + 100 (RCTCxxBridge.mm:344) 20 Foundation 0x180851928 NSThreadPerformPerform + 164 21 CoreFoundation 0x180362234 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION

Thread 10:: hades 0 libsystem_kernel.dylib 0x1cc059694 __psynch_cvwait + 8 1 libsystem_pthread.dylib 0x1cc0b1c88 _pthread_cond_wait + 1224 2 libc++.1.dylib 0x18026718c std::1::condition_variable::wait(std::1::unique_lock&) + 24 3 hermes 0x104063934 0x103f54000 + 1112372 4 hermes 0x1040636e8 0x103f54000 + 1111784 5 libsystem_pthread.dylib 0x1cc0b16c8 _pthread_start + 116 6 libsystem_pthread.dylib 0x1cc0ac910 thread_start + 8

Thread 11:: hermes-chrome-inspector-conn 0 libsystem_kernel.dylib 0x1cc059694 psynch_cvwait + 8 1 libsystem_pthread.dylib 0x1cc0b1c88 _pthread_cond_wait + 1224 2 libc++.1.dylib 0x18026718c std::1::condition_variable::wait(std::1::unique_lock&) + 24 3 exporepro18317 0x1026de204 void std::1::condition_variable::wait<facebook::hermes::inspector::detail::SerialExecutor::runLoop()::$_1>(std::1::unique_lock<std::1::mutex>&, facebook::hermes::inspector::detail::SerialExecutor::runLoop()::$_1) + 28 (mutex_base:404) [inlined] 4 exporepro18317 0x1026de204 facebook::hermes::inspector::detail::SerialExecutor::runLoop() + 120 (SerialExecutor.cpp:41) 5 exporepro18317 0x1026a1adc decltype(staticcast<void (>(fp)(static_cast<std::1::basic_string<char, std::1::char_traits, std::1::allocator >>(fp0), static_cast<std::1::function<void ()>>(fp0))) std::1::invoke<void (_)(std::1::basic_string<char, std::1::char_traits, std::1::allocator >, std::1::function<void ()>), std::1::basic_string<char, std::1::char_traits, std::1::allocator >, std::1::function<void ()> >(void (&&)(std::1::basic_string<char, std::1::char_traits, std::1::allocator >, std::1::function<void ()>), std::1::basic_string<char, std::1::char_traits, std::1::allocator >&&, std::1::function<void ()>&&) + 52 (type_traits:3918) [inlined] 6 exporepro18317 0x1026a1adc void std::1::thread_execute<std::1::unique_ptr<std::1::thread_struct, std::1::default_delete<std::1::thread_struct> >, void ()(std::1::basic_string<char, std::1::char_traits, std::1::allocator >, std::1::function<void ()>), std::1::basic_string<char, std::1::char_traits, std::1::allocator >, std::1::function<void ()>, 2ul, 3ul>(std::1::tuple<std::1::unique_ptr<std::1::thread_struct, std::1::default_delete<std::1::thread_struct> >, void ()(std::1::basic_string<char, std::1::char_traits, std::1::allocator >, std::1::function<void ()>), std::1::basic_string<char, std::1::char_traits, std::1::allocator >, std::1::function<void ()> >&, std::1::__tuple_indices<2ul, 3ul>) + 56 (thread:287) [inlined] 7 exporepro18317 0x1026a1adc void std::1::thread_proxy<std::1::tuple<std::1::unique_ptr<std::1::thread_struct, std::1::default_delete<std::1::thread_struct> >, void ()(std::1::basic_string<char, std::__1::char_traits, std::1::allocator >, std::1::function<void ()>), std::1::basic_string<char, std::__1::char_traits, std::1::allocator >, std::1::function<void ()> > >(void) + 116 (thread:298) 8 libsystem_pthread.dylib 0x1cc0b16c8 _pthread_start + 116 9 libsystem_pthread.dylib 0x1cc0ac910 thread_start + 8

Thread 12:: hermes-inspector 0 libsystem_kernel.dylib 0x1cc059694 psynch_cvwait + 8 1 libsystem_pthread.dylib 0x1cc0b1c88 _pthread_cond_wait + 1224 2 libc++.1.dylib 0x18026718c std::1::condition_variable::wait(std::1::unique_lock&) + 24 3 exporepro18317 0x1026de204 void std::1::condition_variable::wait<facebook::hermes::inspector::detail::SerialExecutor::runLoop()::$_1>(std::1::unique_lock<std::1::mutex>&, facebook::hermes::inspector::detail::SerialExecutor::runLoop()::$_1) + 28 (mutex_base:404) [inlined] 4 exporepro18317 0x1026de204 facebook::hermes::inspector::detail::SerialExecutor::runLoop() + 120 (SerialExecutor.cpp:41) 5 exporepro18317 0x1026a1adc decltype(staticcast<void (>(fp)(static_cast<std::1::basic_string<char, std::1::char_traits, std::1::allocator >>(fp0), static_cast<std::1::function<void ()>>(fp0))) std::1::invoke<void (_)(std::1::basic_string<char, std::1::char_traits, std::1::allocator >, std::1::function<void ()>), std::1::basic_string<char, std::1::char_traits, std::1::allocator >, std::1::function<void ()> >(void (&&)(std::1::basic_string<char, std::1::char_traits, std::1::allocator >, std::1::function<void ()>), std::1::basic_string<char, std::1::char_traits, std::1::allocator >&&, std::1::function<void ()>&&) + 52 (type_traits:3918) [inlined] 6 exporepro18317 0x1026a1adc void std::1::thread_execute<std::1::unique_ptr<std::1::thread_struct, std::1::default_delete<std::1::thread_struct> >, void ()(std::1::basic_string<char, std::1::char_traits, std::1::allocator >, std::1::function<void ()>), std::1::basic_string<char, std::1::char_traits, std::1::allocator >, std::1::function<void ()>, 2ul, 3ul>(std::1::tuple<std::1::unique_ptr<std::1::thread_struct, std::1::default_delete<std::1::thread_struct> >, void ()(std::1::basic_string<char, std::1::char_traits, std::1::allocator >, std::1::function<void ()>), std::1::basic_string<char, std::1::char_traits, std::1::allocator >, std::1::function<void ()> >&, std::1::__tuple_indices<2ul, 3ul>) + 56 (thread:287) [inlined] 7 exporepro18317 0x1026a1adc void std::1::thread_proxy<std::1::tuple<std::1::unique_ptr<std::1::thread_struct, std::1::default_delete<std::1::thread_struct> >, void ()(std::1::basic_string<char, std::__1::char_traits, std::1::allocator >, std::1::function<void ()>), std::1::basic_string<char, std::__1::char_traits, std::1::allocator >, std::1::function<void ()> > >(void) + 116 (thread:298) 8 libsystem_pthread.dylib 0x1cc0b16c8 _pthread_start + 116 9 libsystem_pthread.dylib 0x1cc0ac910 thread_start + 8

Thread 9 crashed with ARM Thread State (64-bit): x0: 0x000000016de0f000 x1: 0x0000600003cb1d88 x2: 0x000000000000000a x3: 0x00000001cc0a2b0b x4: 0x0000000001000008 x5: 0x0000000000000030 x6: 0x0000000000000000 x7: 0x0000000107ffcccc x8: 0x000000016dbdf000 x9: 0xa3bcaf80f146c3c5 x10: 0x0000000000179f41 x11: 0x00000000000b37f0 x12: 0x0000000149600000 x13: 0x0000000000000000 x14: 0x00000000006d17d5 x15: 0x0000000000e2c6c0 x16: 0x00000001cc0ad2c8 x17: 0x000000000000e2c6 x18: 0x0000000000000000 x19: 0x000000016de0d778 x20: 0x0000600003cb1d88 x21: 0x0000600003cb1d58 x22: 0x000000016de0d7b8 x23: 0x0000000102c6dab5 x24: 0x0000600000d9ae40 x25: 0x000000014a83d048 x26: 0x000000002b3100d5 x27: 0x0000000102d80000 x28: 0x00000001da9cf000 fp: 0x000000016de0d760 lr: 0x00000001026b7588 sp: 0x000000016de0d750 pc: 0x00000001026b75dc cpsr: 0x20001000 far: 0x000000010272f984 esr: 0xf2000001 (Breakpoint) brk 1

Binary Images: 0x18417b000 - 0x18560dfff com.apple.UIKitCore (1.0) <7bbc9f13-df06-3c47-9a63-8483442bdfcb> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore 0x18010b000 - 0x18014dfff libdispatch.dylib :star: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libdispatch.dylib 0x18615d000 - 0x1861e6fff com.apple.FrontBoardServices (765.10) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/FrontBoardServices.framework/FrontBoardServices 0x1802dc000 - 0x18068bfff com.apple.CoreFoundation (6.9) <673c8a21-98bf-38f0-a038-55ab0de23142> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 0x18c25c000 - 0x18c264fff com.apple.GraphicsServices (1.0) <9334a354-2177-30b1-b919-4fecf59fef22> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices 0x1024d8000 - 0x102ccffff com.exporepro18317.exporepro18317 (1.0.0) /Users/USER/Library/Developer/CoreSimulator/Devices/18E2A611-92EA-4CA2-9D5C-6EF8793B6E39/data/Containers/Bundle/Application/57D7F7C5-E9F0-40EA-82DE-ADC91BBA095C/exporepro18317.app/exporepro18317 0x103638000 - 0x103673fff dyld_sim :star: <67298116-bb18-3438-b22e-8d2b9d4618e9> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/dyld_sim 0x1036d4000 - 0x103733fff dyld :star: /usr/lib/dyld 0x1cc0aa000 - 0x1cc0b6fff libsystem_pthread.dylib :star: /usr/lib/system/libsystem_pthread.dylib 0x103f54000 - 0x1041e7fff dev.hermesengine.iphonesimulator (0.11.0) <2c03abcd-37c8-3282-9295-30ebb35366e4> /Users/USER/Library/Developer/CoreSimulator/Devices/18E2A611-92EA-4CA2-9D5C-6EF8793B6E39/data/Containers/Bundle/Application/57D7F7C5-E9F0-40EA-82DE-ADC91BBA095C/exporepro18317.app/Frameworks/hermes.framework/hermes 0x180700000 - 0x1809c3fff com.apple.Foundation (6.9) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework/Foundation 0x1cc055000 - 0x1cc08afff libsystem_kernel.dylib :star: /usr/lib/system/libsystem_kernel.dylib 0x18025b000 - 0x1802b6fff libc++.1.dylib :star: <03a5f91e-2bc5-3d4f-b91f-729633a08579> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libc++.1.dylib

EOF



### Can you reproduce a bug?
Yes, always

### Reproduction Steps
Minimal repro can be found [here](https://github.com/thespacemanatee/realm-repro-4735).

### Version
11.0.0-rc.1

### What SDK flavour are you using?
Atlas App Services (auth, functions, etc.)

### Are you using encryption?
No, not using encryption

### Platform OS and version(s)
All iOS versions
takameyer commented 1 year ago

@thespacemanatee Thanks for reporting this. I tried to open a link to the reproduction repo, but it is leading to a 404 page. Can you ensure that it is publicly available?

thespacemanatee commented 1 year ago

@takameyer sorry about that, it should be public now 😄

thespacemanatee commented 1 year ago

@takameyer update the repro to remove expo-dev-client, the issue appears on Bare workflow as well. Lmk if you need any more information or if it's not reproducible, thanks!

tomduncalf commented 1 year ago

Hi @thespacemanatee, I'm struggling to build your project, I get these errors:

    CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'ExpoModulesCore' from project 'Pods')
    CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'ExpoModulesCore' from project 'Pods')
    PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/tom.duncalf/Library/Developer/Xcode/DerivedData/exporealmrepro-eyijfdcsfscaavdedpzbpkeflfgc/Build/Intermediates.noindex/Pods.build/Release-iphonesimulator/FBReactNativeSpec.build/Script-46EB2E000111B0.sh (in target 'FBReactNativeSpec' from project 'Pods')

Could you confirm which Xcode and node versions you are using?

thespacemanatee commented 1 year ago

@tomduncalf Would this help? I am using Macbook Pro 14 M1 chip.

expo-env-info 1.0.5 environment info:
    System:
      OS: macOS 12.5
      Shell: 5.8.1 - /bin/zsh
    Binaries:
      Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node
      Yarn: 1.22.19 - ~/.nvm/versions/node/v16.15.1/bin/yarn
      npm: 8.13.1 - ~/.nvm/versions/node/v16.15.1/bin/npm
      Watchman: 2022.07.04.00 - /opt/homebrew/bin/watchman
    Managers:
      CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
    IDEs:
      Android Studio: Electric Eel 2022.1.1 Canary 8 Electric Eel 2022.1.1 Canary 8
      Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
    npmPackages:
      expo: ^46.0.1 => 46.0.1 
      react: 18.2.0 => 18.2.0 
      react-dom: 18.2.0 => 18.2.0 
      react-native: 0.69.3 => 0.69.3 
      react-native-web: ~0.18.7 => 0.18.7 
    Expo Workflow: bare
tomduncalf commented 1 year ago

@thespacemanatee Ah thanks, perhaps it is related to the M1, I have an Intel Mac here but do have access to an M1 so will see if I can build it there

tomduncalf commented 1 year ago

Thanks for that, I wasn't able to build on my M1 but a few of my packages on my Intel Mac were outdated compared to yours. I upgraded them and it now builds (I also had to fix the path in https://github.com/thespacemanatee/realm-repro-4735/blob/with-realm/ios/.xcode.env.local)

I'm able to reproduce this issue in Release mode, I can't repro it in Debug mode annoyingly. We will investigate this issue and see if we can work out what is going on and update you once we have something.

thespacemanatee commented 1 year ago

@tomduncalf No worries and thanks for the update! Will keep in mind config issues for future repros 😅

thespacemanatee commented 1 year ago

@tomduncalf Just wanted to check if there's any progress made on this issue (don't see anyone assigned/needs attention label). We are releasing our app to the store soon and would be great to run hermes on both Android and iOS before that happens 😄

thespacemanatee commented 1 year ago

Thanks for that, I wasn't able to build on my M1 but a few of my packages on my Intel Mac were outdated compared to yours. I upgraded them and it now builds (I also had to fix the path in https://github.com/thespacemanatee/realm-repro-4735/blob/with-realm/ios/.xcode.env.local)

I'm able to reproduce this issue in Release mode, I can't repro it in Debug mode annoyingly. We will investigate this issue and see if we can work out what is going on and update you once we have something.

@tomduncalf any updates? We're waiting out for this issue before making our first app store release.

thespacemanatee commented 1 year ago

@tomduncalf @takameyer @kneth now that RN 0.70.0 is out and hermes is enabled by default, and with our release delayed a couple of months, can someone give us a response so that we can have a better expectation of the timeline? We are paying Realm customers as well.

kneth commented 1 year ago

@thespacemanatee We can't give an exact timeline but we are currently working on the next release candidate.

Moreover, we have outlined what will come in v11: https://github.com/realm/realm-js/discussions/4839

haikov commented 1 year ago

Just noting here that I'm facing the same issue with Expo 0.46 (with hermes enabled) and Realm 11.0.0-rc.1. Everything works flawlessly in debug mode, but as soon as the app is build in release mode locally (using --configuration Release flag) or via EAS build the app crashes on start. It actually behaves weirdly: it always starts correctly on the first try after fresh install, but most of the subsequent app launches fail (very rarely it still succeeds).

After some digging around, the only way for me was do disable hermes and downgrade to v10, which causes crashes on reload in debug mode (because of Reanimated perhaps), not an ideal tradeoff :)

Let me know if any other reproduction repo will help in debugging this.

marcfrankel commented 1 year ago

I believe I am running into this as well. Did anyone have any luck? It's super hard to debug because it's only happening on releases....

sunnylqm commented 1 year ago

try downgrade to realm@11.0.0-rc.0

marcfrankel commented 1 year ago

Downgrading to realm@11.0.0-rc.0 produces a crash for me even on a local (debug) version of the build. With the following crash frame. Running Expo 46.0.13 and React Native 0.69.6

Thread 21 Crashed:: com.facebook.react.JavaScript
0   APPNAME                            0x105d88be0 facebook::jsc::JSCRuntime::cloneSymbol(facebook::jsi::Runtime::PointerValue const*) + 64
1   APPNAME                            0x105d895a6 facebook::jsi::Value::Value(facebook::jsi::Runtime&, facebook::jsi::Symbol const&) + 70
2   APPNAME                            0x105d894d8 facebook::jsc::JSCRuntime::symbolToString(facebook::jsi::Symbol const&) + 56
3   APPNAME                            0x103cdf1be facebook::jsi::Value facebook::jsi::Function::call<char const (&) [11], std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(facebook::jsi::Runtime&, char const (&) [11], std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&) const + 78
4   APPNAME                            0x103ccf627 realm::js::realmjsi::ObjectWrap<realm::js::ObservableClass<realm::js::realmjsi::Types> >::create_constructor(realm::js::JsiEnv) + 599
5   APPNAME                            0x103ccc974 realm::js::RealmClass<realm::js::realmjsi::Types>::create_constructor(realm::js::JsiEnv) + 36
6   APPNAME                            0x103ccc7ee realm_jsi_init + 142
7   APPNAME                            0x10541bc59 __24-[RealmReact setBridge:]_block_invoke + 761
8   APPNAME                            0x1052bebf9 decltype(static_cast<void () block_pointer __strong&>(fp)()) std::__1::__invoke<void () block_pointer __strong&>(&&, decltype(static_cast<void () block_pointer __strong&>(fp)())&&...) + 25
9   APPNAME                            0x1052bebad void std::__1::__invoke_void_return_wrapper<void, true>::__call<void () block_pointer __strong&>(void () block_pointer __strong&) + 29
10  APPNAME                            0x1052beb7d std::__1::__function::__alloc_func<void () block_pointer __strong, std::__1::allocator<std::__1::allocator>, void ()>::operator()() + 29
11  APPNAME                            0x1052bd7a9 std::__1::__function::__func<void () block_pointer __strong, std::__1::allocator<std::__1::allocator>, void ()>::operator()() + 25
12  APPNAME                            0x1053c5c42 std::__1::__function::__value_func<void ()>::operator()() const + 50
13  APPNAME                            0x1053c5b75 std::__1::function<void ()>::operator()() const + 21
14  APPNAME                            0x1052d5925 facebook::react::tryAndReturnError(std::__1::function<void ()> const&) + 21
15  APPNAME                            0x1052a6f28 -[RCTCxxBridge _tryAndHandleError:] + 88
16  Foundation                          0x7fff20845992 __NSThreadPerformPerform + 179
17  CoreFoundation                      0x7fff2036ce15 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
18  CoreFoundation                      0x7fff2036cd0d __CFRunLoopDoSource0 + 180
19  CoreFoundation                      0x7fff2036c1e2 __CFRunLoopDoSources0 + 242
20  CoreFoundation                      0x7fff20366941 __CFRunLoopRun + 875
21  CoreFoundation                      0x7fff203660f3 CFRunLoopRunSpecific + 567
22  APPNAME                            0x1052a6d25 +[RCTCxxBridge runRunLoop] + 949
23  Foundation                          0x7fff20845550 __NSThread__start__ + 1025
24  libsystem_pthread.dylib             0x7fff6da334e1 _pthread_start + 125
25  libsystem_pthread.dylib             0x7fff6da2ef6b thread_start + 15

To reiterate. Version rc-0 crashes locally for me with this crash report. Whereas rc-1 crashes only in release mode but works perfectly fine for me locally. Very strange... Any help is super appreciated.

marcfrankel commented 1 year ago

I'll add in I have been able to get a build of our app working by rolling back our React Native Firebase version to 14.X. I don't think the issue was with Firebase itself, but rather with the 15.X version requirement to use "Static Frameworks". I think building using static frameworks is what is actually causing the issue.

takameyer commented 1 year ago

@marcfrankel can you confirm that your project conforms to this compatibility matrix?

thespacemanatee commented 1 year ago

@marcfrankel I didn't manage to get that to work even after downgrading RNFB :/ @takameyer seems like a lot of people are facing this. Shouldn't this issue be on high priority?

ianpward commented 1 year ago

@thespacemanatee Can you tell us -

That would help us figure out what is going on

thespacemanatee commented 1 year ago

@thespacemanatee Can you tell us -

  • the version of Realm JS
  • the version of React Native
  • the version of Expo
  • whether you have Hermes enabled or not

That would help us figure out what is going on

@ianpward Hello, please read the thread. I've provided a repro here.

@tomduncalf has also confirmed that it could be reproduced.

kneth commented 1 year ago

@thespacemanatee I am not able to build your repro - neither branches.

thespacemanatee commented 1 year ago

Thanks for that, I wasn't able to build on my M1 but a few of my packages on my Intel Mac were outdated compared to yours. I upgraded them and it now builds (I also had to fix the path in https://github.com/thespacemanatee/realm-repro-4735/blob/with-realm/ios/.xcode.env.local)

I'm able to reproduce this issue in Release mode, I can't repro it in Debug mode annoyingly. We will investigate this issue and see if we can work out what is going on and update you once we have something.

@kneth I'm using an M1 device so you should be able to build it on M1, otherwise you can just follow my package.json and create an Intel project.

kneth commented 1 year ago

I am actually on M1. Which xcode version do you use?

thespacemanatee commented 1 year ago

I am actually on M1. Which xcode version do you use?

Was using Xcode 13 for this repro. Maybe try fixing the path in .xcode.env.local as mentioned above? Not sure how it got there, sorry.

kneth commented 1 year ago

Oh, don't have GNU coreutils in PATH: https://github.com/facebook/react-native/issues/32432#issuecomment-1198310931

thespacemanatee commented 1 year ago

@kneth Did you manage to build it? Any action on my part?

kneth commented 1 year ago

@thespacemanatee Yes, I can build. And I see the crash too.

ksushiva commented 1 year ago

I wanted to build my app in release mode today, and I also got the crash.

Expo SDK: 46 RN version: 0.69.4 Realm version: 11.0.0-rc.1

I confirm that according to the compatibility matrix, it should work, and it does work in dev builds. Unfortunately, building in release mode creates a crash. (It seems to crash 4 times out of 5 launches)

kneth commented 1 year ago

@ksushiva @thespacemanatee Could be related to https://github.com/expo/expo/issues/19517?

thespacemanatee commented 1 year ago

@ksushiva @thespacemanatee Could be related to https://github.com/expo/expo/issues/19517?

I have already tried this in the repro long ago, I have 2 branches one with and one without realm. The common factor is always realm in my case. I don't have useFrameworks static as well

lluisandreu commented 1 year ago

RN 0.70.3 Realm 11.0.0

My temporary fix was disabling hermes for ios and now I don't get this crash. I have realm v11.0.0 installed as well, so hermes might have been colliding with realm.

lluisandreu commented 1 year ago

@kneth please read the realm v11 compatibility, you need to upgrade your RN to 0.70.x in order to get realm and hermes working. https://github.com/realm/realm-js/releases/tag/v11.0.0-rc.2

thespacemanatee commented 1 year ago

RN 0.70.3 Realm 11.0.0

My temporary fix was disabling hermes for ios and now I don't get this crash. I have realm v11.0.0 installed as well, so hermes might have been colliding with realm.

This is exactly what I had to do as well. I already sounded this out the @kneth and team 3 months ago but no action has been taken. It's such a benign issue that most people won't realise it until they publish it to the app store. I even provided a repro and everything. It's a wasted opportunity to have started working on this a long time ago, especially since Realm is technically a paid product. I have since moved on to other services and probably won't be using Realm for awhile until it's more stable.

takameyer commented 1 year ago

@thespacemanatee since the release of Realm v11 and Expo SDK 47, we were able to successfully archive and run a release version of a Realm application for iOS and Android (using EAS). It's possible that you may need to configure eas.json to use the latest xcode (v14) in order to avoid build errors. I'm going to close this issue for now. If anyone still has issues, feel free to comment or reopen.

thespacemanatee commented 1 year ago

@takameyer Hey, are you aware that this issue is regarding enabling hermes with realm on expo? This crash is still happening for me on SDK 47. I'm not sure what's up but I had to explain this to the team over and over again. It's NOT a compile issue but a runtime issue. Please reopen this issue!

takameyer commented 1 year ago

@thespacemanatee I've looked at your repo and do not see anything in your runtime code that would cause a crash, although the dependencies are very out of date, and expo-dev-client is missing. I have recently released and tested templates for Realm v11 using expo SDK 47 with hermes enabled, which run flawlessly on Android and iOS. I would recommend using these as a guideline for using Realm with Expo:

Sorry for any confusion. Let me know if this is helps move things forward.

thespacemanatee commented 1 year ago

@thespacemanatee I've looked at your repo and do not see anything in your runtime code that would cause a crash, although the dependencies are very out of date, and expo-dev-client is missing. I have recently released and tested templates for Realm v11 using expo SDK 47 with hermes enabled, which run flawlessly on Android and iOS. I would recommend using these as a guideline for using Realm with Expo:

Sorry for any confusion. Let me know if this is helps move things forward.

@takameyer I checked the template and it's using expo managed workflow. We are using the bare workflow + development client and it is giving us a runtime crash that has nothing to do with our JavaScript code. We have tested this many times and it is definitely still an issue with realm + hermes on bare workflow! Just in case you didn't know, if you see the android and ios folders it means it on the bare workflow. Your template does not have those folders and that's why they work. I will update the repro again but have you guys tested this on bare workflow?

takameyer commented 1 year ago

@thespacemanatee this is using the development client, which by default is outside of the normal managed workflow (realm will not work with a classic managed workflow, ie Expo Go). As soon as you type expo run:ios it will output the ios folder. Without ios or android folders, realm wouldn't work at all, as it is not part of the expo sdk. I will offer an alternative method that I have also just tested:

npx crna -t with-dev-client TestApp
cd TestApp
yarn add realm
yarn ios

This came with the following dependencies:

  "dependencies": {
    "expo": "~47.0.3",
    "expo-dev-client": "~2.0.0",
    "expo-splash-screen": "~0.17.4",
    "expo-status-bar": "~1.4.2",
    "expo-updates": "~0.15.4",
    "react": "18.1.0",
    "react-dom": "18.1.0",
    "react-native": "0.70.5",
    "react-native-web": "~0.18.7",
    "realm": "^11.2.0"
  },

Please let me know if you have further questions.

thespacemanatee commented 1 year ago

@takameyer In that case, let me try from scratch again. Do you know if SDK 47 comes with hermes enabled by default? I had to manually switch it on in the Podfile. In any case, I feel like this makes upgrading unwieldy as I may have to create a new project and shift my code over. Was it ever understood why this occurred in the first place and how it can be avoided in the future? We nearly shipped out broken builds to production when this issue first came up.

takameyer commented 1 year ago

@thespacemanatee

Do you know if SDK 47 comes with hermes enabled by default?

It has been announced that SDK 48 will have hermes enabled by default, so you will have to activate it yourself. This done by adding "jsEngine: "hermes" to your app.json.

Was it ever understood why this occurred in the first place and how it can be avoided in the future

I can only assume there was a dependency mismatch, or that the ios and android folders were not in sync with the current release of React Native. We have been pretty vocal about what version of Realm work with what versions of Expo and React Native. See our compatibility matrix With our release of v11 and Expo's release of SDK 47, we are finally inline with Expo when it comes to supported React Native versions.

thespacemanatee commented 1 year ago

@takameyer are you suggesting that we didn't do our due diligence? We quadruple-checked this over a few months, hoping it would be fixed with every update. I've been doing this for a while and have my dependencies set up correctly, and take a look at my repro if you don't believe so.

Compatibility Matrix

Screenshot 2022-11-14 at 11 45 36 PM

Repro dependencies

{
  "name": "expo-realm-repro",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "start": "expo start --dev-client",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "expo": "^46.0.1",
    "expo-splash-screen": "~0.16.1",
    "expo-status-bar": "~1.4.0",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-native": "0.69.3",
    "react-native-web": "~0.18.7",
    "realm": "^11.0.0-rc.1"
  },
  "devDependencies": {
    "@babel/core": "^7.18.6"
  },
  "private": true
}

The dependencies are not even that out of date! They are on SDK 46-compatible versions! It would really be a shame if 1 SDK cycle is considered the bar for what is out of date and what is not.

And yes I know how to activate hermes, I'm asking you if you did it while trying to repro this issue.

thespacemanatee commented 1 year ago

@takameyer why don't we do away with the templated answers and lets at least acknowledge the issue? You keep asking us to refer to the matrix but I've been following this issue for 4 months now and you have to do better than that, especially for a product with a paid subscription model!

takameyer commented 1 year ago

@thespacemanatee I realize this thread has been open for too long and I am finally able to have the bandwidth to give it my full attention. I apologize for not being able to get to this sooner. My assumption could be wrong as to what your issues with our release candidate and Expo 46 were, I am just trying to rule out the usual suspects when it comes to such issues.

What I can say in full confidence is that we are currently compatible with the most updated version of Expo when using the most updated version of Realm, with or without hermes enabled. If you have found out otherwise, then I would reopen this and investigate further.

carbopilot commented 1 year ago

Hi @takameyer. Thanks - This has wasted so much time over the last few months, evidently for a lot of developers.

I've added some further info which consistently replicates the issue, on both M1 and Intel Macs, across every device / simulator we test with.

To summarise - It’s still not working in iOS with Hermes and Expo in release mode.

Steps to reproduce:

  1. Initiate new project, add expo by running:
npx react-native init FailsReleaseModeOnIOSWithHermesExpoAndRealm
cd FailsReleaseModeOnIOSWithHermesExpoAndRealm
npx install-expo-modules@latest 
  1. Open FailsReleaseModeOnIOSWithHermesExpoAndRealm.xcworkspace in Xcode.
  2. Configure signing team if necessary
  3. Edit Xcode project’s Run scheme, changing ‘Build Configuration’ to Release.
  4. Run build for a simulator or device.
  5. It should work fine. Then try adding Realm:
    yarn add realm  
    cd ios && pod install && cd ..
  6. Clean build folder in Xcode, and close any terminal instances running metro.
  7. Now fails with exception noted at end of this post. If it doesn’t fail first time, it will on second load of app.
  8. To verify it works without Hermes:
    • open /ios/Podfile, set ‘heroes_enabled => true’ to ‘hermes_enabled => false’
    • cd ios && pod install && cd ..
    • Clean build folder and re-run.

So ...

Versions as per a clean install: "expo": "^47.0.0", "react": "18.1.0", "react-native": "0.70.6", "realm": "^11.3.0"

Exception details:

Exception Type: EXC_BAD_INSTRUCTION (SIGILL) Exception Codes: 0x0000000000000001, 0x0000000000000000 Termination Reason: SIGNAL 4 Illegal instruction: 4 Terminating Process: exc handler [11938]

Triggered by Thread: 6 Thread 6 Crashed:: Dispatch queue: com.apple.root.user-interactive-qos 0 FailsReleaseModeOnIOSWithHermesExpoAndRealm 0x10349219f facebook::react::(anonymous namespace)::ReentrancyCheck::before() + 10 (HermesExecutorFactory.cpp:123) [inlined] 1 FailsReleaseModeOnIOSWithHermesExpoAndRealm 0x10349219f facebook::jsi::detail::BeforeCaller<facebook::react::(anonymous namespace)::ReentrancyCheck, void>::before(facebook::react::(anonymous namespace)::ReentrancyCheck&) + 10 (decorator.h:424) [inlined] 2 FailsReleaseModeOnIOSWithHermesExpoAndRealm 0x10349219f facebook::jsi::WithRuntimeDecorator<facebook::react::(anonymous namespace)::ReentrancyCheck, facebook::jsi::Runtime, facebook::jsi::Runtime>::Around::Around(facebook::react::(anonymous namespace)::ReentrancyCheck&) + 10 (decorator.h:749) [inlined] 3 FailsReleaseModeOnIOSWithHermesExpoAndRealm 0x10349219f facebook::jsi::WithRuntimeDecorator<facebook::react::(anonymous namespace)::ReentrancyCheck, facebook::jsi::Runtime, facebook::jsi::Runtime>::Around::Around(facebook::react::(anonymous namespace)::ReentrancyCheck&) + 83 (decorator.h:748) 4 FailsReleaseModeOnIOSWithHermesExpoAndRealm 0x103490674 facebook::jsi::WithRuntimeDecorator<facebook::react::(anonymous namespace)::ReentrancyCheck, facebook::jsi::Runtime, facebook::jsi::Runtime>::createObject() + 30 (decorator.h:593) 5 FailsReleaseModeOnIOSWithHermesExpoAndRealm 0x1032f9f38 facebook::jsi::Object::Object(facebook::jsi::Runtime&) + 16 (jsi.h:570) [inlined] 6 FailsReleaseModeOnIOSWithHermesExpoAndRealm 0x1032f9f38 std::1::shared_ptr_emplace<facebook::jsi::Object, std::1::allocator >::shared_ptr_emplace<facebook::jsi::Runtime&>(std::1::allocator, facebook::jsi::Runtime&) + 37 (shared_ptr.h:298) [inlined] 7 FailsReleaseModeOnIOSWithHermesExpoAndRealm 0x1032f9f38 std::1::shared_ptr_emplace<facebook::jsi::Object, std::1::allocator >::shared_ptr_emplace<facebook::jsi::Runtime&>(std::__1::allocator, facebook::jsi::Runtime&) + 37 (shared_ptr.h:292) [inlined] 8 FailsReleaseModeOnIOSWithHermesExpoAndRealm 0x1032f9f38 std::1::shared_ptr std::1::allocate_shared<facebook::jsi::Object, std::1::allocator, facebook::jsi::Runtime&, void>(std::1::allocator const&, facebook::jsi::Runtime&) + 50 (shared_ptr.h:1106) [inlined] 9 FailsReleaseModeOnIOSWithHermesExpoAndRealm 0x1032f9f38 std::1::shared_ptr std::1::make_shared<facebook::jsi::Object, facebook::jsi::Runtime&, void>(facebook::jsi::Runtime&) + 50 (sharedptr.h:1115) [inlined] 10 FailsReleaseModeOnIOSWithHermesExpoAndRealm 0x1032f9f38 -[EXJavaScriptRuntime createObject] + 72 (EXJavaScriptRuntime.Mark M 11 FailsReleaseModeOnIOSWithHermesExpoAndRealm 0x1032fb39b -[EXJavaScriptRuntime initializeMainObject] + 48 (EXJavaScriptRuntime.Mark Mc 12 FailsReleaseModeOnIOSWithHermesExpoAndRealm 0x1032f9ea2 -[EXJavaScriptRuntime initWithRuntime:callInvoker:] + 207 (EXJavaScriptRuntime.Mark M 13 FailsReleaseModeOnIOSWithHermesExpoAndRealm 0x1032ffa44 +[EXJavaScriptRuntimeManager runtimeFromBridge:] + 148 (EXJSIInstaller.Mark M 14 FailsReleaseModeOnIOSWithHermesExpoAndRealm 0x10334665b ExpoBridgeModule.javaScriptWillStartExecutingNotification(:) + 379 (ExpoBridgeModule.swift:76) 15 FailsReleaseModeOnIOSWithHermesExpoAndRealm 0x10334696e @objc ExpoBridgeModule.javaScriptWillStartExecutingNotification(_:) + 110 16 CoreFoundation 0x7ff80035869b CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER + 137 17 CoreFoundation 0x7ff8003585d1 _CFXRegistrationPost_block_invoke + 86 18 CoreFoundation 0x7ff800357bb0 _CFXRegistrationPost + 541 19 CoreFoundation 0x7ff8003574b9 _CFXNotificationPost + 822 20 Foundation 0x7ff800c08501 -[NSNotificationCenter postNotificationName:object:userInfo:] + 82 21 FailsReleaseModeOnIOSWithHermesExpoAndRealm 0x1033a94ff 51-[RCTCxxBridge executeApplicationScript:url:async:]_block_invoke + 209 (RCTCxxBridge.Mark McC 22 FailsReleaseModeOnIOSWithHermesExpoAndRealm 0x1033adcfb std::1::function::__value_func<void ()>::operator()() const + 18 (function.h:505) [inlined] 23 FailsReleaseModeOnIOSWithHermesExpoAndRealm 0x1033adcfb std::1::function<void ()>::operator()() const + 18 (function.h:1182) [inlined] 24 FailsReleaseModeOnIOSWithHermesExpoAndRealm 0x1033adcfb facebook::react::tryAndReturnError(std::__1::function<void ()> const&) + 22 (RCTCxxUtils.Mark M 25 FailsReleaseModeOnIOSWithHermesExpoAndRealm 0x1033a2dc8 -[RCTCxxBridge _tryAndHandleError:] + 103 (RCTCxxBridge.Mark Mc 26 FailsReleaseModeOnIOSWithHermesExpoAndRealm 0x1033a93da -[RCTCxxBridge executeApplicationScript:url:async:] + 152 (RCTCxxBridge.Mark McC 27 FailsReleaseModeOnIOSWithHermesExpoAndRealm 0x1033a9274 -[RCTCxxBridge enqueueApplicationScript:url:onComplete:] + 78 (RCTCxxBridge.Mark McC 28 FailsReleaseModeOnIOSWithHermesExpoAndRealm 0x1033a6f3a -[RCTCxxBridge executeSourceCode:sync:] + 215 (RCTCxxBridge.Mark McC 29 FailsReleaseModeOnIOSWithHermesExpoAndRealm 0x1033a430b __21-[RCTCxxBridge start]_block_invoke_2 + 87 (RCTCxxBridge.Mark Mc 30 libdispatch.dylib 0x7ff80013b7fb _dispatch_call_block_and_release + 12 31 libdispatch.dylib 0x7ff80013ca3a _dispatch_client_callout + 8 32 libdispatch.dylib 0x7ff800150020 _dispatch_root_queue_drain + 967 33 libdispatch.dylib 0x7ff800150928 _dispatch_worker_thread2 + 251 34 libsystem_pthread.dylib 0x7ff834c3bc9d _pthread_wqthread + 256 35 libsystem_pthread.dylib 0x7ff834c3ac67 start_wqthread + 15 Cabe:505)abe:1079)abe:1479)abe:1502)Cabe:344)cCabe:74)abe:1504)cCabe:33)cCabe:60)Cabe:193)cCabe:77)

thespacemanatee commented 1 year ago

@carbopilot thanks for corroborating my reports. I am still getting the exact same error @takameyer

takameyer commented 1 year ago

@carbopilot Thanks for the detailed reproduction steps. We will investigate this as soon as we can.

carbopilot commented 1 year ago

Hi @takameyer @kneth. Any update? This has been a bug for over 6 months - restricting our releases on Hermes, which for us and all your other customers limit considerable market benefits for our apps.

mk04366 commented 1 year ago

Hi @takameyer @kneth , I too am facing this similar error mentioned in 5172. I shared the error logs here if they'll help in debugging the issue.

takameyer commented 1 year ago

The culprit is here: https://github.com/facebook/react-native/blob/46ffeca3b00cfab1c6d27fd1e754b02406cf288c/ReactCommon/hermes/executor/HermesExecutorFactory.cpp#L109

It would appear there is a conflict between how Expo and Realm cross the bridge. This assertion is only active in Release mode. We will continue to investigate for a fix, either on our side or Expo's side.