Bug 6365

Summary: i810 driver segfault in I830DRIDoMappings()
Product: xorg Reporter: Konstantin A. Lepikhov <lakostis>
Component: Driver/intelAssignee: Alan Hourihane <alanh>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high CC: dri-devel, shrek
Version: gitKeywords: have-backtrace
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Xorg.crash.i810.1.5.2.log.gz
none
dmesg.gz
none
xorg.conf.gz
none
lspci.gz
none
Xorg.crash.intel.1.6.0.git20060417.log.gz none

Description Konstantin A. Lepikhov 2006-03-24 04:42:13 UTC
I'm using xorg-x11-server 1.0.2, xorg-x11-drv-i810 1.5.2 from cvs, latest Mesa
and DRM kernel modules (Mesa from 2006.02.23 and DRM from 2006.03.23).

OS: x86_64 EMT64T ALTLinux Sisyphus w/kernel 2.6.16-rc6.git10 w/-ck1 patchset
(also checked w/ vanilla 2.6.16 kernel from kernel.org).

When dri enabled xserver segfault. Without dri all works fine.
Comment 1 Konstantin A. Lepikhov 2006-03-24 04:43:21 UTC
Created attachment 5034 [details]
Xorg.crash.i810.1.5.2.log.gz

Xorg.0.log crash log w/ backtrace
Comment 2 Konstantin A. Lepikhov 2006-03-24 04:43:52 UTC
Created attachment 5035 [details]
dmesg.gz
Comment 3 Konstantin A. Lepikhov 2006-03-24 04:44:16 UTC
Created attachment 5036 [details]
xorg.conf.gz
Comment 4 Konstantin A. Lepikhov 2006-03-24 04:44:42 UTC
Created attachment 5038 [details]
lspci.gz

lspci -v log
Comment 5 Konstantin A. Lepikhov 2006-03-24 22:19:52 UTC
cc'ed dri-devel for additional help.
Comment 6 Alan Hourihane 2006-04-12 23:31:12 UTC
You might want to try the latest CVS.
Comment 7 Alan Hourihane 2006-04-18 08:03:42 UTC
I'll add that the current CVS works for me.
Comment 8 Konstantin A. Lepikhov 2006-04-18 08:14:24 UTC
Still segfaults.

some info about installed packages:

$ rpm -qa|egrep "xorg\-x11\-(server|drv|dri)"
xorg-x11-dri-i810-6.5-alt0.cvs20060418
xorg-x11-server-1.0.2-alt3
xorg-x11-drv-intel-1.6.0-alt0.git20060417
xorg-x11-server-common-1.0.2-alt3

I don't change drm modules, looks like it's not changed.
Comment 9 Konstantin A. Lepikhov 2006-04-18 08:17:13 UTC
Created attachment 5349 [details]
Xorg.crash.intel.1.6.0.git20060417.log.gz
Comment 10 Michel Dänzer 2006-04-19 18:08:03 UTC
This has been reported to Debian at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=363451 . Looks like a 64 bit
specific issue?
Comment 11 Kevin Epsworth 2006-04-19 21:08:34 UTC
I had the same issue on a Gentoo ~amd64 box:

$ uname -a
Linux tc9 2.6.16-gentoo-r2 #1 Thu Apr 13 11:43:48 BST 2006 x86_64 Intel(R)
Pentium(R) 4 CPU 3.20GHz GNU/Linux
$ /usr/sbin/lspci | grep Graphics
00:02.0 VGA compatible controller: Intel Corporation 945G/GZ Express Integrated
Graphics Controller (rev 02)
00:02.1 Display controller: Intel Corporation 945G/GZ Express Integrated
Graphics Controller (rev 02)

I don't pretend to understand the code, but tracked down the crash to a null
pointer dereference within i830_dri.c.  The following patch fixed it for me:

**************
*** 771,777 ****
--- 771,779 ----
     sarea->depth_handle = 0;
     sarea->tex_handle = 0;

+    xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Setting pScreen.  pScreen:
0x%08x, pScrn: 0x%08x, pScrn->pScreen: 0x%08x\n",pScreen,pScrn,pScrn->pScreen);
     /* Need to initialize pScreen now to let RandR know. */
+    pScrn->pScreen=pScreen;
     pScrn->pScreen->width = pScrn->virtualX;
     pScrn->pScreen->height = pScrn->virtualY;

...I'm guessing what pScrn->pScreen should actually be set to, but this seems to
work OK.
Comment 12 Konstantin A. Lepikhov 2006-04-19 22:27:00 UTC
Thanks Kevin! This patch also fix segfault on my EMT64 box. Alan, could you
commit it into mainline?
Comment 13 Alan Hourihane 2006-04-20 19:49:43 UTC
Done. 

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.