-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Guard against seg fault if replaceChild index is out of bounds #1744
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request was exported from Phabricator. Differential Revision: D66038645 |
5f6cc74
to
89e55b3
Compare
…ook#1744) Summary: X-link: facebook/react-native#47644 We are seeing some seg faults after the new display: contents logic was added. This is either because we are passing in an out of bounds index - in which case we try to read `display_` from protected memory. Or, the `Node *` was deleted at some point without removing it from this array. I think its the out of bounds issue mainly because I am not sure where this deletion would occur I added an if to revert to the legacy, undefined behavior in this case. This is not ideal and we should find the root cause that is calling into this function improperly but for now it stops apps from crashing on the `replaceChild` call Changelog: [Internal] Reviewed By: rozele Differential Revision: D66038645
…ook#47644) Summary: X-link: facebook/yoga#1744 We are seeing some seg faults after the new display: contents logic was added. This is either because we are passing in an out of bounds index - in which case we try to read `display_` from protected memory. Or, the `Node *` was deleted at some point without removing it from this array. I think its the out of bounds issue mainly because I am not sure where this deletion would occur I added an if to revert to the legacy, undefined behavior in this case. This is not ideal and we should find the root cause that is calling into this function improperly but for now it stops apps from crashing on the `replaceChild` call Changelog: [Internal] Reviewed By: rozele Differential Revision: D66038645
This pull request was exported from Phabricator. Differential Revision: D66038645 |
…ook#1744) Summary: X-link: facebook/react-native#47644 We are seeing some seg faults after the new display: contents logic was added. This is either because we are passing in an out of bounds index - in which case we try to read `display_` from protected memory. Or, the `Node *` was deleted at some point without removing it from this array. I think its the out of bounds issue mainly because I am not sure where this deletion would occur I added an if to revert to the legacy, undefined behavior in this case. This is not ideal and we should find the root cause that is calling into this function improperly but for now it stops apps from crashing on the `replaceChild` call Changelog: [Internal] Reviewed By: rozele Differential Revision: D66038645
89e55b3
to
0d2abf5
Compare
…ook#47644) Summary: X-link: facebook/yoga#1744 We are seeing some seg faults after the new display: contents logic was added. This is either because we are passing in an out of bounds index - in which case we try to read `display_` from protected memory. Or, the `Node *` was deleted at some point without removing it from this array. I think its the out of bounds issue mainly because I am not sure where this deletion would occur I added an if to revert to the legacy, undefined behavior in this case. This is not ideal and we should find the root cause that is calling into this function improperly but for now it stops apps from crashing on the `replaceChild` call Changelog: [Internal] Reviewed By: rozele Differential Revision: D66038645
This pull request was exported from Phabricator. Differential Revision: D66038645 |
@joevilches how much of an emergency is this? Silently allowing shadowtree or other Yoga node corruption to happen later just moves the blame of the problem, instead of fixing anything. We should be hard asserting here, like we do in some other places by using “at()” instead of subscript operator. |
@NickGerleman oh yeah totally with you. This was a stop gap for a UBN, although I think the urgency is lower than I initially thought on Friday. I was putting this out here to at least revert to previous behavior in bad cases with a follow up to actually fix this. We can chat more tomorrow though, I plan on sitting on this change at this point. |
Summary:
We are seeing some seg faults after the new display: contents logic was added. This is either because we are passing in an out of bounds index - in which case we try to read
display_
from protected memory. Or, theNode *
was deleted at some point without removing it from this array. I think its the out of bounds issue mainly because I am not sure where this deletion would occurI added an if to revert to the legacy, undefined behavior in this case. This is not ideal and we should find the root cause that is calling into this function improperly but for now it stops apps from crashing on the
replaceChild
callChangelog: [Internal]
Reviewed By: rozele
Differential Revision: D66038645