From e60da27b75efa26d080db651ffef1d26f94d254e Mon Sep 17 00:00:00 2001 From: Devan Buggay Date: Mon, 10 Nov 2025 07:02:59 -0800 Subject: [PATCH] Fix crash during frame reporting Summary: `reportFrameTiming` will occasionally crash the app. This diff adds the same mutex guard all other performance events have. Changelog: [internal] Reviewed By: rubennorte Differential Revision: D86644084 --- .../jsinspector-modern/tracing/PerformanceTracer.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp b/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp index af8ee1ffcd27..06a404547acc 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp @@ -379,6 +379,15 @@ void PerformanceTracer::reportFrameTiming( int frameSeqId, HighResTimeStamp start, HighResTimeStamp end) { + if (!tracingAtomic_) { + return; + } + + std::lock_guard lock(mutex_); + if (!tracingAtomic_) { + return; + } + ThreadId threadId = getCurrentThreadId(); enqueueEvent( PerformanceTracerFrameBeginDrawEvent{