Bug 1266025 - [PATCH] Sigsegv in i965 driver (get_stencil_miptree), plasma crashes after login
[PATCH] Sigsegv in i965 driver (get_stencil_miptree), plasma crashes after login
Product: Fedora
Classification: Fedora
Component: mesa (Show other bugs)
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Adam Jackson
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2015-09-24 06:45 EDT by Giulio Bernardi
Modified: 2016-07-07 05:03 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-07-07 05:03:35 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Stack trace (5.87 KB, text/plain)
2015-09-24 06:45 EDT, Giulio Bernardi
no flags Details
The patch (537 bytes, patch)
2015-09-24 06:47 EDT, Giulio Bernardi
no flags Details | Diff

External Trackers
Tracker ID Priority Status Summary Last Updated
FreeDesktop.org 92103 None None None Never

  None (edit)
Description Giulio Bernardi 2015-09-24 06:45:58 EDT
Created attachment 1076457 [details]
Stack trace

Description of problem:
On the machine I use at work sometimes plasma crashes after the login, before showing the KDE desktop. Investigation with gdb might have shown the cause of the problem.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. In KDM, perform the login

Actual results:
Sometimes plasma crashes before showing the desktop

Expected results:
Plasma should start and show the desktop

Additional info:
I Launched gdb from the KDE crash handler (drkonqi?), see attached stack trace. The crash happened at brw_misc_state.c:215, that is:

(gdb) list
210     static struct intel_mipmap_tree *
211     get_stencil_miptree(struct intel_renderbuffer *irb)
212     {
213        if (!irb)
214           return NULL;
215        if (irb->mt->stencil_mt)
216           return irb->mt->stencil_mt;
217        return irb->mt;
218     }

It turns out that irb->mt was null:

(gdb) print irb->mt
$3 = (struct intel_mipmap_tree *) 0x0

I modified the line to read

if (irb->mt && irb->mt->stencil_mt)

(see the patch at the end of this report, it looks like I cannot add more than one attachment) and so far (a couple of restarts, a shutdown, and a tenth of logouts/logins) no crash happened.

However, since the crash is not always reproducible, I cannot be 100% sure.

The video card is

00:02.0 VGA compatible controller: Intel Corporation 4 Series Chipset Integrated Graphics Controller (rev 03)

I am using the intel driver with UXA acceleration method (not SNA).
Glxinfo says:

server glx vendor string: SGI
server glx version string: 1.4
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) G45/G43 
OpenGL version string: 2.1 Mesa 10.6.3 (git-ccef890)
OpenGL shading language version string: 1.20
OpenGL ES profile version string: OpenGL ES 2.0 Mesa 10.6.3 (git-ccef890)
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16

I think this is not a duplicate of bugs like this:
because it was fixed long ago.

It might be related to EOLed bugs 1220985, 1163587, 1146582, 1124035, 1123691, 1117453, 1070417, 1141358 though. 

This is the patch:
diff -r -N -u mesa-20150729.orig/src/mesa/drivers/dri/i965/brw_misc_state.c mesa-20150729/src/mesa/drivers/dri/i965/brw_misc_state.c
--- mesa-20150729.orig/src/mesa/drivers/dri/i965/brw_misc_state.c       2015-07-29 01:58:03.000000000 +0200
+++ mesa-20150729/src/mesa/drivers/dri/i965/brw_misc_state.c    2015-09-24 10:41:37.922718969 +0200
@@ -212,7 +212,7 @@
    if (!irb)
       return NULL;
-   if (irb->mt->stencil_mt)
+   if (irb->mt && irb->mt->stencil_mt)
       return irb->mt->stencil_mt;
    return irb->mt;
Comment 1 Giulio Bernardi 2015-09-24 06:47 EDT
Created attachment 1076459 [details]
The patch
Comment 2 Igor Gnatenko 2015-09-24 06:52:01 EDT
Can you send it to upstream?
Comment 3 Giulio Bernardi 2015-09-24 08:37:21 EDT
Reported upstream at https://bugs.freedesktop.org/show_bug.cgi?id=92103
Comment 4 Igor Gnatenko 2016-07-07 05:03:35 EDT
Fixed in upstream.

Note You need to log in before you can comment on or make changes to this bug.