You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$250] [Sentry: APP-D1V] HybridApp iOS EXC_BAD_ACCESS in REANodesManager performOperations #96175
Reanimated native node operations crash during a worklet-driven animation frame — possible use-after-free or invalid node state when performOperations runs on the UI thread.
Reproduction
Unknown — see Sentry events linked from the Sentry issue.
REANodesManager performOperations is where Reanimated flushes queued node/view operations on the UI thread during the iOS display link (AnimationFrameQueue). The EXC_BAD_ACCESS (mach) means the worklet is dereferencing a node or view pointer that has already been freed, i.e. a use-after-free.
In practice this happens when a component that owns an animated node (a running useAnimatedStyle/useSharedValue-driven animation) unmounts while a frame is still queued. The view backing the node is torn down, but the pending operation in AnimationFrameQueue still tries to apply to it on the next display link tick, so performOperations touches freed memory and crashes.
Because the signature is entirely in native Reanimated frames and reproduces across app versions 9.4.25 through 9.4.31 (no route captured), there is no single first-party TypeScript line that "causes" it. It is a native stability defect in the pinned Reanimated version combined with animations that are allowed to keep running after their host unmounts. None of the App snippets provided touch worklets directly, which confirms the fault is in the native layer rather than a specific screen.
What changes do you think we should make in order to solve the problem?
Bump react-native-reanimated in package.json to the latest patch that includes the performOperations / AnimationFrameQueue use-after-free hardening. This is the primary fix because the crash lives entirely in native Reanimated frames and cannot be resolved from JS alone. After bumping, regenerate Podfile.lock so the iOS HybridApp binary picks up the patched pod.
As a defensive App-side guard, cancel any long-running or looping animations on unmount so no operation stays queued for a detached view. In components that start animations with withRepeat/withTiming on a useSharedValue, add a cleanup effect that calls cancelAnimation(sharedValue):
This stops Reanimated from enqueuing further frame operations for a node whose view is being freed, which is the exact condition that leads to the freed-pointer access in performOperations.
Add a Sentry breadcrumb/tag capture around navigation transitions so future events record the affected route. Today the Sentry issue reports Affected route(s): unknown, so we cannot narrow the specific animated screen; tagging the active route on transition (near App bootstrap in App.tsx) will let us confirm the version bump resolved it or pinpoint the offending component.
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
MagicCodeInput starts an infinite repeating cursor-blink animation in useEffect with no cleanup handler. When the component unmounts—especially during HybridApp transitions between OldDot and NewDot—the animation's repeating withRepeat(..., -1, false) call continues executing on the Reanimated UI thread, but the underlying animated node reference becomes invalid. When Reanimated's native REANodesManager.performOperations executes on the next display link, it operates on a deallocated or stale node pointer, triggering EXC_BAD_ACCESS.
The useEffect with empty dependencies fires once on mount and sets an infinite repeating animation (-1 means repeat forever). There is no cleanup function — useEffect must return a cleanup that cancels the animation before unmount, but it doesn't. The animation callback runs on the UI thread even after the component is destroyed, and when React Navigation unmounts or transitions (especially during HybridApp navigation), the Reanimated node is deallocated. The next scheduled animation frame tries to update a dead node.
Why the sibling case works:
LoadingBar.tsx has the exact same pattern but with proper cleanup:
When shouldShow becomes false, it explicitly calls cancelAnimation(left) and cancelAnimation(width) before the component unmounts. PulsingView.tsx uses useAnimatedReaction with explicit cancelAnimation calls as well:
useSharedValue is created inside the component, so the cleanup function always runs before the value is garbage-collected.
cancelAnimation() is idempotent — calling it on an already-stopped animation is safe.
The animation is local to MagicCodeInput and has no side effects outside the component, so canceling it on unmount has no impact on other state.
This pattern is already proven in LoadingBar and PulsingView — we are simply applying the same guard that works elsewhere.
We can also apply the same fix to any other infinite animation that uses withRepeat(..., -1) without explicit cleanup. A grep for withRepeat.*-1 across components would find similar patterns.
What alternative solutions did you explore? (Optional)
Move the animation to a context or module-level instance: Wrong — the animation is tied to the individual component's lifecycle and its visual state. Decoupling it would make it harder to reason about and introduce race conditions during navigation.
Use useAnimatedReaction instead of useEffect: This could work, but useAnimatedReaction is for reactive dependencies on shared values, not one-time setup. A simple cleanup in useEffect is clearer and matches the pattern already in the codebase.
Activity
samranahm commentedon Jul 20, 2026
Proposal
What is the root cause of that problem?
The crash is a native
EXC_BAD_ACCESSinsidereact-native-reanimated, not inside our JS/TS code. The top frames make this clear:REANodesManager performOperationsis where Reanimated flushes queued node/view operations on the UI thread during the iOS display link (AnimationFrameQueue). TheEXC_BAD_ACCESS(mach) means the worklet is dereferencing a node or view pointer that has already been freed, i.e. a use-after-free.In practice this happens when a component that owns an animated node (a running
useAnimatedStyle/useSharedValue-driven animation) unmounts while a frame is still queued. The view backing the node is torn down, but the pending operation inAnimationFrameQueuestill tries to apply to it on the next display link tick, soperformOperationstouches freed memory and crashes.Because the signature is entirely in native Reanimated frames and reproduces across app versions 9.4.25 through 9.4.31 (no route captured), there is no single first-party TypeScript line that "causes" it. It is a native stability defect in the pinned Reanimated version combined with animations that are allowed to keep running after their host unmounts. None of the App snippets provided touch worklets directly, which confirms the fault is in the native layer rather than a specific screen.
What changes do you think we should make in order to solve the problem?
Bump
react-native-reanimatedinpackage.jsonto the latest patch that includes theperformOperations/AnimationFrameQueueuse-after-free hardening. This is the primary fix because the crash lives entirely in native Reanimated frames and cannot be resolved from JS alone. After bumping, regeneratePodfile.lockso the iOS HybridApp binary picks up the patched pod.As a defensive App-side guard, cancel any long-running or looping animations on unmount so no operation stays queued for a detached view. In components that start animations with
withRepeat/withTimingon auseSharedValue, add a cleanup effect that callscancelAnimation(sharedValue):This stops Reanimated from enqueuing further frame operations for a node whose view is being freed, which is the exact condition that leads to the freed-pointer access in
performOperations.Affected route(s): unknown, so we cannot narrow the specific animated screen; tagging the active route on transition (nearAppbootstrap inApp.tsx) will let us confirm the version bump resolved it or pinpoint the offending component.App/src/App.tsx
Lines 72 to 76 in d24f5d7
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
melvin-bot commentedon Jul 20, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @aimane-chnaif (
External)melvin-bot commentedon Jul 20, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022079255464351954766
[-][Sentry: APP-D1V] HybridApp iOS EXC_BAD_ACCESS in REANodesManager performOperations[/-][+][$250] [Sentry: APP-D1V] HybridApp iOS EXC_BAD_ACCESS in REANodesManager performOperations[/+]yusufdeveloper2903 commentedon Jul 20, 2026
Proposal
What is the root cause of that problem?
MagicCodeInputstarts an infinite repeating cursor-blink animation inuseEffectwith no cleanup handler. When the component unmounts—especially during HybridApp transitions between OldDot and NewDot—the animation's repeatingwithRepeat(..., -1, false)call continues executing on the Reanimated UI thread, but the underlying animated node reference becomes invalid. When Reanimated's nativeREANodesManager.performOperationsexecutes on the next display link, it operates on a deallocated or stale node pointer, triggeringEXC_BAD_ACCESS.The bug in detail:
App/src/components/MagicCodeInput.tsx
Lines 460 to 465 in fd467ee
The
useEffectwith empty dependencies fires once on mount and sets an infinite repeating animation (-1means repeat forever). There is no cleanup function —useEffectmust return a cleanup that cancels the animation before unmount, but it doesn't. The animation callback runs on the UI thread even after the component is destroyed, and when React Navigation unmounts or transitions (especially during HybridApp navigation), the Reanimated node is deallocated. The next scheduled animation frame tries to update a dead node.Why the sibling case works:
LoadingBar.tsxhas the exact same pattern but with proper cleanup:App/src/components/LoadingBar.tsx
Lines 54 to 60 in fd467ee
When
shouldShowbecomesfalse, it explicitly callscancelAnimation(left)andcancelAnimation(width)before the component unmounts.PulsingView.tsxusesuseAnimatedReactionwith explicitcancelAnimationcalls as well:App/src/components/PulsingView.tsx
Lines 59 to 64 in fd467ee
Both components explicitly stop animations before destruction.
MagicCodeInputdoes not.What changes do you think we should make in order to solve the problem?
Add a cleanup function to the
useEffectthat cancels the cursor animation on unmount:Why this is safe:
useSharedValueis created inside the component, so the cleanup function always runs before the value is garbage-collected.cancelAnimation()is idempotent — calling it on an already-stopped animation is safe.MagicCodeInputand has no side effects outside the component, so canceling it on unmount has no impact on other state.LoadingBarandPulsingView— we are simply applying the same guard that works elsewhere.We can also apply the same fix to any other infinite animation that uses
withRepeat(..., -1)without explicit cleanup. A grep forwithRepeat.*-1across components would find similar patterns.What alternative solutions did you explore? (Optional)
useAnimatedReactioninstead ofuseEffect: This could work, butuseAnimatedReactionis for reactive dependencies on shared values, not one-time setup. A simple cleanup inuseEffectis clearer and matches the pattern already in the codebase.14 remaining items
mountiny commentedon Aug 6, 2026
Lets wait couple more days but looks promising
melvin-bot commentedon Aug 10, 2026
@jakubstec Eep! 4 days overdue now. Issues have feelings too...
jakubstec commentedon Aug 11, 2026
still zero occurences!
melvin-bot commentedon Aug 14, 2026
@jakubstec Whoops! This issue is 2 days overdue. Let's get this updated quick!
jakubstec commentedon Aug 17, 2026
@mountiny 0 crashes in the last 7 days, and still none of post
9.4.45-14releasemountiny commentedon Aug 17, 2026
Seems like this is fixed!