Summary: | Fix a crash caused by AVIF decoding failure | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | ChangSeok Oh <changseok> | ||||||||
Component: | Images | Assignee: | ChangSeok Oh <changseok> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | alex, cgarcia, pnormand, sabouhallawa, webkit-bug-importer | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=225039 | ||||||||||
Attachments: |
|
Description
ChangSeok Oh
2021-03-27 14:19:46 PDT
Created attachment 424467 [details]
Patch
Comment on attachment 424467 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=424467&action=review > Source/WebCore/ChangeLog:14 > + No new tests since no functionality changed. I think a test ensuring we no longer crash when loading a specific file could still make sense. There's a few already for the video-as-img-tag scenario. Comment on attachment 424467 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=424467&action=review >> Source/WebCore/ChangeLog:14 >> + No new tests since no functionality changed. > > I think a test ensuring we no longer crash when loading a specific file could still make sense. There's a few already for the video-as-img-tag scenario. O.K. Let me look into if we can create a reliable test. The minimal test case that reproduces the crash is <iframe src='https://gif2avif.com/sample.avif'></iframe> However, the crash does not happen when the sample.avif is loaded from the local. <iframe src='sample.avif'></iframe> Is there a way to mimic a network delay in webkit test infrastructure? I found bug 194506. There was testRunner.setDefersLoading but it isn't for wk2 anymore. I could make a simplified test here. https://shivamidow.github.io/avif-crash.html But I don't know how to mimic it in the webkit test environment. It is hard to reproduce the crash because there is no way to reliably simulate the necessary network delay of the avif image transfer. One option could be to throttle the HTTP request? ThereĀ“s a CGI script for videos: LayoutTests/http/tests/media/video-throttled-load.cgi Maybe a similar approach could be used? You may use LayoutTests/http/tests/images/resources/load-and-stall.php. It is used to mimic the network delay in many http layout tests. (In reply to Said Abou-Hallawa from comment #9) > You may use LayoutTests/http/tests/images/resources/load-and-stall.php. It > is used to mimic the network delay in many http layout tests. @Philippe and @Said, Thanks. Let me give a shot. Created attachment 426989 [details]
Patch
Created attachment 426990 [details]
Patch
Comment on attachment 426990 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=426990&action=review > LayoutTests/TestExpectations:125 > fast/images/avif-image-decoding.html [ Skip ] > fast/images/avif-as-image.html [ Skip ] > fast/images/animated-avif.html [ Skip ] > +http/tests/images/avif-partial-load-crash.html [ Skip ] Oh, I realize now I forgot to unskip these in the glib TestExpections! They should pass now that the avif decoder is enabled on the bots. Can you check it please? Either in this patch or a new one :) Comment on attachment 426990 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=426990&action=review Thanks! >> LayoutTests/TestExpectations:125 >> +http/tests/images/avif-partial-load-crash.html [ Skip ] > > Oh, I realize now I forgot to unskip these in the glib TestExpections! They should pass now that the avif decoder is enabled on the bots. Can you check it please? Either in this patch or a new one :) I will upload a separate patch to handle this. Committed r276578 (237014@main): <https://commits.webkit.org/237014@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 426990 [details]. |