Bug 37766

Summary: Crash in dri2InvalidateBuffers when resizing Java window with OpenGL pipeline enabled
Product: Mesa Reporter: Clemens Eisserer <linuxhippy>
Component: Drivers/DRI/i915Assignee: Ian Romanick <idr>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Clemens Eisserer 2011-05-30 13:08:40 UTC
Hi, 

When resizing a java application which uses Java's OpenGL backend, I get the attached crash.

How to reproduce:
1. Install OpenJDK-6-jre + openjdk-6-jdk
2. run jconsole -J-Dsun.java2d.opengl=True
3. resize the window

I used mesa shipped with fedora-15 + updates.

dri2InvalidateBuffers (dpy=<optimized out>, drawable=<optimized out>) at dri2_glx.c:682
682	   if (pdraw && psc->f && psc->f->base.version >= 3 && psc->f->invalidate)
(gdb) bt
#0  dri2InvalidateBuffers (dpy=<optimized out>, drawable=<optimized out>) at dri2_glx.c:682
#1  0x00007f7415a1b541 in DRI2WireToEvent (dpy=0x7f74341d13a0, event=0x7f73ec011358, wire=0x7f73ec00eac0) at dri2.c:136
#2  0x00000038d4248231 in _XEnq () from /usr/lib64/libX11.so.6
#3  0x00000038d4245003 in ?? () from /usr/lib64/libX11.so.6
#4  0x00000038d4245a35 in _XEventsQueued () from /usr/lib64/libX11.so.6
#5  0x00000038d42364ff in XEventsQueued () from /usr/lib64/libX11.so.6
#6  0x00007f74310117b1 in ?? ()
#7  0x0000000000000190 in ?? ()
#8  0x0000000000000000 in ?? ()
Comment 1 Eric Anholt 2011-06-05 11:25:43 UTC
Thanks for the detailed steps to reproduce!

commit 164108e3db5ba09d8e0605f88aa17dab83b68742
Author: Eric Anholt <eric@anholt.net>
Date:   Wed Jun 1 13:39:39 2011 -0700

    glx: Fix use-before-null-check in dri2InvalidateBuffers().
    
    The compiler used our dereference here to skip the NULL check below.
    Fixes window resize in "jconsole -J-Dsun.java2d.opengl=True" under
    OpenJDK 6.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37766
    Reviewed-by: Matt Turner <mattst88@gmail.com>
    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.