<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Assertion failure comparing result of ballotARB"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=101360">101360</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion failure comparing result of ballotARB
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Mesa
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>git
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>glsl-compiler
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>jlegg@feralinteractive.com
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>intel-3d-bugs@lists.freedesktop.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=131825" name="attach_131825" title="Piglit test reproducing the problem">attachment 131825</a> <a href="attachment.cgi?id=131825&action=edit" title="Piglit test reproducing the problem">[details]</a></span>
Piglit test reproducing the problem

When comparing a constant to the result of a call to the ballotARB function, or
a variable containing the result, an assert in void
glsl_to_tgsi_visitor::copy_propagate() can fail. If assertions are disabled,
then copy_propagate writes over the end of an allocation, corrupting memory
instead.

The attached patch to piglit adds a test reproducing the problem.

Steps to reproduce:
 1) Apply attached patch to piglit
 2) Run ./piglit run -t arb_shader_ballot shader results/ballot
    The newly added test will crash.

The test crashes with:
state_tracker/st_glsl_to_tgsi.cpp:4936: void
glsl_to_tgsi_visitor::copy_propagate(): Assertion `inst->dst[0].file !=
PROGRAM_TEMPORARY || inst->dst[0].index < this->next_temp' failed.

I'm using mesa ada3c3aa3da5d04bd597014dc1b5d4b028313513 with an AMD RX480.</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>