RESOLVED FIXED 261297
[Win] stack overflow in ANGLE for webgl/2.0.y/conformance/glsl/bugs/complex-glsl-does-not-crash.html
https://bugs.webkit.org/show_bug.cgi?id=261297
Summary [Win] stack overflow in ANGLE for webgl/2.0.y/conformance/glsl/bugs/complex-g...
Fujii Hironori
Reported 2023-09-07 15:17:59 PDT
[Win] Infinite loop in ANGLE if compiled by clang-cl Windows port clang-cl release builds are crashing for the following tests. I'm using LLVM 16.0.6. Regressions: Unexpected crashes (2) webgl/2.0.y/conformance/glsl/bugs/complex-glsl-does-not-crash.html [ Crash ] webgl/2.0.y/conformance/glsl/misc/shader-uniform-packing-restrictions.html [ Crash ] It's an infinite loop. Callstack > libGLESv2.dll!sh::TIntermBinary::propagatePrecision(sh::TPrecision precision) Line 2031 C++ > [Inline Frame] libGLESv2.dll!sh::`anonymous namespace'::PropagatePrecisionIfApplicable(sh::TIntermTyped * node, sh::TPrecision precision) Line 192 C++ > libGLESv2.dll!sh::TIntermBinary::propagatePrecision(sh::TPrecision precision) Line 2039 C++ > [Inline Frame] libGLESv2.dll!sh::`anonymous namespace'::PropagatePrecisionIfApplicable(sh::TIntermTyped * node, sh::TPrecision precision) Line 192 C++ > libGLESv2.dll!sh::TIntermBinary::propagatePrecision(sh::TPrecision precision) Line 2039 C++ > (...) Is this a compiler optimizer bug?
Attachments
Patch to reduce complex-glsl-does-not-crash.html (3.95 KB, patch)
2023-09-12 14:08 PDT, Fujii Hironori
no flags
Fujii Hironori
Comment 1 2023-09-12 14:08:38 PDT
Created attachment 467668 [details] Patch to reduce complex-glsl-does-not-crash.html In webgl/2.0.y/conformance/glsl/bugs/complex-glsl-does-not-crash.html, "test: vertex shader with 16384 uniforms of bool" causes the stack overflow.
Fujii Hironori
Comment 2 2023-09-12 20:17:15 PDT
The test is hosted online there. https://registry.khronos.org/webgl/sdk/tests/conformance/glsl/bugs/complex-glsl-does-not-crash.html The test vertex shader contains a very long expression. > v_varying = vec4(u_uniform0, 0, 0, 0) + > vec4(u_uniform1, 0, 0, 0) + > vec4(u_uniform2, 0, 0, 0) + > (...) > vec4(u_uniform16382, 0, 0, 0) + > vec4(u_uniform16383, 0, 0, 0);
Fujii Hironori
Comment 3 2023-09-12 22:46:30 PDT
This is not clang-cl release build specific. clang-cl and MSVC debug builds are also the case. But, MSVC release build isn't. MSVC release build consumes 48 bytes for each TIntermBinary::propagatePrecision funciton call, while clang-cl release build consumes 64 bytes. The test case has 16384 additions. 64 * 16384 = 1M 1M is the default stack size of Windows program.
Fujii Hironori
Comment 4 2023-09-12 22:51:56 PDT
WinCairo Debug is skipping the test cases. > [ Debug ] webgl/2.0.y/conformance/glsl/bugs/complex-glsl-does-not-crash.html [ Skip ] # Slow > [ Debug ] webgl/2.0.y/conformance/glsl/misc/shader-uniform-packing-restrictions.html [ Skip ] # Slow https://github.com/WebKit/WebKit/blob/20ce50e23068f44e6025e5d6c4196d8aa1116add/LayoutTests/platform/wincairo/TestExpectations#L1908
Fujii Hironori
Comment 5 2023-09-12 23:17:30 PDT
I run the test with STP 178 on my Mac mini (2018). "test: vertex shader with 4096 uniforms of bool" Only 4096 uniforms.
Fujii Hironori
Comment 6 2023-09-12 23:45:24 PDT
I tested the latest Epiphany Tech Preview too. It has only 4096 uniforms.
Fujii Hironori
Comment 7 2023-09-13 00:00:30 PDT
267933@main skips the tests for Windows port temporarily.
Fujii Hironori
Comment 8 2023-09-13 21:42:18 PDT
Radar WebKit Bug Importer
Comment 9 2023-09-14 15:18:18 PDT
Fujii Hironori
Comment 10 2023-09-18 18:43:21 PDT
EWS
Comment 11 2023-09-18 19:52:38 PDT
Committed 268108@main (7c14f48e920c): <https://commits.webkit.org/268108@main> Reviewed commits have been landed. Closing PR #17892 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.