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
On React Native 0.85 (New Architecture / Fabric, iOS), EnrichedMarkdownText (via react-native-streamdown's StreamdownText) crashes with EXC_BAD_ACCESS whenever the component's state updates (height recalculation write-back). The crash is inside the EnrichedMarkdownShadowNodeclone constructor, which calls dirtyLayoutIfNeeded() → YGNodeMarkDirty(&yogaNode_) on a freshly-cloned node whose Yoga node has no measure function attached yet.
Environment
package
version
react-native-enriched-markdown
0.6.0
react-native
0.85.3
New Architecture (Fabric)
enabled
react-native-streamdown
0.2.0
platform
iOS device, arm64, Hermes
Crash & backtrace
EXC_BAD_ACCESS (code=1, address=0x104100) on thread com.facebook.react.runtime.JavaScript:
// EnrichedMarkdownShadowNode.mmvoidEnrichedMarkdownShadowNode::dirtyLayoutIfNeeded() {
constauto state = this->getStateData();
constint receivedCounter = state.getHeightRecalculationCounter();
if (receivedCounter > localHeightRecalculationCounter_) {
localHeightRecalculationCounter_ = receivedCounter;
YGNodeMarkDirty(&yogaNode_); // line 41 — EXC_BAD_ACCESS
}
}
Root cause
The measured height is written back into the ShadowNode state (heightRecalculationCounter).
RN flushes that state update → UIManager::updateState → ShadowTree::commit → cloneTree → cloneShadowNode, invoking the clone constructor (mm:23 / mm:31).
The clone constructor calls dirtyLayoutIfNeeded() → YGNodeMarkDirty(&yogaNode_).
YGNodeMarkDirty requires the Yoga node to have a measure function attached. On the freshly-cloned node the measure function is not set up yet at construction time → markDirtyAndPropagate dereferences invalid memory → EXC_BAD_ACCESS.
This reproduces reliably on RN 0.85; it appears 0.85 changed the clone / Yoga-node initialization ordering such that the measure function is no longer guaranteed to be present when the clone constructor runs.
Steps to reproduce
RN 0.85, New Architecture, iOS device
Render StreamdownText / EnrichedMarkdownText and let its content / height update (streaming markdown, or any state-driven height recalculation)
Crash at YGNodeMarkDirty during the state-update commit
Notes
Worklets Bundle Mode is correctly set up and working (Downloaded the bundle for Worklet Runtimes logs fine) — this is independent of streamdown's worklet pipeline, purely the native layout path.
Description
On React Native 0.85 (New Architecture / Fabric, iOS),
EnrichedMarkdownText(viareact-native-streamdown'sStreamdownText) crashes withEXC_BAD_ACCESSwhenever the component's state updates (height recalculation write-back). The crash is inside theEnrichedMarkdownShadowNodeclone constructor, which callsdirtyLayoutIfNeeded()→YGNodeMarkDirty(&yogaNode_)on a freshly-cloned node whose Yoga node has no measure function attached yet.Environment
Crash & backtrace
EXC_BAD_ACCESS (code=1, address=0x104100)on threadcom.facebook.react.runtime.JavaScript:Offending code:
Root cause
heightRecalculationCounter).UIManager::updateState→ShadowTree::commit→cloneTree→cloneShadowNode, invoking the clone constructor (mm:23 / mm:31).dirtyLayoutIfNeeded()→YGNodeMarkDirty(&yogaNode_).YGNodeMarkDirtyrequires the Yoga node to have a measure function attached. On the freshly-cloned node the measure function is not set up yet at construction time →markDirtyAndPropagatedereferences invalid memory →EXC_BAD_ACCESS.This reproduces reliably on RN 0.85; it appears 0.85 changed the clone / Yoga-node initialization ordering such that the measure function is no longer guaranteed to be present when the clone constructor runs.
Steps to reproduce
StreamdownText/EnrichedMarkdownTextand let its content / height update (streaming markdown, or any state-driven height recalculation)YGNodeMarkDirtyduring the state-update commitNotes
Downloaded the bundle for Worklet Runtimeslogs fine) — this is independent of streamdown's worklet pipeline, purely the native layout path.