Created attachment 89625 [details]
Vertex shader that has deep macro
The attached shader causes literally gigabytes upon gigabytes of memory to be consumed when submitted to Mesa. The shader cause is because it compounds macros many levels deep. Mesa is at the stage of applying the preprocessor and does not get to even parsing the shader, much less compiling it.
The main issue is for WebGL enabled browsers. Indeed, a malicious website could submit such a shader (which is quite small) and bring the user's system to a standstill halt almost.
A possible fix is to essentially add additional logic to the preprocessor computing the complexity multiplier of a macro and if that complexity multiplies is too high to abort with a message that macro expands into a too large expression.
Created attachment 89626 [details]
paired fragment shader
Nice find. Are you planning to try and fix this bug?
Since this is a preprocessor issue, changing the component to glsl-compiler and reassigning to Carl as a default assignee.