Bug 19665

Summary: [i965] Toggling Compiz on/off in simple-ccsm sometimes crashes X
Product: Mesa Reporter: qwang13 <quanxian.wang>
Component: Drivers/DRI/i965Assignee: haihao <haihao.xiang>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: high CC: eich, haihao.xiang, kent.liu, libv, ling.yue, mat, quanxian.wang, sndirsch
Version: 7.2   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: detach static region from intel_renderbuffer on contex destroy

Description qwang13 2009-01-20 17:52:31 UTC
OS: SLED-11-RC1 (2.6.27)
Driver Release: Intel Q3 Release
Hardware:
Following is the platforms we've tested and it's always reproducible:
1. ThinkPad X200 (Intel Centrino Montevina platform)
2. ThinkPad T61 (Intel Centrino Santa Rosa platform)

Reproduce:
When toggling Compiz on/off in "simple-ccsm", sometimes X would crash.

Reproducible:
Always

Steps to reproduce on a clean system:
1: run "simple-ccsm" to open "Desktop Effects" dialog.
2. click check-box "Enable desktop effects" to toggle the desktop effects.
3. repeat step 2 for around 15 times, X would crash. You may crash X with less
repeats but 15 times is definitely enough here to cause the crash.
Comment 1 qwang13 2009-01-20 18:03:05 UTC
After the debugging for that, we found that(#8) The region is NULL.
I have track it for several times, in the first, it will be not null, after several time try, It will be null(Actuall in function DoMakeCurrent, it has been null). Also I have added the checking, if null, return error. Still crash. Also I add the line to create the region(allocate the buffer by function intel_recreate_static_region) It will generate hardware issue (mass color).

Haihao, do you have some idea about that? 
We check it in latest upstream code, it will use dri2 to create region(should use dri2 manage region). Seems work.

However in Q3 release, don't support dri2, is there some new idea to make this resolved.

Thanks

----
Program received signal SIGABRT, Aborted.
0xffffe430 in __kernel_vsyscall ()
(gdb) where
#0  0xffffe430 in __kernel_vsyscall ()
#1  0xb7b3d990 in raise () from /lib/libc.so.6
#2  0xb7b3f2c8 in abort () from /lib/libc.so.6
#3  0x080a63b6 in ddxGiveUp ()
#4  0x0813acd8 in AbortServer ()
#5  0x0813b2e3 in FatalError ()
#6  0x080c0c89 in xf86SigHandler ()
#7  <signal handler called>
#8  intel_renderbuffer_set_region (rb=0x8468448, region=0x0) at intel_fbo.c:377
#9  0xa7631fc7 in intelMakeCurrent (driContextPriv=0x8a68390, driDrawPriv=0x84b63c8, driReadPriv=0x84b63c8) at intel_context.c:707
#10 0xa760f352 in driBindContext (pcp=0x8a68390, pdp=0x84b63c8, prp=0x84b63c8) at ../common/dri_util.c:207
#11 0xb7a5960c in __glXDRIcontextMakeCurrent () from /usr/lib/xorg/modules//extensions/libglx.so
#12 0xb7a4dfc7 in DoMakeCurrent () from /usr/lib/xorg/modules//extensions/libglx.so
#13 0xb7a4e1c5 in __glXDisp_MakeCurrent () from /usr/lib/xorg/modules//extensions/libglx.so
#14 0xb7a506fa in __glXDispatch () from /usr/lib/xorg/modules//extensions/libglx.so
#15 0x0808b4af in Dispatch ()
#16 0x08070d4d in main ()
(gdb) c
Comment 2 qwang13 2009-02-04 18:55:00 UTC
Is there any progress for that? 

Since this is a general issue on all platforms, I increase the priority.

If you need more information, please let me know.

Thanks  
Comment 3 haihao 2009-02-08 19:44:48 UTC
Created attachment 22699 [details] [review]
detach static region from intel_renderbuffer on contex destroy

This is a memory leaks issue, please cherry pick commit 7d99ddcb2bb09f1f54d91e6e20e42d217a5bccdf then apply the attached patch.
Comment 4 qwang13 2009-02-09 00:46:10 UTC
Not works with RC3 release (Mesa Q3'08 release). Seems rapidly crash with several times try. About 1 or 2.

Originally it will try with 5 times or more.

Stefan,
Do you have a try with the commit?
Comment 5 qwang13 2009-02-09 01:46:27 UTC
(In reply to comment #4)
> Not works with RC3 release (Mesa Q3'08 release). Seems rapidly crash with
> several times try. About 1 or 2.
> 
> Originally it will try with 5 times or more.
> 
> Stefan,
> Do you have a try with the commit?
> 

sorry, I just patch with the commit. After patching the attachment, and restore my original testing environment, the bug seems fixed. 

Stefan, would you like to have a try? if works, please push them into SLED11.

Thanks for Haihao's support.
Comment 6 Stefan Dirsch 2009-02-09 16:46:04 UTC
Thanks. I've applied the patches now to our Mesa package and submitted it for SLE11. Closing as fixed.
Comment 7 Stefan Dirsch 2009-02-09 16:46:32 UTC
Now for real.

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.