<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Compounded macros in shaders: huge memory consumption"
href="https://bugs.freedesktop.org/show_bug.cgi?id=71912">71912</a>
</td>
</tr>
<tr>
<th>Assignee</th>
<td>mesa-dev@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Summary</th>
<td>Compounded macros in shaders: huge memory consumption
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Reporter</th>
<td>kevin.rogovin@intel.com
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Version</th>
<td>9.1
</td>
</tr>
<tr>
<th>Component</th>
<td>Mesa core
</td>
</tr>
<tr>
<th>Product</th>
<td>Mesa
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=89625" name="attach_89625" title="Vertex shader that has deep macro">attachment 89625</a> <a href="attachment.cgi?id=89625&action=edit" title="Vertex shader that has deep macro">[details]</a></span>
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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>