<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 - crash happens when link program"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=107879">107879</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>crash happens when link program
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (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>intel-3d-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>xinghua.cao@intel.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=141498" name="attach_141498" title="verpixshader.c">attachment 141498</a> <a href="attachment.cgi?id=141498&action=edit" title="verpixshader.c">[details]</a></span>
verpixshader.c

This issue happens on chrome when run this case,
<a href="https://www.khronos.org/registry/webgl/sdk/tests/conformance2/glsl3/short-circuiting-in-loop-condition.html?webglVersion=2&quiet=0">https://www.khronos.org/registry/webgl/sdk/tests/conformance2/glsl3/short-circuiting-in-loop-condition.html?webglVersion=2&quiet=0</a>
But I also reproduced it when writing a simple case.
Steps:
1. Download the attached file, and use "gcc -o verpixshader verpixshader.c
-lX11 -lepoxy" to build target file.
2. run "./verpixshader", crash happens.

Note: It seems a regression of latest mesa code. And the crash stack is as
below,
Thread 1 "verpixshader" received signal SIGSEGV, Segmentation fault.
validate_intrinsic_instr (state=<optimized out>, instr=0x555555ed4210) at
nir/nir_validate.c:525
525           validate_assert(state, dst->type == src->type);
(gdb) bt
#0  validate_intrinsic_instr (state=<optimized out>, instr=0x555555ed4210) at
nir/nir_validate.c:525
#1  validate_instr (state=<optimized out>, instr=0x555555ed4210) at
nir/nir_validate.c:631
#2  validate_block (state=<optimized out>, block=0x555555ef5680) at
nir/nir_validate.c:713
#3  validate_cf_node (node=0x555555ef5680, state=<optimized out>) at
nir/nir_validate.c:877
#4  0x00007ffff37f428b in validate_function_impl (state=<optimized out>,
impl=<optimized out>) at nir/nir_validate.c:1095
#5  validate_function (state=0x7fffffffd940, func=0x55555590d690) at
nir/nir_validate.c:1113
#6  nir_validate_shader (shader=shader@entry=0x555555ec4610) at
nir/nir_validate.c:1224
#7  0x00007ffff3a32bdd in brw_nir_optimize (nir=nir@entry=0x555555ec4610,
compiler=compiler@entry=0x55555579bf50, is_scalar=is_scalar@entry=true,
allow_copies=allow_copies@entry=true)
    at compiler/brw_nir.c:584
#8  0x00007ffff3a34d45 in brw_preprocess_nir (compiler=0x55555579bf50,
nir=nir@entry=0x555555ec4610) at compiler/brw_nir.c:685
#9  0x00007ffff38651c7 in brw_create_nir (brw=brw@entry=0x5555558c8e60,
shader_prog=shader_prog@entry=0x555555903e60, prog=prog@entry=0x555555908330,
stage=stage@entry=MESA_SHADER_FRAGMENT, 
    is_scalar=<optimized out>) at brw_program.c:106
#10 0x00007ffff38595b1 in brw_link_shader (ctx=0x5555558c8e60,
shProg=0x555555903e60) at brw_link.cpp:267
#11 0x00007ffff36524e7 in _mesa_glsl_link_shader (ctx=ctx@entry=0x5555558c8e60,
prog=prog@entry=0x555555903e60) at program/ir_to_mesa.cpp:3180
#12 0x00007ffff355075c in link_program (no_error=<optimized out>,
shProg=<optimized out>, ctx=<optimized out>) at main/shaderapi.c:1211
#13 link_program_error (ctx=0x5555558c8e60, shProg=0x555555903e60) at
main/shaderapi.c:1296
#14 0x00007ffff3550a97 in _mesa_LinkProgram (programObj=<optimized out>) at
main/shaderapi.c:1789
#15 0x00005555555550ee in main ()</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>