From b0ebecff8622a31c876abd1c2fc41a2193d9c875 Mon Sep 17 00:00:00 2001 From: Patrick Mick Date: Wed, 28 Jan 2026 13:52:47 -0800 Subject: [PATCH 1/2] Conditionally register for profiling --- .../ReactCommon/react/runtime/hermes/HermesInstance.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/react-native/ReactCommon/react/runtime/hermes/HermesInstance.cpp b/packages/react-native/ReactCommon/react/runtime/hermes/HermesInstance.cpp index 00203fcb686a95..d4d665305e04af 100644 --- a/packages/react-native/ReactCommon/react/runtime/hermes/HermesInstance.cpp +++ b/packages/react-native/ReactCommon/react/runtime/hermes/HermesInstance.cpp @@ -110,7 +110,9 @@ class HermesJSRuntime : public JSRuntime { } void unstable_initializeOnJsThread() override { +#ifdef HERMES_ENABLE_PROFILING runtime_->registerForProfiling(); +#endif } private: From dc8777565ca610579fa96a71447a31e325bda097 Mon Sep 17 00:00:00 2001 From: Patrick Mick Date: Wed, 28 Jan 2026 13:54:52 -0800 Subject: [PATCH 2/2] Adding a comment --- .../ReactCommon/react/runtime/hermes/HermesInstance.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/react-native/ReactCommon/react/runtime/hermes/HermesInstance.cpp b/packages/react-native/ReactCommon/react/runtime/hermes/HermesInstance.cpp index d4d665305e04af..d6cd5471d773fc 100644 --- a/packages/react-native/ReactCommon/react/runtime/hermes/HermesInstance.cpp +++ b/packages/react-native/ReactCommon/react/runtime/hermes/HermesInstance.cpp @@ -110,6 +110,8 @@ class HermesJSRuntime : public JSRuntime { } void unstable_initializeOnJsThread() override { + // On new arch, we're seeing a crash in release optimized builds here. Adding this as a stopgap measure to prevent + // the crash to allow us to more thoroughly test new arch while this is investigated. #ifdef HERMES_ENABLE_PROFILING runtime_->registerForProfiling(); #endif