<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 - [softpipe] piglit egl-create-context-verify-gl-flavor regression"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=97136">97136</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[softpipe] piglit egl-create-context-verify-gl-flavor regression
          </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>Keywords</th>
          <td>bisected, regression
          </td>
        </tr>

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

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

        <tr>
          <th>Component</th>
          <td>Mesa core
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>vlee@freedesktop.org
          </td>
        </tr>

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

        <tr>
          <th>CC</th>
          <td>emil.l.velikov@gmail.com, fdo-bugs@engestrom.ch, nicolas@boichat.ch
          </td>
        </tr></table>
      <p>
        <div>
        <pre>mesa: b107169eef92e740180df468d1eae4cc61a52757 (12.1.0-devel)

$ ./bin/egl-create-context-verify-gl-flavor -auto
info: request an OpenGL 1.0 context
Segmentation fault (core dumped)

(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x00000000004011ec in get_gl_version () at
piglit/tests/egl/spec/egl_khr_create_context/verify-gl-flavor.c:102
#2  0x0000000000401751 in check_flavor (requested_version=10,
requested_api=API_GL_COMPAT) at
piglit/tests/egl/spec/egl_khr_create_context/verify-gl-flavor.c:257
#3  0x0000000000401b4e in check_opengl () at
piglit/tests/egl/spec/egl_khr_create_context/verify-gl-flavor.c:360
#4  0x00000000004024ac in main (argc=2, argv=0x7fffa9d82f78) at
piglit/tests/egl/spec/egl_khr_create_context/verify-gl-flavor.c:491
(gdb) frame 1
#1  0x00000000004011ec in get_gl_version () at
piglit/tests/egl/spec/egl_khr_create_context/verify-gl-flavor.c:102
102             version_string = (const char*) my_glGetString(GL_VERSION);
(gdb) print my_glGetString
$1 = (const char *(*)(GLenum)) 0x0


9ee683f877b283020c6f24776236f1145cb7a4ea is the first bad commit
commit 9ee683f877b283020c6f24776236f1145cb7a4ea
Author: Nicolas Boichat <<a href="mailto:drinkcat@chromium.org">drinkcat@chromium.org</a>>
Date:   Fri Jul 22 11:27:41 2016 +0800

    egl/dri2: Add reference count for dri2_egl_display

    android.opengl.cts.WrapperTest#testGetIntegerv1 CTS test calls
    eglTerminate, followed by eglReleaseThread. A similar case is
    observed in this bug: <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - eglTerminate then eglMakeCurrent crahes"
   href="show_bug.cgi?id=69622">https://bugs.freedesktop.org/show_bug.cgi?id=69622</a>,
    where the test calls eglTerminate, then eglMakeCurrent(dpy, NULL, NULL,
NULL).

    With the current code, dri2_dpy structure is freed on eglTerminate
    call, so the display is not initialized when eglReleaseThread calls
    MakeCurrent with NULL parameters, to unbind the context, which
    causes a a segfault in drv->API.MakeCurrent (dri2_make_current),
    either in glFlush or in a latter call.

    eglTerminate specifies that "If contexts or surfaces associated
    with display is current to any thread, they are not released until
    they are no longer current as a result of eglMakeCurrent."

    However, to properly free the current context/surface (i.e., call
    glFlush, unbindContext, driDestroyContext), we still need the
    display vtbl (and possibly an active dri dpy connection). Therefore,
    we add some reference counter to dri2_egl_display, to make sure
    the structure is kept allocated as long as it is required.

    One drawback of this is that eglInitialize may not completely reinitialize
    the display (if eglTerminate was called with a current context), however,
    this seems to meet the EGL spec quite well, and does not permanently
    leak any context/display even for incorrectly written apps.

    Cc: "12.0" <<a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.org</a>>
    Signed-off-by: Nicolas Boichat <<a href="mailto:drinkcat@chromium.org">drinkcat@chromium.org</a>>
    Reviewed-by: Eric Engestrom <<a href="mailto:eric.engestrom@imgtec.com">eric.engestrom@imgtec.com</a>>
    Reviewed-by: Emil Velikov <<a href="mailto:emil.velikov@collabora.com">emil.velikov@collabora.com</a>>

:040000 040000 e85e5c29d107c99c0c163074ad701d587efe9d70
40574abb1fa0fb3f7cdbedf970815b745d08b0de M      src
bisect run success</pre>
        </div>
      </p>


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

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