Bug 64497

Summary: Don't restore WebGL context if it was guilty of a graphics reset
Product: WebKit Reporter: Kenneth Russell <kbr>
Component: WebGLAssignee: Kenneth Russell <kbr>
Status: RESOLVED FIXED    
Severity: Normal CC: arasmus, cdalton, cmarrin, dglazkov, jamesr, senorblanco, webkit.review.bot, zmo
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 42978    
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ec2-cr-linux-01
none
Archive of layout-test-results from ec2-cr-linux-02
none
Patch senorblanco: review+

Description Kenneth Russell 2011-07-13 18:03:38 PDT
The most significant outstanding problem with WebGL implementations is that of denial of service. Currently, if a WebGL application issues a very expensive draw call, it may cause the GPU to lock up for long periods of time. Windows' TDR and GL_ARB_robustness' "lose context on reset" functionality are the mechanisms on which detection of graphics reset will be built.

In order to take a first step toward solving the DoS problem, the WebGLRenderingContext needs to know as precisely as possible why a graphics reset occurred. It seems clear that if the WebGL context was guilty of causing the reset, we definitely should not attempt to restore it once lost.

More work on policy will need to follow; for example, a port might want to prompt the user if the reset occurred for unknown reasons, or maybe even if the context was guilty of causing the reset. This bug covers only the exposure of the real graphics reset status and a first pass at shutting down guilty contexts.
Comment 1 Kenneth Russell 2011-07-13 18:27:32 PDT
Created attachment 100748 [details]
Patch
Comment 2 WebKit Review Bot 2011-07-13 19:44:31 PDT
Comment on attachment 100748 [details]
Patch

Attachment 100748 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/9019866

New failing tests:
fast/canvas/webgl/context-lost.html
Comment 3 WebKit Review Bot 2011-07-13 19:44:37 PDT
Created attachment 100759 [details]
Archive of layout-test-results from ec2-cr-linux-01

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: ec2-cr-linux-01  Port: Chromium  Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Comment 4 WebKit Review Bot 2011-07-13 20:32:51 PDT
Comment on attachment 100748 [details]
Patch

Attachment 100748 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/9050412

New failing tests:
fast/canvas/webgl/context-lost.html
Comment 5 WebKit Review Bot 2011-07-13 20:32:58 PDT
Created attachment 100761 [details]
Archive of layout-test-results from ec2-cr-linux-02

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: ec2-cr-linux-02  Port: Chromium  Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Comment 6 Kenneth Russell 2011-07-14 17:51:17 PDT
Created attachment 100905 [details]
Patch
Comment 7 Kenneth Russell 2011-07-14 17:52:46 PDT
Revised patch updates test expectations for fast/canvas/webgl/context-lost.html.
Comment 8 Stephen White 2011-07-15 12:19:39 PDT
Comment on attachment 100905 [details]
Patch

Looks good.  r=me
Comment 9 Kenneth Russell 2011-07-15 14:23:02 PDT
Committed r91112: <http://trac.webkit.org/changeset/91112>