Bug 21785

Summary: [945gm]X crash when enable or disable compiz
Product: Mesa Reporter: liuhaien <haien.liu>
Component: Drivers/DRI/i915Assignee: Default DRI bug account <dri-devel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: xorg.0.log
xorg conf file

Description liuhaien 2009-05-18 00:05:39 UTC
Created attachment 25951 [details]
xorg.0.log

System Environment:
--------------------------
Host:		x-945gm
Arch:		i386
Platform:		945GM
Libdrm:		(master)f57d7f4b0b14972f92a83f155ae8033478aa7729
Mesa:		(master)08ec7e0d329a72433b427e8167b2c3442d1f53b4
Xserver:		(master)2f6253376df45e508284ff7766b186cfc7fb56d6
Xf86_video_intel:		(master)87332a7cc16af82aa47e07fbf90da3635b071dbf
Kernel:       (for-linus)7c7327d9664280cad833da1f14bad13a3ea8f0bf


Bug detailed description:
-------------------------
start X with gnome-desktop on 945gm, then enable or disable compiz by clicking the option in system menu. it will crash X. the backtrace from gdb is as below:

#0  0x080a1ed2 in IgnoreClient (client=0x8a157a0) at connection.c:1148
#1  0xb7d457c6 in glxSuspendClients () at glxext.c:434
#2  0xb7d5090c in glxDRILeaveVT (index=0, flags=0) at glxdri2.c:536
#3  0x080b355d in AbortDDX () at xf86Init.c:1430
#4  0x080a376d in AbortServer () at log.c:404
#5  0x080a3d0f in FatalError (
    f=0x81b55c4 "Caught signal %d (%s). Server aborting\n") at log.c:529
#6  0x080acd71 in OsSigHandler (signo=11, sip=0xbfb88eec, unused=0xbfb88f6c)
    at osinit.c:152
#7  <signal handler called>
#8  0xb7a1aacf in intelDestroyContext (driContextPriv=0x88f03f0)
    at intel_context.c:820
#9  0xb79f21f7 in driDestroyContext (pcp=0x88f03f0) at ../common/dri_util.c:526
#10 0xb7d50b19 in __glXDRIcontextDestroy (baseContext=0x8991ce0)
    at glxdri2.c:192
#11 0xb7d45471 in __glXFreeContext (cx=0x8991ce0) at glxext.c:181
#12 0xb7d458a6 in glxClientCallback (list=0x81e31f8, closure=0x0,
    data=0xbfb89350) at glxext.c:280
#13 0x0809b3ac in CallCallbacks (pcbl=0x81e31f8, call_data=0xbfb89350)
    at dixutils.c:737
#14 0x080738f7 in CloseDownClient (client=0x8a157a0) at dispatch.c:3595
#15 0x08079cae in Dispatch () at dispatch.c:411
#16 0x0806462a in main (argc=2, argv=0xbfb89494, envp=0x8000) at main.c:283

Reproduce steps:
----------------
1. xinit&
2. enable or disbale compiz
Comment 1 liuhaien 2009-05-18 00:06:22 UTC
Created attachment 25952 [details]
xorg conf file
Comment 2 liuhaien 2009-05-18 00:10:35 UTC
and compiz works well on g45.
Comment 3 liuhaien 2009-05-22 01:33:13 UTC
below is the first bad commit:
commit fc6d89145df6fc7a1c2ce648b474c3f203ca87c7
Author: Robert Ellison <papillo@vmware.com>
Date:   Fri May 8 14:42:47 2009 -0600

    i965: fix memory leak in context/renderbuffer region management

    A temporary change to the intelMakeCurrent() function to make
    it work with frame buffer objects causes the static regions
    associated with the context (the front_region, back_region,
    and depth_region) to take on an additional reference, with
    no corresponding release.  This causes a memory leak if a
    program repeatedly creates and destroys contexts.

    The fix is the corresponding hack, to unreference these
    regions when the context is deleted, but only if the
    framebuffer objects are still present and the same
    regions are still referenced within.

    Both sets of code have comment blocks referring to each
    other.
Comment 4 Gordon Jin 2009-06-11 10:16:11 UTC
Haien, does this still exist? How about 7.5 branch?
Comment 5 liuhaien 2009-06-15 02:05:05 UTC
(In reply to comment #4)
> Haien, does this still exist? How about 7.5 branch?
> 

yes, still exists. but it works with 7.5 branch.
Comment 6 Eric Anholt 2009-06-30 19:23:52 UTC
Please retest with:

commit 3020b1d43e34fca08cd51f7c7c8ed51497d49ef3
Author: Michel Dänzer <daenzer@vmware.com>
Date:   Tue Jun 23 16:45:40 2009 +0200

    glx: Clean up more thoroughly if the drawable of a current context goes away.
    
    Fixes crash when restarting compiz, due to cl->currentContexts[x] being stale.
Comment 7 liuhaien 2009-07-02 22:18:11 UTC
the issue has gone.
Comment 8 liuhaien 2009-07-02 22:18:55 UTC
verified with below commits:
Libdrm:         (master)fbac5891b91c795de61f4d7cbc1a6799474364ad
Mesa:           (master)8ae02a3919bf31bd33f86208472e100eedb58497
Xserver:                (master)3525d140567e0ad5f0184e4b37893c47239e1628
Xf86_video_intel:              
(master)4100abdf5d208bbcbb4ceabad0572c04221443c9
Kernel:       (drm-intel-next)1ae8c0a56eeb3ed358b78ccadd024d6b721f26bc

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.