Repository navigation
EXC_BAD_ACCESS in production after upgrading to 0.79.6 #53774
Copy link
Copy link
Open
Labels
Needs: AttentionIssues where the author has responded to feedback.Issues where the author has responded to feedback.Needs: ReproThis issue could be improved with a clear list of steps to reproduce the issue.This issue could be improved with a clear list of steps to reproduce the issue.
Description
Description
We have got a lot a bunch of unhandled errors in sentry and some users are experiencing crashes after enabling new architecture and moving to RN 0.79.6:
https://lendo.sentry.io/share/issue/15101300672940039f9334b6a3dbd6cf/
Exception 1, Code 1, Subcode 2014344570531660876 >
KERN_INVALID_ADDRESS at 0x1bf463b6e5c6c44c.
Hermes engine in Podfile.lock is also updated to the latest version and it's locked to 0.79.6.
It's happening for 9 users since 2 weeks ago that we released.
Steps to reproduce
This is very hard to reproduce. I am not sure what has happened.
React Native Version
0.79.6
Affected Platforms
Runtime - iOS
Output of npx @react-native-community/cli info
info Fetching system and libraries information...
System:
OS: macOS 15.6.1
CPU: (10) arm64 Apple M1 Pro
Memory: 134.56 MB / 32.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 22.18.0
path: ~/.nvm/versions/node/v22.18.0/bin/node
Yarn:
version: 1.22.19
path: ~/.nvm/versions/node/v22.18.0/bin/yarn
npm:
version: 10.9.3
path: ~/.nvm/versions/node/v22.18.0/bin/npm
Watchman: Not Found
Managers:
CocoaPods:
version: 1.16.1
path: /Users/xxxx/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 24.5
- iOS 18.5
- macOS 15.5
- tvOS 18.5
- visionOS 2.5
- watchOS 11.5
Android SDK:
API Levels:
- "28"
- "29"
- "30"
- "31"
- "33"
- "34"
- "35"
- "36"
Build Tools:
- 28.0.3
- 29.0.2
- 30.0.3
- 33.0.1
- 34.0.0
- 35.0.0
- 36.0.0
System Images:
- android-33-ext4 | Google Play ARM 64 v8a
- android-34-ext12 | Google Play ARM 64 v8a
- android-34 | Google APIs ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2024.3 AI-243.26053.27.2432.13536105
Xcode:
version: 16.4/16F6
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.11
path: /usr/bin/javac
Ruby:
version: 3.2.2
path: /Users/xxxx/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli":
installed: 18.0.0
wanted: 18.0.0
react:
installed: 19.0.0
wanted: 19.0.0
react-native:
installed: 0.79.6
wanted: 0.79.6
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: true
newArchEnabled: true
info React Native v0.81.4 is now available (your project is running on v0.79.6).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.81.4
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.79.6&to=0.81.4
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".
Stacktrace or Logs
OS Version: iOS 18.6.2 (22G100)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: SEGV_NOOP at 0x1bf463b6e5c6c44c
Crashed Thread: 8
Application Specific Information:
Exception 1, Code 1, Subcode 2014344570531660876 >
KERN_INVALID_ADDRESS at 0x1bf463b6e5c6c44c.
Thread 8 Crashed:
0 KreddyMobile 0x2039cd910 [inlined] facebook::react::Scheduler::uiManagerDidFinishTransaction::lambda::operator() (Scheduler.cpp:266)
1 KreddyMobile 0x2039cd910 [inlined] std::__1::__invoke[abi:ne180100]<T> (invoke.h:344)
2 KreddyMobile 0x2039cd910 [inlined] std::__1::__invoke_void_return_wrapper<T>::__call[abi:ne180100]<T> (invoke.h:419)
3 KreddyMobile 0x2039cd910 [inlined] std::__1::__function::__alloc_func<T>::operator()[abi:ne180100] (function.h:169)
4 KreddyMobile 0x2039cd910 std::__1::__function::__func<T>::operator() (function.h:311)
5 KreddyMobile 0x203a77f5c facebook::react::RuntimeScheduler_Modern::runEventLoopTick (RuntimeScheduler_Modern.cpp:340)
6 KreddyMobile 0x203a77c30 facebook::react::RuntimeScheduler_Modern::runEventLoop (RuntimeScheduler_Modern.cpp:271)
7 KreddyMobile 0x203a488cc [inlined] std::__1::__function::__value_func<T>::operator()[abi:ne180100] (function.h:428)
8 KreddyMobile 0x203a488cc [inlined] std::__1::function<T>::operator() (function.h:981)
9 KreddyMobile 0x203a488cc [inlined] const::lambda::operator() (ReactInstance.cpp:83)
10 KreddyMobile 0x203a488cc [inlined] std::__1::__invoke[abi:ne180100]<T> (invoke.h:344)
11 KreddyMobile 0x203a488cc [inlined] std::__1::__invoke_void_return_wrapper<T>::__call[abi:ne180100]<T> (invoke.h:419)
12 KreddyMobile 0x203a488cc [inlined] std::__1::__function::__alloc_func<T>::operator()[abi:ne180100] (function.h:169)
13 KreddyMobile 0x203a488cc std::__1::__function::__func<T>::operator() (function.h:311)
14 KreddyMobile 0x2038edbe8 [inlined] std::__1::__function::__value_func<T>::operator()[abi:ne180100] (function.h:428)
15 KreddyMobile 0x2038edbe8 [inlined] std::__1::function<T>::operator() (function.h:981)
16 KreddyMobile 0x2038edbe8 facebook::react::tryAndReturnError (RCTCxxUtils.mm:73)
17 KreddyMobile 0x2038fc084 facebook::react::RCTMessageThread::tryFunc (RCTMessageThread.mm:68)
18 KreddyMobile 0x2038fbe88 [inlined] std::__1::__function::__value_func<T>::operator()[abi:ne180100] (function.h:428)
19 KreddyMobile 0x2038fbe88 [inlined] std::__1::function<T>::operator() (function.h:981)
20 KreddyMobile 0x2038fbe88 facebook::react::RCTMessageThread::runAsync (RCTMessageThread.mm:44)
21 CoreFoundation 0x31f0a884c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__
22 CoreFoundation 0x31f04b024 __CFRunLoopDoBlocks
23 CoreFoundation 0x31f04c524 __CFRunLoopRun
24 CoreFoundation 0x31f04dad8 CFRunLoopRunSpecific
25 KreddyMobile 0x203a445a4 +[RCTJSThreadManager runRunLoop] (RCTJSThreadManager.mm:102)
26 Foundation 0x31c9a3800 __NSThread__start__
27 libsystem_pthread.dylib 0x4339ab340 _pthread_start
MANDATORY Reproducer
N/A
Screenshots and Videos
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Needs: AttentionIssues where the author has responded to feedback.Issues where the author has responded to feedback.Needs: ReproThis issue could be improved with a clear list of steps to reproduce the issue.This issue could be improved with a clear list of steps to reproduce the issue.
Activity
react-native-bot commentedon Sep 15, 2025
Warning
Missing reproducer: We could not detect a reproducible example in your issue report. Reproducers are mandatory and we can accept only one of those as a valid reproducer:
You can read more about about it on our website: How to report a bug.
emandres commentedon Sep 16, 2025
I'm getting the same error. Been throwing things at the wall for two weeks on this, so far. Interested to see what the RN team has to say.
zeta92 commentedon Sep 19, 2025
Hey I am getting the same error, I can't reproduce it but is happening to the 5% of our users
abhayagrawal-fareye commentedon Sep 24, 2025
facebook::react::TelemetryController::pullTransaction(std::__1::function<void (facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&)> const&, std::__1::function<void (facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&)> const&, std::__1::function<void (facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&)> const&) const
EXC_BAD_ACCESS (KERN_INVALID_ADDRESS)
Facing similar errors in react native 0.77.3
Brma1048 commentedon Sep 24, 2025
also getting this error.
React Native: 0.79.6
New Arch: true
ElieGhanimeh commentedon Sep 25, 2025
Also getting this error
React Native: 0.80.0
New Arch: true
The app is being used by over 500 users and most probably more, only happening to a few.
SanjayConverge commentedon Sep 29, 2025
Same issue after upgrading from v0.71.19 - v0.80.1 .
It is happening to some random users on iOS.
Crash logged in the Sentry :
EXC_BAD_ACCESS: Exception 1, Code 1, Subcode 24 > KERN_INVALID_ADDRESS at 0x18 ; facebook::react::concreteComponentDescriptorConstructor<T>emandres commentedon Sep 29, 2025
So, I've been fighting these for the better part of a month now. Since we don't seem to be getting a response from the React Native team, I thought I'd share what I've learned.
I was able to clean up a lot of these errors by making sure that the app doesn't try to update components after they've been removed from the screen. There are a lot of things to check for this, but offhand:
useEffecthooks;awaitsetIntervalcalls on unmount; same goes forsetTimeoutI've managed to reduce the number of these errors quite a bit with the above tactics. We've narrowed down the majority of the remaining errors to something being thrown during the Expo Update process. It seems like the update downloads just fine, but once the app reboots to apply the update we get the error.
Another thing to be aware of is that
ErrorBoundaryonly works for exceptions that are thrown during the React component lifecycle. That means that most errors thrown from async code and event handlers don't get caught. I found recently that there is a way to set up a global error handler in React Native:ErrorUtils.setGlobalHandler. This change is still to be proven in production, so take it with a grain of salt.The only other bit of wisdom I can impart is to work on your app's observability. We were flying blind because we didn't have the DSYM files uploaded to Sentry, and any over-the-air updates we did after the initial native release weren't getting the source map files.
ElieGhanimeh commentedon Sep 30, 2025
Thank you for sharing! I think it's happening for me because of a remote config check using Firebase, not entirely sure though. It's only happening on production as well after days of usage, I can't really replicate the error on my simulator to debug it furthermore which is kinda annoying.
Brma1048 commentedon Sep 30, 2025
@cortinico is it possible that somebody of the react native team can take a look into this issue?
cortinico commentedon Sep 30, 2025
Without a repro: highly unlikely
15 remaining items
matinzd commentedon Jan 12, 2026
I am on 79 right now :D There are some fixes related to
EXC_BAD_ACCESSin the repo but not sure if it's related.UPDATE:
Still happening with 0.81 too. We are currently sending 0.83 update to see if that fixes anything but I think we still need this to be released.
hoangman1108 commentedon Jan 17, 2026
"react-native": "0.81.5" get the same issue on some devices.
taraskarpyn commentedon Jan 19, 2026
@matinzd some updates for this?
Did you find something that causing this issue?
ElieGhanimeh commentedon Jan 19, 2026
Upgraded to react-native 0.83.0, still having the same issue, i've been trying to figure it out since October, this is getting out of hand and frustrating.
henryjrr1655 commentedon Feb 5, 2026
Also have been receiving these for a while and haven't been able to fix it.
ElieGhanimeh commentedon Feb 10, 2026
Is anyone using SSO for the application? react-native-app-auth or something similar?
Navipro70 commentedon Apr 7, 2026
The same unstable crashes
Navipro70 commentedon Apr 9, 2026
As I understood those crashes aren't unstable
Sentry showing
EXC_BAD_ACCESSjust for 95% of crashes and cannot determinate reason cause of leak of context. I think it's kind of related to #56265 and #55390 I've patched my RN version with the second PR, and will keep eye on crashes behaviour in new releasematinzd commentedon Apr 11, 2026
I sent a pick request for this to be merged into 0.83, and it has now been picked, but I am not sure when it will be released. I am using prebuilt core, which makes it hard to patch locally.
I also believe this should fix the issue, as I am seeing many EXC_BAD_ACCESS errors in the
performVoidMethodInvocationfunction.matinzd commentedon Apr 17, 2026
A new 0.83 release is out from 0.83 stable branch.
I am going to release a new version of the app. I will keep everyone posted.
kirin72 commentedon Aug 24, 2026
We hit the same crash family and traced a concrete lifetime bug in the code path. Sharing in case it helps unblock
Needs: Repro.Environment: RN 0.81.5, React 19.1.0, Expo SDK 54, New Architecture (Fabric + Hermes), iOS 18.4–27.0, across 13 app releases and 9 device models. 59 crashes / 14 users over 34 days.
Our stack is identical to yours down to
runEventLoopTick, but the next frame differs — ours isupdateRendering, yours isuiManagerDidFinishTransaction. I believe these are two sides of the same bug: one is the producer, the other the consumer of the same queue.The lifetime bug
Schedulercaptures a rawSchedulerDelegate*by value into a lambda queued onRuntimeScheduler, and nothing ever drains that queue when the delegate dies:No teardown path drains this queue:
-[RCTScheduler dealloc]setDelegate(nullptr), destroys_delegateProxy(unique_ptr)Scheduler::~Scheduler()setEventTimingDelegate(nullptr),uiManager_->setDelegate(nullptr)RuntimeScheduler_ModernsetDelegate(nullptr)only nullsScheduler::delegate_. It cannot reach the copies already captured in queued lambdas. AndRuntimeScheduleroutlivesScheduler(held as aweak_ptrin theContextContainer, tied to the JS runtime lifetime), so the queue survives its delegate.Worth noting: the two neighbouring delegates in the same file are protected —
eventTimingDelegate_is nulled by~Scheduler(), andintersectionObserverDelegate_byIntersectionObserverManager.cpp:157. Only the captureddelegate_is unguarded.Why this matches the symptom
On iOS,
-[RCTScheduler dealloc]followsRCTSurfacePresenter suspend(_scheduler = nildrops the last strong ref). One of its callers is_applicationWillTerminate, registered forUIApplicationWillTerminateNotification.That lines up with our data: all 18 sampled events have
app.lifecycle: backgroundas the last breadcrumb, and 4 of them fired 648s–10705s into background — i.e. when iOS reclaimed the suspended app.Fault addresses are high-entropy 64-bit values in all 18 events (
0xce19b1971f8f0df3,0x9a9b9f9163ca5e8b,0x93e119d10a4844bf, …), never a small null-offset — consistent with reading a vtable pointer out of freed heap rather than a null deref.What we could not determine
We have not confirmed this with a sanitizer. We built with ASan and ran the backgrounding flow many times without triggering it — expected in hindsight, since plain backgrounding never calls
suspend(background is not terminate), and ASan's overhead shifts the race window anyway.So the open question is which of the three
suspendcallers fires in the ~1s-after-backgrounding cases (14 of our 18 events).This is analysis from reading 0.81.5 sources, not a verified repro. But if it holds, the fix direction would be either draining
pendingRenderingUpdates_onSchedulerteardown, or capturing the delegate through something that can be liveness-checked rather than a raw pointer.KingWangGH commentedon Sep 3, 2026
react-native+0.77.3.patch
I am using AI in version 0.77.3 to try to fix this issue, but I don't know how effective it will be。
Brma1048 commentedon Sep 14, 2026
@matinzd any updates?
gufao commentedon Sep 18, 2026
Adding instruction-level evidence for the
uiManagerDidDispatchCommandhalf of this, whichconfirms @kirin72's lifetime analysis and pins down four things that were open above.
Environment: RN 0.81.5, React 19.1.0, Expo SDK 54, New Architecture (Fabric + Hermes),
iOS 18–26, App Store build. 237 fatal events over 3 months, still ongoing. It is our
highest-volume crash by a factor of 2.5.
1. You can symbolicate these without a dSYM
This is probably the most immediately useful part for everyone here, because several comments
mention flying blind.
With
RCT_USE_PREBUILT_RNCORE(Expo SDK 54 turns it on by default), theReact.frameworkyour app ships is Meta's prebuilt artifact, byte for byte. I checked the framework inside
our App Store
.xcarchiveagainst the one CocoaPods had just downloaded fromrepo1.maven.org/.../react-native-artifacts/0.81.5/:And that artifact is not stripped of local symbols (~19.7k local
tsymbols). So:resolves every
React.frameworkframe, for anyone, with no dSYM and no archive. Worthvalidating first by running it on the frames your crash reporter already symbolicated from
the device symtab — five of ours matched exactly, which is what proves you have the right
binary.
2. It is not producer/consumer — they are two different lambdas
@kirin72 suggested
uiManagerDidFinishTransactionandupdateRenderingare two sides of onequeue. They are actually two separate capture sites, and
updateRenderingis the consumerof both:
Scheduler.cpp:254—uiManagerDidFinishTransaction's lambda (the stack in the originalreport, and @taraskarpyn's).
Scheduler.cpp:280—uiManagerDidDispatchCommand's lambda (ours).Symbolicating our top frame gives that second one literally:
Both are consumed by
RuntimeScheduler_Modern::updateRendering(). Same defect, two entrypoints.
3. The faulting instruction
The whole lambda body is four instructions (offsets are from the 0.81.5 arm64 artifact):
In our events
ldr x9,[x8]succeeds — the delegate's memory is still mapped — but thefirst word is not a vtable pointer.
relevant_addressis exactlyx9 + 0x18every time.That is a freed-and-reused
SchedulerDelegateProxy, not a null deref, which matches thehigh-entropy fault addresses @kirin72 reported.
Our crash reporter had filed these as two separate issues, and the register state shows
they are the same defect failing at adjacent instructions:
pcldr x4,[x9,#0x18]__func::operator()br x4updateRendering+156(i.e. thelr)In the second group
pc == x4andx0 == x8, both of which only hold if execution reached1af9f0. In one of them the garbage branch target decodes to the ASCII__init, in anotherto
sharedVa— reused heap holding string data. If your crash title contains an odd shortstring, that may be what it is; it is worth checking before concluding it points at some
other library.
4. The trigger looks like
TextInputblur-on-unmountcommandNameis captured at__func + 0xF8andx2points straight at it."blur"is 4bytes, so libc++ keeps the characters inline (SSO) — meaning
x2is a register pointing at aprintable string, which is exactly what sentry-cocoa's notable addresses pass picks up and
puts in the title. Our titles read
EXC_BAD_ACCESS: blur >, andx2is the only register inthe dump pointing at a printable string. Same in both issues.
So the producing call is
dispatchCommand(node, "blur", …).bluris one of the three Fabriccommands on
TextInput(['focus','blur','setTextAndSelection']), and RN itself dispatchesit when a focused
TextInputunmounts(
TextInput.js:415-418).If your title has a different short string, that is your
commandName, and it names thecomponent that produced it.
5. One data point against "it only happens on the way out"
@kirin72 found
app.lifecycle: backgroundlast in all 18 sampled events and pointed at_applicationWillTerminate. We see that too — but one of our events hasapp.in_foreground: true, with the user tapping aTextInputon a chat screen and the appdying about 2 seconds later. So at least one teardown path reaches this while the app is
actively on screen. Which caller of
suspendthat is, we could not determine either.6. Why nobody has produced an
RNTesterPlayground.jsrepro in 12 monthsThe race needs both halves at once: a queued
dispatchCommand(JS side, easy anddeterministic — unmount a focused
TextInput) and a scheduler teardown (native side,not reachable from JS). A JS-only playground can only ever produce one of the two. That may
be worth taking into account before this is closed on
Needs: Repro.7. Suggested direction
Re-read the delegate at call time through something revocable, instead of copying the raw
pointer at queue time. Minimal version, keeping
delegate_as-is for all the synchronouscallers:
Being honest about what this is: it narrows the window from a whole event-loop tick to
three instructions. It is not a proof of race-freedom — draining
pendingRenderingUpdates_onSchedulerteardown would be stronger, if the ownership allowsit.
mainstill has both capture sites unchanged today.8. On patching locally — @matinzd is right, and here is the knob
With prebuilt core, patching
node_modulesdoes nothing:react/renderer/scheduler/*.cppis not in the Pods project at all (the
schedulersubspec ships headers only), so thepatched source is never compiled. We verified this end to end before believing it.
On Expo the switch is
expo-build-properties→ios.buildReactNativeFromSource: true, whichdoes put
Scheduler.cppback into the Pods project and dropsReact-Core-prebuilt. Fairwarning: on our toolchain that build then fails in
fmtitself(
format-inl.h:59: call to consteval function … is not a constant expression), before it everreaches RN code — so "just patch it locally" currently costs two yaks, not one.
gufao commentedon Sep 18, 2026
Correcting my own comment above: I said
mainstill has both capture sites unchanged, whichis true, but I missed that this was already fixed once and then deliberately removed. For
anyone in this thread deciding whether to upgrade, the version map matters:
delegateInvalidated_guardenableSchedulerDelegateInvalidationReactNativeFeatureFlagsDefaults.hreturnsfalsemainteardown" — a
shared_ptr<atomic<bool>>invalidation token, i.e. the same shape Iindependently suggested above. I should have found it before posting; apologies for the
noise.
RuntimeScheduler_Modern::handleTaskErrorclearingtaskQueue_andpendingRenderingUpdates_before the host error handler runs.The part worth surfacing here is that #58138's own summary already names the window this
thread is reporting:
That is exactly our crash: no JS error is involved, the
RCTScheduleris simply torn down, sohandleTaskErrornever runs and nothing drains the queue.clearQueues()has exactly onecaller in both 0.87.1 and
main, and it is insidehandleTaskError.So, concretely, for people asking whether upgrading helps:
off.
ReactNativeFeatureFlags::override(...)is publicRN_EXPORT, so it can be switched onfrom app startup code without patching or building RN from source — which also sidesteps the
prebuilt-core problem @matinzd raised.
Given the death test exists, the remaining gap seems to be known and scoped rather than
unreproduced — a runtime-scheduler shutdown signal. Would it be reasonable to track that as the
follow-up to #58138 rather than leaving this issue on
Needs: Repro?