<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 - Invalid write in push_loop_stack"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=94616">94616</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Invalid write in push_loop_stack
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>Drivers/DRI/i965
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>idr@freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>marcandre.lureau@gmail.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=122424" name="attach_122424" title="0001-i965-fix-invalid-memory-write.patch">attachment 122424</a> <a href="attachment.cgi?id=122424&action=edit" title="0001-i965-fix-invalid-memory-write.patch">[details]</a></span>
0001-i965-fix-invalid-memory-write.patch

I noticed some heap corruption running virgl tests, and valgrind
    helped me to track it down to the following error:

    ==29272== Invalid write of size 4
    ==29272==    at 0x90283D4: push_loop_stack (brw_eu_emit.c:1307)
    ==29272==    by 0x9029A7D: brw_DO (brw_eu_emit.c:1750)
    ==29272==    by 0x90554B0: fs_generator::generate_code(cfg_t const*, int)
(brw_fs_generator.cpp:1999)
    ==29272==    by 0x904491F: brw_compile_fs (brw_fs.cpp:5685)
    ==29272==    by 0x8FC5DC5: brw_codegen_wm_prog (brw_wm.c:137)
    ==29272==    by 0x8FC7663: brw_fs_precompile (brw_wm.c:638)
    ==29272==    by 0x8FA4040: brw_shader_precompile(gl_context*,
gl_shader_program*) (brw_link.cpp:51)
    ==29272==    by 0x8FA4A9A: brw_link_shader (brw_link.cpp:260)
    ==29272==    by 0x8DEF751: _mesa_glsl_link_shader (ir_to_mesa.cpp:3006)
    ==29272==    by 0x8C84325: _mesa_link_program (shaderapi.c:1042)
    ==29272==    by 0x8C851D7: _mesa_LinkProgram (shaderapi.c:1515)
    ==29272==    by 0x4E4B8E8: add_shader_program (vrend_renderer.c:880)
    ==29272==  Address 0xf2f3cb0 is 0 bytes after a block of size 112 alloc'd
    ==29272==    at 0x4C2AA98: calloc (vg_replace_malloc.c:711)
    ==29272==    by 0x8ED11F7: ralloc_size (ralloc.c:113)
    ==29272==    by 0x8ED1282: rzalloc_size (ralloc.c:134)
    ==29272==    by 0x8ED14C0: rzalloc_array_size (ralloc.c:196)
    ==29272==    by 0x9019C7B: brw_init_codegen (brw_eu.c:291)
    ==29272==    by 0x904F565: fs_generator::fs_generator(brw_compiler const*,
void*, void*, void const*, brw_stage_prog_data*, unsigned int, bool,
gl_shader_stage) (brw_fs_generator.cpp:124)
    ==29272==    by 0x9044883: brw_compile_fs (brw_fs.cpp:5675)
    ==29272==    by 0x8FC5DC5: brw_codegen_wm_prog (brw_wm.c:137)
    ==29272==    by 0x8FC7663: brw_fs_precompile (brw_wm.c:638)
    ==29272==    by 0x8FA4040: brw_shader_precompile(gl_context*,
gl_shader_program*) (brw_link.cpp:51)
    ==29272==    by 0x8FA4A9A: brw_link_shader (brw_link.cpp:260)
    ==29272==    by 0x8DEF751: _mesa_glsl_link_shader (ir_to_mesa.cpp:3006)


See attached patch for possible solution</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>