Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sanitize measure function results #44557

Closed
wants to merge 1 commit into from

Conversation

NickGerleman
Copy link
Contributor

Summary:
We've started seeing assertion failures in Yoga where a NaN value makes its way to an availableHeight constrtaint when measuring Litho nodes.

Because it's only happening on Litho, I have some suspicion this might be originating from a Litho-specific measure function. This adds santization in Yoga to measure function results, where we will log an error, and set size to zero, if either dimension ends up being negative of NaN.

Changelog: [Internal]

Differential Revision: D57285584

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 13, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D57285584

Summary:
We've started seeing assertion failures in Yoga where a `NaN` value makes its way to an `availableHeight` constraint when measuring Litho tree.

Because it's only happening on Litho, I have some suspicion this might be originating from a Litho-specific measure function. This adds sanitization in Yoga to measure function results, where we will log an error, and set size to zero, if either dimension ends up being negative of `NaN`.

This doesn't really help track down where the error was happening, but Yoga doesn't have great context to show this to begin with. If we see this is issue, next steps would be Litho internal intrumentation to find culprit.

Changelog: [Internal]

Differential Revision: D57285584
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D57285584

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 19,558,918 +175
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 22,928,935 +173
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 651c1d2
Branch: main

facebook-github-bot pushed a commit to facebook/litho that referenced this pull request May 14, 2024
Summary:
X-link: facebook/react-native#44557

We've started seeing assertion failures in Yoga where a `NaN` value makes its way to an `availableHeight` constraint when measuring Litho tree.

Because it's only happening on Litho, I have some suspicion this might be originating from a Litho-specific measure function. This adds sanitization in Yoga to measure function results, where we will log an error, and set size to zero, if either dimension ends up being negative of `NaN`.

This doesn't really help track down where the error was happening, but Yoga doesn't have great context to show this to begin with. If we see this is issue, next steps would be Litho internal intrumentation to find culprit.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D57285584

fbshipit-source-id: 935fcdd28c05bbac0d73e1c7654ae11a74898537
@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label May 14, 2024
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 44f9371.

Copy link

This pull request was successfully merged by @NickGerleman in 44f9371.

When will my fix make it into a release? | How to file a pick request?

facebook-github-bot pushed a commit to facebook/yoga that referenced this pull request May 14, 2024
Summary:
X-link: facebook/react-native#44557

We've started seeing assertion failures in Yoga where a `NaN` value makes its way to an `availableHeight` constraint when measuring Litho tree.

Because it's only happening on Litho, I have some suspicion this might be originating from a Litho-specific measure function. This adds sanitization in Yoga to measure function results, where we will log an error, and set size to zero, if either dimension ends up being negative of `NaN`.

This doesn't really help track down where the error was happening, but Yoga doesn't have great context to show this to begin with. If we see this is issue, next steps would be Litho internal intrumentation to find culprit.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D57285584

fbshipit-source-id: 935fcdd28c05bbac0d73e1c7654ae11a74898537
@facebook-github-bot
Copy link
Contributor

This pull request has been reverted by 1a56b9a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner Reverted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants