Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 295562 - =x11-base/xorg-server-1.7.1 segfaults in the first 5 minutes if not launched via startx
Summary: =x11-base/xorg-server-1.7.1 segfaults in the first 5 minutes if not launched ...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: Gentoo X packagers
Depends on:
Reported: 2009-12-03 16:49 UTC by Raphaël Droz
Modified: 2010-01-13 14:01 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---

strace session of the X crash (X.trace,975.76 KB, text/plain)
2009-12-07 11:19 UTC, Raphaël Droz
xorg.log after a crash (Xorg.0.log.backtrace.3,12.04 KB, text/plain)
2009-12-08 11:08 UTC, Raphaël Droz
modified (startDM.diff,1.23 KB, patch)
2009-12-08 13:26 UTC, Raphaël Droz
Details | Diff
xorg log (Xorg.0.log,34.81 KB, text/plain)
2009-12-09 09:12 UTC, Raphaël Droz
xorg strace (Xorg.strace,89.24 KB, text/plain)
2009-12-09 09:13 UTC, Raphaël Droz
xorg freeze backtrace (Xorg.0.log.3,34.58 KB, text/plain)
2009-12-22 19:08 UTC, Raphaël Droz
gdb backtrace (gdb-Xorg.txt,6.04 KB, text/plain)
2009-12-26 13:39 UTC, Raphaël Droz

Note You need to log in before you can comment on or make changes to this bug.
Description Raphaël Droz 2009-12-03 16:49:40 UTC
[probably x11 overlay related]
For some days I experience a crash with X when started from boot.
(but doesn't happen when I use startx)
It happens in the first 5 minutes of use, usually when using mutt.
I used mesa-7.6.1_rc1 and since I upgraded to 7.6.2_rc2 today the backtrace is a bit different :

0: /usr/bin/X (xorg_backtrace+0x28) [0x46c1b8]
1: /usr/bin/X (0x400000+0x62399) [0x462399]
2: /lib/ (0x7fcee21e0000+0xea10) [0x7fcee21eea10]
3: /usr/lib/ (0x7fcee23fc000+0x35a81) [0x7fcee2431a81]
4: /usr/lib/ (0x7fcee23fc000+0x32ff7) [0x7fcee242eff7]
5: /usr/lib/ (0x7fcee23fc000+0x150ee) [0x7fcee24110ee]
6: /usr/lib/ (0x7fcee23fc000+0x19685) [0x7fcee2415685]
7: /usr/bin/X (0x400000+0xf5ac3) [0x4f5ac3]
8: /usr/bin/X (WakeupHandler+0x43) [0x44e4f3]
9: /usr/bin/X (WaitForSomething+0x1c5) [0x462ba5]
10: /usr/bin/X (0x400000+0x53fa2) [0x453fa2]
11: /usr/bin/X (0x400000+0x24c6b) [0x424c6b]
12: /lib/ (__libc_start_main+0xfd) [0x7fcee0e23a3d]
13: /usr/bin/X (0x400000+0x24819) [0x424819]

Before it was like this :
0: /usr/bin/X (xorg_backtrace+0x28) [0x46c688]
1: /usr/bin/X (0x400000+0x626b9) [0x4626b9]
2: /lib/ (0x7f7232d74000+0xea10) [0x7f7232d82a10]
3: /lib/ (__select+0x13) [0x7f7231a5fca3]
4: /usr/bin/X (WaitForSomething+0x1aa) [0x462eaa]
5: /usr/bin/X (0x400000+0x542c2) [0x4542c2]
6: /usr/bin/X (0x400000+0x24f8b) [0x424f8b]
7: /lib/ (__libc_start_main+0xfd) [0x7f72319b7a3d]
8: /usr/bin/X (0x400000+0x24b39) [0x424b39]

I though it was related with nvidia driver but with nv it happens as well.
I also though it was related to the list provided in bug #294958 (xorg 1.6 stabilisation), but removing it from package.keywords/ and recompile didn't change anything.

Another very strange thing (and more strange since it's not nvidia related) :
My login tty2 is bloated with non-ascii string (and auth.log logs two or three attempts), It may be related.

I don't have a way to reproduce it except using mutt some minutes in a freshly booted X.

Reproducible: Always

Portage 2.2_rc52 (default/linux/amd64/10.0/desktop, gcc-4.4.2, glibc-2.10.1-r0, 2.6.32-rc5-git1-amd64_pata x86_64)
System uname: Linux-2.6.32-rc5-git1-amd64_pata-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_4200+-with-gentoo-1.12.13
Timestamp of tree: Thu, 03 Dec 2009 13:45:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     4.0_p35
dev-java/java-config: 2.1.9-r1
dev-lang/python:     2.6.2-r1
dev-python/pycrypto: 2.0.1-r8
dev-util/ccache:     2.4-r7
dev-util/cmake:      2.6.4-r3
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.30-r1
CFLAGS="-O2 -march=native -pipe -fomit-frame-pointer -floop-interchange -floop-strip-mine -floop-block"
CONFIG_PROTECT="/etc /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=native -pipe -fomit-frame-pointer -floop-interchange -floop-strip-mine -floop-block"
FEATURES="assume-digests ccache distlocks fixpackages metadata-transfer news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTDIR_OVERLAY="/usr/local/portage/layman/cwiid /usr/local/portage/layman/java-overlay /usr/local/portage/layman/voip /usr/local/portage/layman/x11 /usr/local/portage/layman/pro-audio /usr/local/portage/layman/gnome /usr/local/portage/layman/desktop-effects /usr/local/portage/layman/sunrise"
USE="3dnow 3dnowext X a52 aac aalib acl acpi alsa amd64 amule apache2 audiofile bash-completion bcmath berkdb bitmap-fonts bittorrent bluetooth bzip2 cairo caps cdda cddb cdinstall cdparanoia cdr chroot cli colordiff cracklib crypt cscope css cups curl dbase dbus directfb dri dvd dvdr dvdread emacs encode exif expat faillog fam fbcon ffmpeg fftw firefox flac foomaticdb ftp gcj gd geoip ggi gif gimp glut gmp gnutls gpm gtk gtk2 gzip hash howl http httpd iconv icp icq idn imagemagick imap imlib ipv6 irc isdnlog jabber jack jad java javascript jbig jikes john jpeg jpeg2k junit lame lash latex lcms libcaca libedit libg++ libnotify libsamplerate libwww lirc live mad matroska mcal md5sum memlimit mhash midi mikmod mime mjpeg mmx mmxext mng motif mp3 mp4 mp4live mpeg mpeg2 mplayer msn multilib musepack mysql mysqli nas ncurses net network nls nntp nptl nptlonly nsplugin ntlm ogg openal opengl openmp openssh openssl pam pcre pdf perl php png posix ppds python qt4 quicktime readline reiser4 reiserfs rtsp sdl sdl-image sensord session sftp sftplogging simplexml soap sockets socks5 speex spell sql sqlite3 sse sse2 ssl startup-notification stats stream svg tcl tcpd tetex tga theora threads thunderbird tidy tiff timidity tk tokenizer tordns trace truetype truetype-fonts tta type1-fonts udev unicode unzip usb userlocales uuencode vhosts vorbis wifi wireshark wma wxwindows x264 xcb xchattext xcomposite xml xmlrpc xorg xulrunner xvid xvmc zlib" ALSA_CARDS="intel8x0" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="fr" LIRC_DEVICES="serial" RUBY_TARGETS="ruby18" SANE_BACKENDS="lexmark umax_pp net" USERLAND="GNU" VIDEO_CARDS="nv nouveau nvidia" 
Comment 1 Raphaël Droz 2009-12-07 11:19:57 UTC
Created attachment 212328 [details]
strace session of the X crash

strace runs while X runs, then opening a new folder in mutt (in X) produced the crash as soon as <enter> is pressed
Comment 2 Martin Mokrejš 2009-12-08 10:49:06 UTC
Please attach the corresponding Xorg.log (and xdm.log files or the relevant to your session manager). Also glxinfo output and test whether glxgears work. On a relative quick glance I haven't seen in your strace output where the server started to shutdown. What I saw is that it writes something to the Xorg.log file.

I think -s or which switch can be used to yield longer write() lines recorded by strace (so the messages are not truncated).
Comment 3 Raphaël Droz 2009-12-08 11:08:31 UTC
Created attachment 212442 [details]
xorg.log after a crash
Comment 4 Raphaël Droz 2009-12-08 13:25:50 UTC
I should also say that my xdm.log doesn't exists as my xdm is slightly modified to let one user autologin. The only modification are :
My is attached.
I can't see any difference susceptible to crash X, anyway ...

About the strace I'll attach a more complete one as soon as I can reboot.
As a last note, I'am able to consistently reproduce this bug as soon as I 'su' in xterm.
Comment 5 Raphaël Droz 2009-12-08 13:26:33 UTC
Created attachment 212450 [details, diff]
Comment 6 Raphaël Droz 2009-12-09 09:12:01 UTC
Created attachment 212518 [details]
xorg log
Comment 7 Raphaël Droz 2009-12-09 09:13:12 UTC
Created attachment 212519 [details]
xorg strace

Xorg crash happens 2 seconds after having launched strace -v -s -ff
Comment 8 Raphaël Droz 2009-12-09 09:15:07 UTC
(In reply to comment #4)
> ...
> ...
Anyway I should have precised that X default to tty2 at boot (I wanted to dig this for some time), that's why I see garbage in it (and in auth.log) after the X crash.
Comment 9 Raphaël Droz 2009-12-22 11:55:36 UTC
I removed x11 overlay and masked stuff.
So with =x11-base/xorg-server-1.7.3 and mostly stable/~amd64, it still segfault at boot (still not when launched with startx) but in a slighty different manner :
it now freezes instead of going back to the previous tty so I have to use sysrq magic to reboot :S
Comment 10 Rémi Cardona gentoo-dev 2009-12-22 17:47:03 UTC
1) drop the -fxxx stuff from your C(XX)FLAGS and rebuild dbus
2) please read this guide [1] and rebuild dbus, libdrm, xorg-server and your X drivers to get a better backtrace in Xorg.0.log


Comment 11 Raphaël Droz 2009-12-22 19:07:36 UTC
(In reply to comment #10)
> 1) drop the -fxxx stuff from your C(XX)FLAGS and rebuild dbus
Done, it still happens
> 2) please read this guide [1] and rebuild dbus, libdrm, xorg-server and your X
> drivers to get a better backtrace in Xorg.0.log
Done, backtrace attached but not much more useful than previous ones.

