Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Reproducer for #60244 (a re-file of #58299), as the issue bot asks. Not for merge. It only edits
RNTesterPlayground.js. The fix is in #60243.The playground mounts a 1,500-
Textbatch on alternate frames, more than the 1,024-view recycle pool, so the main thread keeps creating views. Right after each batch commits, it creates detached shadow nodes under component names the factory has never seen (nativeFabricUIManager.createNode). Each one forces theUnimplementedViewfallback in-[RCTComponentViewFactory _registerComponentIfPossible:], which writes the factory's maps without_mutex, while the main thread reads them in-createComponentViewWithComponentHandle:.Changelog:
[INTERNAL] - Reproducer only; not for merge.
Test Plan:
packages/react-native/React/Fabric/Mounting/RCTComponentViewFactory.mm: add-fsanitize=threadto that file's compiler flags, and-fsanitize=threadto the app's linker flags. Instrumenting the whole app also works, but is slow._componentViewClasses.findin-createComponentViewWithComponentHandle:. The other thread's write is in-_registerComponentIfPossible:, in theUnimplementedViewfallback.Without ThreadSanitizer the race is intermittent. A Debug build sometimes aborts with
RCTAssert: ComponentView with componentHandle … (Paragraph) not found; a Release build may crash on the dereferenced end iterator (see #58299).