Bug 148957 - Static variables in GraphicsContext3DOpenGLCommon should be avoided because of the race condition
Summary: Static variables in GraphicsContext3DOpenGLCommon should be avoided because o...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jinyoung Hur
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-08 08:40 PDT by Jinyoung Hur
Modified: 2015-09-10 11:48 PDT (History)
5 users (show)

See Also:


Attachments
Patch (4.34 KB, patch)
2015-09-08 08:47 PDT, Jinyoung Hur
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jinyoung Hur 2015-09-08 08:40:04 PDT
There is no guarantee that only one thread calls GraphicsContext3D::compileShader() at a time so it would be 
better to use a thread local storage variable rather than use a static variable.

In my case, the race condition is occurred when multiple instances of TextureMapperShaderProgram are created on each other thread and 
the constructors of TextureMapperShaderProgram call GraphicsContext3D::compileShader() simultaneously.
Comment 1 Jinyoung Hur 2015-09-08 08:47:42 PDT
Created attachment 260761 [details]
Patch
Comment 2 WebKit Commit Bot 2015-09-10 11:48:07 PDT
Comment on attachment 260761 [details]
Patch

Clearing flags on attachment: 260761

Committed r189580: <http://trac.webkit.org/changeset/189580>
Comment 3 WebKit Commit Bot 2015-09-10 11:48:12 PDT
All reviewed patches have been landed.  Closing bug.