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
Harden assert for creating atom from raw pointer #18302
Conversation
Heads up! This PR modifies the following files:
|
r? @bholley The patch is updated to asserting only when constructing |
There are six places we do We have three assertions here. One of the rest is |
@bors-servo delegate+ I think we can drop it from with(). Any persistence of the atom outside the scope of the callback would require a clone() call, and that will trigger the other assertion in from(). Avoiding it on the ::with call will avoid extra overhead on [1]. That code is hot, and while I'm doubtful that an extra null-check matters at that scale, it's easier to play it safe. r=me with that |
✌️ @upsuper can now approve this pull request |
@bors-servo r=bholley |
📌 Commit 4f6752e has been approved by |
Harden assert for creating atom from raw pointer One of Stylo's common assertion turns out to be from having a null Atom (see [Gecko 1385925 bug comment 7](https://bugzilla.mozilla.org/show_bug.cgi?id=1385925#c7)). It would be helpful if we can catch this kind of crash earlier via a release-assertion. This may regress performance to some extent which I'm not sure. But we can probably have it there for diagnosis for now, and remove later. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18302) <!-- Reviewable:end -->
💔 Test failed - linux-rel-wpt |
@bors-servo retry |
⚡ Previous build results for android, mac-dev-unit, windows-msvc-dev are reusable. Rebuilding only arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4... |
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev |
One of Stylo's common assertion turns out to be from having a null Atom (see Gecko 1385925 bug comment 7). It would be helpful if we can catch this kind of crash earlier via a release-assertion.
This may regress performance to some extent which I'm not sure. But we can probably have it there for diagnosis for now, and remove later.
This change is