Note: Xorg froze in a same way this afternoon while started with startx (similar backtrace)
Note 2: I can't reproduce the freeze when xinit is loaded in gdb (sad).
Comment 12 Raphaël Droz 2009-12-22 19:08:25 UTC
Created attachment 213791 [details]
xorg freeze backtrace
Comment 13 Raphaël Droz 2009-12-25 01:28:45 UTC
I suggest to put $(use_enable debug) in the ebuild.
I noticed --enable-debug isn't handled in the ebuild nor its eclasses, and isn't a ./configure default, I'll see if it gives better backtraces.
Comment 14 Raphaël Droz 2009-12-26 13:39:03 UTC
Created attachment 214205 [details]
gdb backtrace

ssh/gdb backtrace of Xorg freeze
Comment 15 Rémi Cardona gentoo-dev 2009-12-26 14:01:26 UTC
(In reply to comment #13)
> I suggest to put $(use_enable debug) in the ebuild.

That has absolutely _nothing_ to do with backtraces. The debug option just enables some debugging paths (which are untested these days) and a few asserts.

That's not what I asked in comment #10. Please read the guide again.

> I noticed --enable-debug isn't handled in the ebuild nor its eclasses, and
> isn't a ./configure default, I'll see if it gives better backtraces.

Again, gdb doesn't segfault in the same location. Don't use gdb to debug Xorg unless you know what you're doing.

Read the guide again and make Xorg crash. The interesting backtrace will be in Xorg.0.log.

Comment 16 Raphaël Droz 2009-12-26 17:05:56 UTC
Following the guide :
$ grep FLAG /etc/make.conf 
CFLAGS="-O2 -march=native -pipe -ggdb"
[recompiled X stuff]
$ ps faux # how X is launched
yug       6009  0.0  0.3  19400  1564 ?        Ss   17:49   0:00 /bin/sh /usr/bin/startx -- -logverbose 9 -verbose 9 -core
yug       6220  0.0  0.1  15468   940 ?        S    17:49   0:00  \_ xinit /home/yug/.xinitrc -- /usr/bin/X -logverbose 9 -verbose 9 -core -auth /home/yug/.serverauth.6009
root      6224 43.7  4.6 102740 23508 tty2     Rs+  17:49   2:05      \_ /usr/bin/X :0 -logverbose 9 -verbose 9 -core -auth /home/yug/.serverauth.6009

Here two backtraces, quite differents but obtained with the same method :
Backtrace 1:
0: /usr/bin/X (xorg_backtrace+0x28) [0x46c858]
1: /usr/bin/X (0x400000+0x62879) [0x462879]
2: /lib/ (0x7fb920307000+0xea40) [0x7fb920315a40]
3: /lib/ (__select+0x13) [0x7fb91eff34d3]
4: /usr/bin/X (WaitForSomething+0x1aa) [0x46306a]
5: /usr/bin/X (0x400000+0x54482) [0x454482]
6: /usr/bin/X (0x400000+0x24fcb) [0x424fcb]
7: /lib/ (__libc_start_main+0xfd) [0x7fb91ef4aa3d]
8: /usr/bin/X (0x400000+0x24b79) [0x424b79]
0: /usr/bin/X (xorg_backtrace+0x28) [0x46c858]
1: /usr/bin/X (0x400000+0x62879) [0x462879]
2: /lib/ (0x7f4175238000+0xea40) [0x7f4175246a40]
3: /usr/lib64/xorg/modules/input/ (0x7f4160a4f000+0x2c55) [0x7f4160a51c55]
4: /usr/lib64/xorg/modules/input/ (0x7f4160a4f000+0x55a1) [0x7f4160a545a1]
5: /usr/bin/X (0x400000+0x722b7) [0x4722b7]
6: /usr/bin/X (0x400000+0xff137) [0x4ff137]
7: /lib/ (0x7f4175238000+0xea40) [0x7f4175246a40]
8: /usr/bin/X (dixLookupProperty+0x3c) [0x4368ac]
9: /usr/bin/X (0x400000+0x3787a) [0x43787a]
10: /usr/bin/X (0x400000+0x54764) [0x454764]
11: /usr/bin/X (0x400000+0x24fcb) [0x424fcb]
12: /lib/ (__libc_start_main+0xfd) [0x7f4173e7ba3d]
13: /usr/bin/X (0x400000+0x24b79) [0x424b79]
The -core is passed to Xorg but I can't find any coredump file.
I guess the CWD of start-stop-daemon is used [/etc/X11], but no /etc/X11/core.
$ grep core /etc/security/limits.conf
*               soft    core            20480
About the gdb stuff, here is the howto I (wrongly) find useful :
About the pstack feature, I didn't try but AFAI read it doesn't work with amd64.
Comment 17 Raphaël Droz 2010-01-13 14:01:05 UTC
I updated to 1.7.4 yesterday and since I'm no more able to reproduce it.
I will never know for sure what happened there (my opinion is about something around X (startx/xinit) process backgrounding with start-stop-daemon --background)