Recently my xorg-x11 started segfaulting on startup. The problem disappeared when I moved sisusb_drv out of /usr/lib/modules/drivers/. I reinstalled xorg-x11 with CFLAGS="-g" USE=debug and got a backtrace: ols-dell xc # gdb X GNU gdb 6.3 Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1". (gdb) run -configure Starting program: /usr/bin/X -configure This is a pre-release version of the The X.Org Foundation X11. It is not supported in any way. Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/. Select the "xorg" product for bugs you find in this release. Before reporting bugs in pre-release versions please check the latest version in the The X.Org Foundation "monolithic tree" CVS repository hosted at http://www.freedesktop.org/Software/xorg/ X Window System Version 6.8.99.7 Release Date: 15 May 2005 + cvs X Protocol Version 11, Revision 0, Release 6.8.99.7 Build Operating System: Linux 2.6.12-rc4-d1 i686 [ELF] Current Operating System: Linux ols-dell 2.6.12-rc4-d1 #8 SMP Tue May 17 17:30:27 JST 2005 i686 Build Date: 19 May 2005 Before reporting problems, check http://wiki.X.Org to make sure that you have the latest version. Module Loader present Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown. (==) Log file: "/var/log/Xorg.0.log", Time: Thu May 19 11:27:48 2005 List of video drivers: nvidia nvidia radeon atimisc r128 mga glint nv tga s3 s3virge sis rendition neomagic i740 tdfx savage cirrus vmware tseng trident chips apm i128 nsc i810 ati imstt newport ark cyrix siliconmotion via vesa vga dummy fbdev v4l sisusb [tcsetpgrp failed in terminal_inferior: Operation not permitted] (EE) end of block range 0xdf1f < begin 0xdf20 Program received signal SIGSEGV, Segmentation fault. 0x085a6bd2 in ?? () (gdb) bt #0 0x085a6bd2 in ?? () #1 0x00000004 in ?? () #2 0x084d8f58 in ?? () #3 0x00000001 in ?? () #4 0xbf9839ac in ?? () #5 0x00000000 in ?? () #6 0xb7f13ff4 in ?? () from /lib/libc.so.6 #7 0xbf9839c8 in ?? () #8 0x0809222b in xf86Msg (type=140110960, format=0x1 <Address 0x1 out of bounds>) at xf86Helper.c:1359 #9 0x08075118 in DoConfigure () at xf86Configure.c:838 #10 0x0807028c in InitOutput (pScreenInfo=0x827b520, argc=2, argv=0xbf984bb4) at xf86Init.c:388 #11 0x080ee175 in main (argc=2, argv=0xbf984bb4, envp=0xbf984bc0) at main.c:367 $ emerge --info Portage 2.0.51.22-r1 (default-linux/x86/2005.0, gcc-3.3.5-20050130, glibc-2.3.4.20041102-r1, 2.6.12-rc4-d1 i686) ================================================================= System uname: 2.6.12-rc4-d1 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz Gentoo Base System version 1.6.12 distcc 2.16 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] dev-lang/python: 2.3.5 sys-apps/sandbox: 1.2.8 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5 sys-devel/binutils: 2.15.90.0.1.1-r4, 2.15.92.0.2-r7 sys-devel/libtool: 1.5.16 virtual/os-headers: 2.6.8.1-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe -mmmx -msse -msse2" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/alias /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/texmf/web2c /etc/env.d" CXXFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe -mmmx -msse -msse2" DISTDIR="/usr/portage-distfiles" FEATURES="autoconfig collision-protect noinfo sandbox sfperms strict userpriv usersandbox" GENTOO_MIRRORS=" ftp://ftp.ecc.u-tokyo.ac.jp/GENTOO" LANG="en_US.utf8" LINGUAS="en" PKGDIR="/usr/portage-dell/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/portage-chutz /usr/portage-maildir" SYNC="rsync://rsync1.jp.gentoo.org/gentoo-portage" USE="x86 X aalib acl acpi alsa apache2 avi berkdb bitmap-fonts bzip2 bzlib canna cdparanoia cdr cjk crypt cscope cups dba dbm dga dts dv dvd dvdread edl eds emboss encode exif ext-iiimf fam fbcon flac foomaticdb fortran ftp gd gd-external gdbm gif gimpprint glut gmp gnutls gstreamer gtk gtk2 gtkhtml guile hardenedphp icc iconv ieee1394 imagemagick imap imlib inifile ipv6 java joystick jpeg junit lcms ldap libcaca libg++ libwww live lzo mad maildir mailwrapper matroska memlimit mikmod mime mmx mmxext mng motif moznocompose moznoirc moznomail mp3 mpeg mule mysql ncurses net network nls nntp nptl nvidia offensive ogg oggvorbis opengl operanom2 pam pdflib perl plotutils png ppds pwdb python qt quicktime readline real samba scanner sdl silc slang snmp speex spell sse sse2 ssl tcltk tcpd tetex tiff truetype truetype-fonts type1-fonts unicode usb vorbis wmf wxwindows xgetdefault xinerama xml xml2 xpm xsl xv xvid xvmc zlib linguas_en userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LC_ALL, LDFLAGS, MAKEOPTS I tried it with the stable xorg-x11 as well -- no change. I also recompiled it with the stable gcc, while I had used 3.4.3 the first time that the problem appeared.
Hm, I'll have to provide more insight, because I cannot find the sisusb_drv.* file in the 6.8.2 xorg tbz2s that I built. Curious why they segfaulted.
Yes, that's what I was about to say.
Hey, what do you know -- no problems with 6.8.2-r1. I can only guess that I tried to reproduce the problem *after* downgrading to 6.8.2 but *before* the 6.8.99 version was unmerged and the sisusb_drv was still present on the system (for example while the postinstall scripts were generating font caches, etc.) I have a few more ideas to check out, and I'll comment again.
OK. Once you get things narrowed down as much as you can, we'll get this filed upstream.
Cool, I reproduced it on another machine. So the bug appears on a P4 3GHz HT, and an Athlon 1G (Slot A). Identical problems with both. Running "X -configure" simply segfaults. USE flags are almost identical (-sse on the athlon, -3dnow on both :-/ ). Moving sisusb_drv.o out of the way solves it. I also tried both the 6.8.99.5 that comes with portage, and a slightly modified ebuild for 6.8.99.7 (excluded two patches that did not apply) from my overlay. I'll try with USE=dlloader next, though I don't expect any changes. The Athlon has a matrox (the P4 is with nvidia) so dlloader shouldn't cause any grief. It's not the kernel as I suspected earlier, either. Truth is I only checked with vanilla 2.6.11.8 and 2.6.12-rc4
You might get more debugging info w/ dlloader, because gdb supports its modules.
You were absolutely right: # gdb X .... (gdb) run -configure Starting program: /usr/bin/X -configure ...snip.... (EE) end of block range 0xdf1f < begin 0xdf20 Program received signal SIGSEGV, Segmentation fault. 0xb796164e in SISUSBProbe (drv=0x82a7a10, flags=1) at sisusb_driver.c:422 422 if((myminor = SiSUSBFindUSBDongle(devSections[i], minorArray, numDevSections, &nameptr)) >= 0) { (gdb) p devSections $1 = (GDevPtr *) 0x0 (gdb) p minorArray $2 = (int *) 0x82a4a98 (gdb) p numDevSections $3 = 1 (gdb) p nameptr $4 = 0x1 <Address 0x1 out of bounds> (gdb) Here is some more, hopefully related: (gdb) break SISUSBProbe Function "SISUSBProbe" not defined. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (SISUSBProbe) pending. (gdb) run -configure Starting program: /usr/bin/X -configure ... snip ... Breakpoint 2, SISUSBProbe (drv=0x82a7a10, flags=1) at sisusb_driver.c:361 361 Bool foundScreen = FALSE; (gdb) n 386 if((numDevSections = xf86MatchDevice(SISUSB_DRIVER_NAME, &devSections)) <= 0) { (gdb) p devSections $1 = (GDevPtr *) 0xb798d840 (gdb) n 406 if(!(minorArray = (int *)xalloc(numDevSections * sizeof(int)))) { (gdb) p devSections $2 = (GDevPtr *) 0x0 (gdb) n 409 for(i = 0; i < numDevSections; i++) minorArray[i] = -1; (gdb) 412 if(!(devnameArray = (char **)xalloc(numDevSections * sizeof(char *)))) { (gdb) 420 numUsed = 0; (gdb) 421 for(i = 0; i < numDevSections; i++) { (gdb) 422 if((myminor = SiSUSBFindUSBDongle(devSections[i], minorArray, numDevSections, &nameptr)) >= 0) { (gdb) Program received signal SIGSEGV, Segmentation fault. 0xb796164e in SISUSBProbe (drv=0x82a7a10, flags=1) at sisusb_driver.c:422 422 if((myminor = SiSUSBFindUSBDongle(devSections[i], minorArray, numDevSections, &nameptr)) >= 0) { (gdb)
Can someone explain this: SISUSBProbe says: if((numDevSections = xf86MatchDevice(SISUSB_DRIVER_NAME, &devSections)) <= 0) { /* * There's no matching device section in the config file, so quit * now. */ return FALSE; } However, looking at xf86MatchDevice: if (xf86DoConfigure && xf86DoConfigurePass1) return 1; And this is done after the function clears the pointer that was passed to it. So, xf86MatchDevice returns "1" on failure? According to the source, it returns either a pointer, or 1. Seems like something is wrong, since all drivers check with "<=0" after calling this function. There is also another xf86MatchDevice in loader.c which *always* returns 1. Beats me completely.
Awesome! Please file a bug at bugs.freedesktop.org with that, and post the URL here. That way we can get the SiS maintainer etc involved too.
Actually, sisusb was just unlucky. I think the problem is in xf86MatchDevice, but the complete report is at https://bugs.freedesktop.org/show_bug.cgi?id=3335
Thanks!