Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 256036 - x11-base/xorg-server-1.5.3-r1: gets killed by app-emulation/basiliskII-jit when radeon AND !vesa
Summary: x11-base/xorg-server-1.5.3-r1: gets killed by app-emulation/basiliskII-jit wh...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-22 19:28 UTC by Martin Mokrejš
Modified: 2009-11-13 12:40 UTC (History)
0 users

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


Attachments
Xorg.0.log (Xorg.0.log,37.34 KB, text/plain)
2009-01-22 19:39 UTC, Martin Mokrejš
Details
debug.txt (debug.txt,29.67 KB, text/plain)
2009-03-11 17:29 UTC, Martin Mokrejš
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Mokrejš 2009-01-22 19:28:32 UTC
Sometimes, the Macintosh emulator BasiliskII kills my X. The Xorg.log contains
useless stacktrace (refer to bug #256034). If I run /usr/bin/Xorg from under gdb and from another ssh session start fvwm2, on the console I start BasiliskII and sometimes it kills the X. If I change xorg.conf to use vesa instead of radeon driver everything works.
Comment 1 Martin Mokrejš 2009-01-22 19:38:29 UTC
Portage 2.1.6.7 (default/linux/x86/2008.0/desktop, gcc-4.3.2, glibc-2.9_p20081201-r1, 2.6.29-rc2-git1 i686)
=================================================================
System uname: Linux-2.6.29-rc2-git1-i686-Mobile_Intel-R-_Pentium-R-_4_-_M_CPU_1.80GHz-with-glibc2.0
Timestamp of tree: Thu, 22 Jan 2009 18:15:01 +0000
distcc 3.1 i686-pc-linux-gnu [disabled]
app-shells/bash:     3.2_p48
dev-java/java-config: 1.3.7-r1, 2.1.6-r1
dev-lang/python:     2.5.2-r8
dev-python/pycrypto: 2.0.1-r6
dev-util/cmake:      2.6.2
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.4.2
sys-apps/sandbox:    1.3.2
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.19
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.28-r1
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -mmmx -msse -msse2 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/bind /var/qmail/alias /var/qmail/control /var/spool/torque /var/vpopmail/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=pentium4 -mmmx -msse -msse2 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages metadata-transfer parallel-fetch protect-owned sandbox sfperms splitdebug strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://gentoo.mirror.web4u.cz"
LDFLAGS="-Wl,-O1"
LINGUAS="en cs cz"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/sunrise /usr/local/portage/layman/java-overlay /usr/local/portage/layman/science /usr/local/portage /usr/local/java-experimental /usr/local/portage/layman/java-overlay"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="7zip R X Xaw3d a52 aac aalib ace acl acpi alsa amr amrnb amrwb apache2 audacious audiofile bash-completion bcmath berkdb blas bluetooth boost branding bzip2 cairo cblas cddb cdparanoia cdr clamav cli colordiff compress cpio cracklib crypt cscope css ctype cups curl curlwrappers cxx dbus dga dia directfb djbfft dri dts dv dvb dvd dvdr dvdread eds emacs emboss emf enblend encode enscript exif expat fam fame fat fbcon ffmpeg fftw firefox flac flash foomaticdb fortran fpx ftp gcj gd gdbm ggi gif gimp gimpprint glibc-compat20 glibc-omitfp glitz glut gmp gnuplot gnutls gpgme gphoto2 gpm graphviz gs gsl gstreamer gtk gtkhtml hal hdf hdf5 hp2xx i8x0 icc iconv icu id3 ieee1394 ifc imagemagick imlib inifile innodb isdnlog ithreads jack java javascript jbig jce jikes jpeg jpeg2k kdtree kerberos lame lapack laptop lcms leim libcaca libedit libnotify libwww live lzo lzw mad maildir matroska mhash midi mikmod mime ming mjpeg mmap mmx mng mod_python modperl modplug motif mozilla moznoirc mp2 mp3 mp4 mpeg mpi mpi_njtree mpich2 mplayer mudflap mule musepack mxdatetime mysql mysqli ncurses netcdf netpbm network nls nntp nptl nptlonly nsplugin ntfs numeric ogg opengl openmp pam pango pcmcia pcntl pcre pdf perl plotutils plugin png pnm postproc postscript ppds pppd procmail pymol python qt3 qt3support qt4 quicktime rar raw readline recode reflection reiserfs rpm samba sasl scanner scp seamonkey server session sftp sift slp smime sndfile soap sockets spell spl sqlite srt sse sse2 ssl startup-notification subtitles subversion svg svgz sysfs sysvipc t1lib tcl tcpd tetex theora threads tidy tiff tk transcode truetype unicode urandom usb userlocales uuencode v4l v4l2 vcd vhook vim-syntax vim-with-x vorbis wifi win32codecs wmf wxwindows x264 x86 xanim xcf xfs xft xinerama xinetd xml xorg xpm xprint xsl xslt xulrunner xv xvid xvmc yv12 zip zlib" ALSA_CARDS="intel-8x0m" 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 dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config mem_cache mime mime_magic rewrite setenvif speling status unique_id userdir usertrack vhost_alias negotiation" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en cs cz" USERLAND="GNU" VIDEO_CARDS="radeon vesa"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Martin Mokrejš 2009-01-22 19:39:27 UTC
Created attachment 179372 [details]
Xorg.0.log

From a normal run (without the anyway useless stacktrace). Just to give you a clue what is my system running.
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2009-01-24 01:12:14 UTC
I would have CC'd the maintainer of app-emulation/basiliskII-jit but there isn't one, so I am CC'ing its recent prolific non-maintainer instead.
Comment 4 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-01-24 06:17:48 UTC
Sorry, no idea and no interest. I just bumped this because a user had written an ebuild and it met the criteria for ~arch on my system.
Comment 5 Rémi Cardona (RETIRED) gentoo-dev 2009-01-25 16:48:39 UTC
If you want to get useful backtraces, I suggest you read up on this guide : http://www.gentoo.org/proj/en/qa/backtraces.xml

I also suggest that you rebuild xorg-server and all ebuilds in x11-drivers/* so that we can pinpoint who is responsible for the crash.

Seeing that radeon crashes but not vesa, I'm tempted to put the blame there.

Thanks
Comment 6 Martin Mokrejš 2009-01-28 17:09:39 UTC
(In reply to comment #5)
> If you want to get useful backtraces, I suggest you read up on this guide :
> http://www.gentoo.org/proj/en/qa/backtraces.xml
> 

A note how to enable core dumps for root apps should be added. See e.g.
http://www.novell.com/support/viewContent.do?externalId=3054866&sliceId=1 

or briefly:

install -m 1777 -d /var/dumps

echo "/var/dumps/core.%e.%p"> /proc/sys/kernel/core_pattern

cat >> /etc/sysctl.conf <<EOF
# http://www.novell.com/support/viewContent.do?externalId=3054866&sliceId=1
kernel.core_pattern=/var/dumps/core.%e.%p
EOF

Comment 7 Martin Mokrejš 2009-01-30 20:23:32 UTC
Few more were necessary as /usr/bin/Xorg is SUID:


cat >> /etc/sysctl.conf <<EOF
kernel.core_uses_pid = 1
EOF

cat >> /etc/conf.d/local.start <<EOF
sysctl -w fs.suid_dumpable=2
EOF
Comment 8 Martin Mokrejš 2009-01-30 20:55:36 UTC
The BasiliskII binary can be run successfully over forwarded X11 connection. Probably due to the missing RANDR features. Please note that I do have configured in xorg.conf for DRI but in real I do NOT have the kernel module installed. Xorg detects the situation and does not enable RANDR. However, this probably triggers something in radeon modules from xorg-server while not in the vesa module.

As said above running BasiliskII via X11 forwarded connection works:


(gdb) file /usr/bin/BasiliskII
Reading symbols from /usr/bin/BasiliskII...done.
(gdb) run
Starting program: /usr/bin/BasiliskII 
[Thread debugging using libthread_db enabled]
Basilisk II V1.0 by Christian Bauer et al.
[New Thread 0xb7152700 (LWP 12635)]
Xlib:  extension "RANDR" missing on display "localhost:10.0".

(BasiliskII:12635): Gdk-WARNING **: Connection to display localhost:10.0 appears to be untrusted. Pointer and keyboard grabs and inter-client communication may not work as expected.

Reading ROM file...

Program exited normally.
(gdb) 

If run force it to run on a local display it dies due to X being killed (just confirming what we already know):

(gdb) set args --display :0
(gdb) run
Starting program: /usr/bin/BasiliskII --display :0
[Thread debugging using libthread_db enabled]
Basilisk II V1.0 by Christian Bauer et al.
[New Thread 0xb7040700 (LWP 13000)]
AllocNewConnection: client index = 5, socket fd = 18
AllocNewConnection: client index = 6, socket fd = 19
Reading ROM file...
XF86VidModeQueryVersion
XF86VidModeSetClientVersion
XF86VidModeGetAllModelines
xinit:  connection to X server lost.
xterm:  fatal IO error 32 (Broken pipe) or KillClient on X server ":0.0"
The application 'BasiliskII' lost its connection to the display :0.0;
most likely the X server was shut down or you killed/destroyed
the application.

Program exited normally.
(gdb) where
No stack.
(gdb) 

Have still to figure out why I do not get any backtrace from the /var/dumps/core.X.10941 file.
Comment 9 Rémi Cardona (RETIRED) gentoo-dev 2009-03-09 13:27:11 UTC
I think it's probably easier to attach gdb to a running X instead.

Please don't hesitate to reopen this bug once you have a backtrace of some sort.

Thanks
Comment 10 Martin Mokrejš 2009-03-11 17:29:18 UTC
Created attachment 184718 [details]
debug.txt

I suspect an issue with the core dump file or gdb. When /usr/bin/Xorg is not listed by gdb in the list of source objects there is no debug stacktrace. Probably that comes hand in hand with 

warning: Can't read pathname for load map: Input/output error.


CFLAGS="-O2 -march=pentium4 -mmmx -msse -msse2 -pipe -fno-strict-aliasing -ggdb"
CXXFLAGS="-O2 -march=pentium4 -mmmx -msse -msse2 -pipe -fno-strict-aliasing -ggdb"
FEATURES="distlocks fixpackages metadata-transfer nostrip parallel-fetch protect-owned sandbox sfperms splitdebug strict unmerge-orphans userfetch"
Comment 11 Martin Mokrejš 2009-03-11 17:31:58 UTC
Still an issue with 1.5.3-r1. I wonder why the very same application does not kill X when started by root. I even copied the application preferences files over those of a user but no improvement.
Comment 12 Rémi Cardona (RETIRED) gentoo-dev 2009-05-06 09:31:33 UTC
If you've rebuilt the X packages with debug symbols then you should have a simple backtrace directly in the X log.

In any case, please try again with newer xf86-video-ati drivers.

Thanks
Comment 13 Martin Mokrejš 2009-05-06 14:19:19 UTC
Please commit the change to the ebuild so that it supports debug USE flags and force -DDEBUG and -DNDEBUG CFLAGS, it is somewhere in bugzila. I will recompile then xorg-server with drivers and see. However, the Xorg.log file did not contain stactraces, never. Note this is SUID program and in some other bugreport I posted what else I had to do to get the coredumps created at all by linux kernel. Please update the docs on debugging apps on Gentoo as well. In that regard I have also placed my findings in bugzilla. Please save my time as well by committing patches and I will help with testing. Thanks. ;-)
Comment 14 Rémi Cardona (RETIRED) gentoo-dev 2009-06-22 07:47:07 UTC
xorg-server 1.6 is now available in ~arch.

Can you still reproduce with that version and newer drivers?

Thanks
Comment 15 Martin Mokrejš 2009-10-17 22:10:52 UTC
(In reply to comment #14)
> xorg-server 1.6 is now available in ~arch.
> 
> Can you still reproduce with that version and newer drivers?

Reproduced with 2.6.30.6 kernel, xorg-server-1.6.4, xf86-video-ati-6.12.4.

Stacktraces are useless until bug #256034:

Core was generated by `/usr/bin/X :0 vt7 -auth /var/lib/xdm/authdir/authfiles/A:0-OjsWr8'.
Program terminated with signal 11, Segmentation fault.
[New process 2378]
#0  0x07c007c0 in ?? ()
(gdb) where
#0  0x07c007c0 in ?? ()
#1  0x00000000 in ?? ()
(gdb) quit

Oct 17 23:37:25 vrapenec kernel: X[13533]: segfault at 0 ip (null) sp bf829f40 error 4 in Xorg[8048000+1a4000]
Oct 17 23:37:26 vrapenec su[13625]: pam_unix(su:session): session closed for user root
Oct 17 23:37:26 vrapenec su[14025]: pam_unix(su:session): session closed for user root
Oct 17 23:37:26 vrapenec kernel: xdm[13538]: segfault at b7f12d6d ip b7bd2fcb sp bfbc52b0 error 4 in libc-2.10.1.so[b7b60000+151000]
Oct 17 23:37:47 vrapenec kernel: SysRq : Emergency Sync


Oct 17 23:55:29 vrapenec kernel: X[2378]: segfault at 7c007c0 ip 07c007c0 sp bfd81720 error 4 in Xorg[8048000+1a4000]
Oct 17 23:55:29 vrapenec su[2748]: pam_unix(su:session): session closed for user root
Oct 17 23:55:56 vrapenec kernel: SysRq : Emergency Sync

Comment 16 Rémi Cardona (RETIRED) gentoo-dev 2009-10-18 09:11:10 UTC
You can get proper backtraces with the guide we wrote [1]

Xorg's assert() support is just _extra_ compared to the backtraces.

So please try following the guide, you'll get proper backtraces.

Thanks

[1] http://www.gentoo.org/proj/en/qa/backtraces.xml
Comment 17 Martin Mokrejš 2009-11-13 12:40:14 UTC
(In reply to comment #16)
> You can get proper backtraces with the guide we wrote [1]
> 
> Xorg's assert() support is just _extra_ compared to the backtraces.
> 
> So please try following the guide, you'll get proper backtraces.
> 
> Thanks
> 
> [1] http://www.gentoo.org/proj/en/qa/backtraces.xml
> 

BTW, the guide is not sufficient to get core dumps of SUID applications. Although I tried to document what I found by Google searches I still do not get useful stacktraces although I do get the core dumps. See bugs #289483 and #289364.