<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 - X server crashes in i965 on desktop startup when DRI3 v1.2 / modifier support is enabled"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=106642">106642</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>X server crashes in i965 on desktop startup when DRI3 v1.2 / modifier support is enabled
          </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>Keywords</th>
          <td>regression
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>blocker
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>highest
          </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>eero.t.tamminen@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=139737" name="attach_139737" title="Gdb backtrace of the X server crash">attachment 139737</a> <a href="attachment.cgi?id=139737&action=edit" title="Gdb backtrace of the X server crash">[details]</a></span>
Gdb backtrace of the X server crash

Setup:
* drm-tip kernel
* Mesa git from last night
* X server v1.20 or newer, with DRI3 v1.2 / modifiers enabled in X
configuration:
------------------------
Section "ServerFlags"
    Option "Debug" "dmabuf_capable"
EndSection
------------------------
* Rest is Ubuntu 16.04


Use-case:
* Log in to X session that uses GL/GLES compositor (Unity, Gnome...)

Expected result:
* Desktop appears

Actual result:
* X crashes in i965 driver, on all devices we have

Crash disappears if one disables the X configuration "dmabuf_capable" setting
that enables DRI3 v1.2 / modifiers support in X.


Crash is here:
Thread 1 "X" received signal SIGSEGV, Segmentation fault.
0x00007f19d6d487ca in isl_format_supports_ccs_e
(devinfo=devinfo@entry=0x2286ab8, format=ISL_FORMAT_UNSUPPORTED)
    at isl/isl_format.c:558

See attached Gdb backtrace for more info.


Looking at the indicated code, the bug is obvious:

* isl.h declares:
  ISL_FORMAT_UNSUPPORTED = UINT16_MAX

* isl_format_supports_ccs_e() function uses that as array index:
-------------------------------
isl_format_supports_ccs_e(const struct gen_device_info *devinfo,
                          enum isl_format format)
{
   if (!format_info[format].exists)
      return false;
...
-------------------------------

* But array size is much smaller:
  $ grep "  SF" ./src/intel/isl/isl_format.c | wc -l
  258


Crash started to happen between:
* 2018-05-22 17:02:28 UTC: 92f01fc5f9: i965: Emit VF cache invalidates for
48-bit addressing bugs with softpin.
* 2018-05-23 17:19:04 UTC: b73b340c37: i965: add {X,A}BGR2101010 to
'intel_image_formats'

Either addition of the new formats, or Jason's blitter support removal commits
started to trigger usage of ISL_FORMAT_UNSUPPORTED.</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>