-
Notifications
You must be signed in to change notification settings - Fork 282
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
don't panic when an invalid font instance key is supplied #1664
Conversation
Can you describe those situations? |
5f8f4b1
to
f2ae2ce
Compare
This seems reasonable to me - I think the API should probably not panic if an invalid key is supplied. Are you fine with merging this @jrmuizel ? We might like to consider having a "strict" mode in the future, where invalid API calls to panic? |
Gankro at least found one case where we invalidate the whole font cache on the Gecko side while a display item using some of the fonts therein is in flight. Now, arguably, that could be looked at as a bug on its own, but I would rather just have us fail to render and warn in those situations rather than simply crash, since we will probably encounter similar bugs in the future in releases. |
I'd rather we crash so we catch these bugs earlier. If we need to turn off this panic than I'd rather it be because we're forced into it. This is basically a use after free and I'd like to better understand why we need that to be valid before giving into turning this into a warning. |
I think this is a reasonable strategy. For the specific case, it means updating fonts can cause text to flicker for a frame; not a big deal. More broadly "not rendering" is a fairly reasonable solution to "no font", and if we ever have any serious bugs where we're losing fonts, the warnings should be fairly clear for those debugging it. |
We recently changed the This is used to gracefully handle the situation where a driver fails to compile a normally valid shader (since they are compiled lazily on first use). See webrender/webrender/src/renderer.rs Line 1747 in 400ae87
My suggestion is to merge this PR, and as a follow up I'll add the infrastructure to enable passing errors like this through the pipeline to be returned as part of the list of errors that occurred during rendering that frame. If we do that, this will mean:
@jrmuizel Does that sound reasonable? |
@glennw plan sounds reasonable to me. |
@bors-servo r+ |
📌 Commit f2ae2ce has been approved by |
don't panic when an invalid font instance key is supplied This is a small modification to my previous FontInstanceKey to allow invalid font instance keys to work around the issue described in https://bugzilla.mozilla.org/show_bug.cgi?id=1396056 There are somewhat legitimate situations where this can occur, so we don't want to panic. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/1664) <!-- Reviewable:end -->
☀️ Test successful - status-travis |
Some reviews in WR that Gankro has worked on: servo/webrender#1830 servo/webrender#1799 servo/webrender#1834 servo/webrender#1664
Add Gankro to WR reviewers list. Some reviews in WR that Gankro has worked on: servo/webrender#1830 servo/webrender#1799 servo/webrender#1834 servo/webrender#1664 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/saltfs/740) <!-- Reviewable:end -->
This is a small modification to my previous FontInstanceKey to allow invalid font instance keys to work around the issue described in https://bugzilla.mozilla.org/show_bug.cgi?id=1396056
There are somewhat legitimate situations where this can occur, so we don't want to panic.
This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)