<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 - openmw - Segfault with the nouveau ddx + DRI3"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=99464">99464</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>openmw - Segfault with the nouveau ddx + DRI3
          </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/nouveau
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>nouveau@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ovariegata@yahoo.com
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>nouveau@lists.freedesktop.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=129055" name="attach_129055" title="Apitrace.">attachment 129055</a> <a href="attachment.cgi?id=129055&action=edit" title="Apitrace.">[details]</a></span>
Apitrace.

When starting openmw which is the free engine re-implementation of the game
morrowind it will segfault. This may be a mesa core bug, but it will only
happen with the nouveau DDX + DRI3. It will not crash with modesetting + DRI3,
DRI2 or the llvmpipe.

Here is a backtrace.
<a href="http://pastebin.com/HMdv4iWb">http://pastebin.com/HMdv4iWb</a>

Apitrace log.
<a href="http://pastebin.com/FzZVyGqW">http://pastebin.com/FzZVyGqW</a>

Here is a workaround as reported to the the mesa mailing list by Tobias
Klausmann. It successfully hides the crash, but potentially breaking the
hardware cursor used by openmw which works correctly with DRI2, modesetting or
the llvmpipe. It also was not intended as a real fix.

"OpenMW tries to upload a new surface (mouse pointer) which fails in the now
guarded update_framebuffer_size() as the surface is NULL.

This is not inteded as a real "fix", as it would just hide the immediate crash.

So if somebody could take a look at this...

Reported-by: <<a href="mailto:ovariegata@yahoo.com">ovariegata@yahoo.com</a>>
Signed-off-by: Tobias Klausmann <<a href="mailto:tobias.johannes.klausmann@mni.thm.de">tobias.johannes.klausmann@mni.thm.de</a>>
---
src/mesa/state_tracker/st_atom_framebuffer.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c
b/src/mesa/state_tracker/st_atom_framebuffer.c
index ea41d9d..3ee4ea5 100644
--- a/src/mesa/state_tracker/st_atom_framebuffer.c
+++ b/src/mesa/state_tracker/st_atom_framebuffer.c
@@ -177,8 +177,10 @@ update_framebuffer_state( struct st_context *st )
          /* rendering to a GL texture, may have to update surface */
          st_update_renderbuffer_surface(st, strb);
      }
-      pipe_surface_reference(&framebuffer->zsbuf, strb->surface);
-      update_framebuffer_size(framebuffer, strb->surface);
+      if (strb->surface) {
+        pipe_surface_reference(&framebuffer->zsbuf, strb->surface);
+        update_framebuffer_size(framebuffer, strb->surface);
+      }
    }
    else {
      strb = st_renderbuffer(fb->Attachment[BUFFER_STENCIL].Renderbuffer);
-- 
2.9.2"</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>