Title: [292154] trunk/Source/WebCore
- Revision
- 292154
- Author
- [email protected]
- Date
- 2022-03-31 04:48:50 -0700 (Thu, 31 Mar 2022)
Log Message
REGRESSION? (248052@main): ASSERTION FAILED: didContain in WebCore::removeActiveContext(WebCore::WebGLRenderingContextBase &)
https://bugs.webkit.org/show_bug.cgi?id=238280
Patch by Kimmo Kinnunen <[email protected]> on 2022-03-31
Reviewed by Myles C. Maxfield.
WebGL would record active contexts to a TLS variable in order to cap amount of
contexts. In WebKitLegacy the main thread might be either web thread or real main
thread, and as such the TLS variable cannot be used for main thread.
Instead, special case main thread active contexts to a specific global variable.
Tested by TestWebKitAPI.WebKitLegacy.WebGLNoCrashOnOtherThreadAccess.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::activeContexts):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (292153 => 292154)
--- trunk/Source/WebCore/ChangeLog 2022-03-31 11:39:22 UTC (rev 292153)
+++ trunk/Source/WebCore/ChangeLog 2022-03-31 11:48:50 UTC (rev 292154)
@@ -1,3 +1,21 @@
+2022-03-31 Kimmo Kinnunen <[email protected]>
+
+ REGRESSION? (248052@main): ASSERTION FAILED: didContain in WebCore::removeActiveContext(WebCore::WebGLRenderingContextBase &)
+ https://bugs.webkit.org/show_bug.cgi?id=238280
+
+ Reviewed by Myles C. Maxfield.
+
+ WebGL would record active contexts to a TLS variable in order to cap amount of
+ contexts. In WebKitLegacy the main thread might be either web thread or real main
+ thread, and as such the TLS variable cannot be used for main thread.
+
+ Instead, special case main thread active contexts to a specific global variable.
+
+ Tested by TestWebKitAPI.WebKitLegacy.WebGLNoCrashOnOtherThreadAccess.
+
+ * html/canvas/WebGLRenderingContextBase.cpp:
+ (WebCore::activeContexts):
+
2022-03-31 Diego Pino Garcia <[email protected]>
[WPE] Unreviewed, fix non-unified build after r292139
Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (292153 => 292154)
--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp 2022-03-31 11:39:22 UTC (rev 292153)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp 2022-03-31 11:48:50 UTC (rev 292154)
@@ -796,6 +796,14 @@
static WebGLRenderingContextBaseSet& activeContexts()
{
+ if (isMainThread()) {
+ // WebKitLegacy special case: check for main thread because TLS does not work when entering sometimes from
+ // WebThread and sometimes from real main thread.
+ // Leave this on for non-legacy cases, as this is the base case for current operation where offscreen canvas
+ // is not supported or is rarely used.
+ static NeverDestroyed<WebGLRenderingContextBaseSet> s_mainThreadActiveContexts;
+ return s_mainThreadActiveContexts.get();
+ }
static LazyNeverDestroyed<ThreadSpecific<WebGLRenderingContextBaseSet>> s_activeContexts;
static std::once_flag s_onceFlag;
std::call_once(s_onceFlag, [] {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes