[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?
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.
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);
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.
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
I run the test with STP 178 on my Mac mini (2018). "test: vertex shader with 4096 uniforms of bool" Only 4096 uniforms.
I tested the latest Epiphany Tech Preview too. It has only 4096 uniforms.
267933@main skips the tests for Windows port temporarily.
PR for WebGL: https://github.com/KhronosGroup/WebGL/pull/3591
<rdar://problem/115521906>
Pull request: https://github.com/WebKit/WebKit/pull/17892
Committed 268108@main (7c14f48e920c): <https://commits.webkit.org/268108@main> Reviewed commits have been landed. Closing PR #17892 and removing active labels.