WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
38962
Must not crash if vertex attribute array is enabled but uninitialized
https://bugs.webkit.org/show_bug.cgi?id=38962
Summary
Must not crash if vertex attribute array is enabled but uninitialized
Kenneth Russell
Reported
2010-05-11 18:50:08 PDT
Currently most of the ports of WebGL will crash in the following situation: - enableVertexAttribArray(index) is called, but a pointer is not set up via bindBuffer / vertexAttribPointer - drawArrays or drawElements is called, even if the current program does not reference this particular attribute array. The problem is that the vertex attribute is initially set up for client-side arrays. The GL apparently does not have enough information to know that the attribute array is unreferenced by the current program and attempts to copy its data to the graphics card, leading to a NULL pointer dereference and a crash. This does not appear to happen when a vertex buffer object is bound to the vertex attribute. To fix this, we hypothesize that it is sufficient to bind a zero-length buffer object to all of the vertex attribute arrays at context initialization time. This way their storage is always specified to live on the graphics card. It is not possible with the WebGL API to re-initialize a vertex attribute array to use client-side arrays. Note that the index validation already in place prevents attempts to walk off the end of vertex buffer objects actually referenced by the program.
Attachments
patch
(13.96 KB, patch)
2010-05-25 17:48 PDT
,
Zhenyao Mo
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Zhenyao Mo
Comment 1
2010-05-25 17:48:50 PDT
Created
attachment 57057
[details]
patch For the newly added test, Chrome with CommandBuffer port will crash without this patch, but will not crash with this patch.
Zhenyao Mo
Comment 2
2010-05-26 15:09:27 PDT
Patch becomes invalid due to the new WebGL spec updates.
Zhenyao Mo
Comment 3
2010-06-10 09:49:34 PDT
See
https://bugs.webkit.org/show_bug.cgi?id=40315
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug