Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 163142 - Xorg freezes the computer and uses 100% of CPU after switching to it from a virtual terminal
Summary: Xorg freezes the computer and uses 100% of CPU after switching to it from a v...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: x86 Linux
: High critical (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-21 22:56 UTC by Dima Ryazanov
Modified: 2007-01-26 08:19 UTC (History)
0 users

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


Attachments
xorg.conf (xorg.conf,4.63 KB, text/plain)
2007-01-21 22:57 UTC, Dima Ryazanov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dima Ryazanov 2007-01-21 22:56:13 UTC
After kdm started, I switched to VT1 (using Alt-Ctrl-F1), then tried to switch back. But, X froze.


Reproducible: Couldn't Reproduce

Steps to Reproduce:
1. Start X
2. Switch to the first terminal - e.g., Ctrl-Alt-F1
3. Switch back

Actual Results:  
X locked up, using 100% of the CPU. I could still see the first terminal on the screen, and the keyboard didn't work.

Expected Results:  
I should be back in X.


I logged into my computer over SSH, and tried to figure out what's going on.

"chvt 1" freezes on the line:
37          if (ioctl(fd,VT_WAITACTIVE,num)) {

I tried running "DISPLAY=:0 xset q" - and it froze, too.

Then I attached gdb to X, and tried Ctrl-C'ing it and printing backtraces, to see if they change. Here are some:

#0  0x08198cb0 in SmartScheduleInit ()
#1  0xb2e16931 in radeonGetLock () from /usr/lib/dri/radeon_dri.so
#2  0xb2e14150 in radeonCreateContext () from /usr/lib/dri/radeon_dri.so
#3  0xb2e483e7 in _mesa_endDispatchOverride () from /usr/lib/dri/radeon_dri.so
#4  0xb2e48bdf in _mesa_make_current () from /usr/lib/dri/radeon_dri.so
#5  0xb2e1319a in radeonMakeCurrent () from /usr/lib/dri/radeon_dri.so
#6  0xb2e0ff64 in __driUtilUpdateDrawableInfo () from /usr/lib/dri/radeon_dri.so
#7  0xb7c4573a in __glXUseXFont () from /usr/lib/xorg/modules/extensions/libglx.so
#8  0xb7c1fea7 in DoMakeCurrent () from /usr/lib/xorg/modules/extensions/libglx.so
#9  0xb7c20049 in __glXMakeCurrent () from /usr/lib/xorg/modules/extensions/libglx.so
#10 0xb7c22e2e in __glXFreeContext () from /usr/lib/xorg/modules/extensions/libglx.so
#11 0x08086add in Dispatch ()
#12 0x0806e73e in main ()

Later:

(gdb) cont
Continuing.

Program received signal SIGUSR1, User defined signal 1.
0x08198cb0 in SmartScheduleInit ()
(gdb) bt
#0  0x08198cb0 in SmartScheduleInit ()
#1  0xb2e16931 in radeonGetLock () from /usr/lib/dri/radeon_dri.so
#2  0xb2e14150 in radeonCreateContext () from /usr/lib/dri/radeon_dri.so
#3  0xb2e483e7 in _mesa_endDispatchOverride () from /usr/lib/dri/radeon_dri.so
#4  0xb2e48bdf in _mesa_make_current () from /usr/lib/dri/radeon_dri.so
#5  0xb2e1319a in radeonMakeCurrent () from /usr/lib/dri/radeon_dri.so
#6  0xb2e0ff64 in __driUtilUpdateDrawableInfo () from /usr/lib/dri/radeon_dri.so
#7  0xb7c4573a in __glXUseXFont () from /usr/lib/xorg/modules/extensions/libglx.so
#8  0xb7c1fea7 in DoMakeCurrent () from /usr/lib/xorg/modules/extensions/libglx.so
#9  0xb7c20049 in __glXMakeCurrent () from /usr/lib/xorg/modules/extensions/libglx.so
#10 0xb7c22e2e in __glXFreeContext () from /usr/lib/xorg/modules/extensions/libglx.so
#11 0x08086add in Dispatch ()
#12 0x0806e73e in main ()

Not sure where SIGUSR1 came from... Does chvt send it?

After that, X was stuck here:

#0  0x080e4b40 in xf86VTRequest ()
#1  <signal handler called>
#2  0x08198cb0 in SmartScheduleInit ()
#3  0xb2e16931 in radeonGetLock () from /usr/lib/dri/radeon_dri.so
#4  0xb2e14150 in radeonCreateContext () from /usr/lib/dri/radeon_dri.so
#5  0xb2e483e7 in _mesa_endDispatchOverride () from /usr/lib/dri/radeon_dri.so
#6  0xb2e48bdf in _mesa_make_current () from /usr/lib/dri/radeon_dri.so
#7  0xb2e1319a in radeonMakeCurrent () from /usr/lib/dri/radeon_dri.so
#8  0xb2e0ff64 in __driUtilUpdateDrawableInfo () from /usr/lib/dri/radeon_dri.so
#9  0xb7c4573a in __glXUseXFont () from /usr/lib/xorg/modules/extensions/libglx.so
#10 0xb7c1fea7 in DoMakeCurrent () from /usr/lib/xorg/modules/extensions/libglx.so
#11 0xb7c20049 in __glXMakeCurrent () from /usr/lib/xorg/modules/extensions/libglx.so
#12 0xb7c22e2e in __glXFreeContext () from /usr/lib/xorg/modules/extensions/libglx.so
#13 0x08086add in Dispatch ()
#14 0x0806e73e in main ()

Even "stepi" would not return. I'd assume that X was waiting for something now. But, it was still using 100% of CPU.
Comment 1 Dima Ryazanov 2007-01-21 22:57:18 UTC
Created attachment 107732 [details]
xorg.conf
Comment 2 Dima Ryazanov 2007-01-21 23:03:30 UTC
Actually, it IS reproducible, 100% of the time.

1. I start kdm, log into KDE.
2. While KDE is starting, I switch to VT1.
3. Wait for KDE to start.
4. Switch back.

It freezes...

I suspect that it's caused by one particular program. I'll try to figure out
which one. And I'll compile X in debug mode.
Comment 3 Dima Ryazanov 2007-01-26 07:03:21 UTC
Backtrace in debug mode:

#0  SmartScheduleTimer (sig=14) at utils.c:1588
#1  <signal handler called>
#2  0xb7f9540e in __kernel_vsyscall ()
#3  0xb7dcf749 in ioctl () from /lib/libc.so.6
#4  0xb7c35154 in drmGetLock (fd=8, context=54, flags=3216524420) at xf86drm.c:1254
#5  0xb2e81931 in radeonGetLock () from /usr/lib/dri/radeon_dri.so
#6  0xb2e7f150 in radeonCreateContext () from /usr/lib/dri/radeon_dri.so
#7  0xb2eb33e7 in _mesa_endDispatchOverride () from /usr/lib/dri/radeon_dri.so
#8  0xb2eb3bdf in _mesa_make_current () from /usr/lib/dri/radeon_dri.so
#9  0xb2e7e19a in radeonMakeCurrent () from /usr/lib/dri/radeon_dri.so
#10 0xb2e7af64 in __driUtilUpdateDrawableInfo () from /usr/lib/dri/radeon_dri.so
#11 0xb7cae73a in __glXDRIcontextMakeCurrent (baseContext=0x849ffa8) at glxdri.c:239
#12 0xb7c88ea7 in DoMakeCurrent (cl=0x849f328, drawId=35651779, readId=35651779, contextId=35651778, tag=0)
    at glxcmds.c:655
#13 0xb7c89049 in __glXMakeCurrent (cl=0x849f328, pc=0x848da84 "\235\005\004") at glxcmds.c:415
#14 0xb7c8be2e in __glXDispatch (client=0x84000e8) at glxext.c:483
#15 0x08086add in Dispatch () at dispatch.c:459
#16 0x0806e73e in main (argc=8, argv=0xbfb84bd4, envp=Cannot access memory at address 0x40086432
) at main.c:447

(The first time I ran "bt", though, the first two lines - signal handler - weren't there.)
Comment 4 Dima Ryazanov 2007-01-26 07:04:43 UTC
Oh, and emerge --info:

Portage 2.1.1-r2 (default-linux/x86/2006.1/desktop, gcc-4.1.1, glibc-2.4-r4, 2.6.19-gentoo-r3 i686)
=================================================================
System uname: 2.6.19-gentoo-r3 i686 AMD Athlon(tm) XP 2000+
Gentoo Base System version 1.12.6
Last Sync: Fri, 26 Jan 2007 06:01:01 +0000
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: 1.3.7, 2.0.31
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
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
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-march=athlon-xp -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS=" http://ftp.ucsb.edu/pub/mirrors/linux/gentoo/ http://cudlug.cudenver.edu/gentoo/ http://mirror.usu.edu/mirrors/gentoo/ http://distro.ibiblio.org/pub/linux/distributions/gentoo/ "
LC_ALL="en_US.UTF-8"
LINGUAS="en uk ru"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X aac acl acpi alsa alsa_cards_ali5451 alsa_cards_als4000 alsa_cards_atiixp alsa_cards_atiixp-modem alsa_cards_bt87x alsa_cards_ca0106 alsa_cards_cmipci alsa_cards_emu10k1x alsa_cards_ens1370 alsa_cards_ens1371 alsa_cards_es1938 alsa_cards_es1968 alsa_cards_fm801 alsa_cards_hda-intel alsa_cards_intel8x0 alsa_cards_intel8x0m alsa_cards_maestro3 alsa_cards_trident alsa_cards_usb-audio alsa_cards_via82xx alsa_cards_via82xx-modem alsa_cards_ymfpci alsa_pcm_plugins_adpcm alsa_pcm_plugins_alaw alsa_pcm_plugins_asym alsa_pcm_plugins_copy alsa_pcm_plugins_dmix alsa_pcm_plugins_dshare alsa_pcm_plugins_dsnoop alsa_pcm_plugins_empty alsa_pcm_plugins_extplug alsa_pcm_plugins_file alsa_pcm_plugins_hooks alsa_pcm_plugins_iec958 alsa_pcm_plugins_ioplug alsa_pcm_plugins_ladspa alsa_pcm_plugins_lfloat alsa_pcm_plugins_linear alsa_pcm_plugins_meter alsa_pcm_plugins_mulaw alsa_pcm_plugins_multi alsa_pcm_plugins_null alsa_pcm_plugins_plug alsa_pcm_plugins_rate alsa_pcm_plugins_route alsa_pcm_plugins_share alsa_pcm_plugins_shm alsa_pcm_plugins_softvol ao avi bitmap-fonts cairo cdr cli cracklib crypt cups dbus dlloader dri dvd dvdr elibc_glibc emboss encode fam firefox fortran gdbm gif glut gpm gstreamer hal iconv imlib input_devices_keyboard input_devices_mouse ipv6 isdnlog jpeg kde kdehiddenvisibility kernel_linux lcd_devices_bayrad lcd_devices_cfontz lcd_devices_cfontz633 lcd_devices_glk lcd_devices_hd44780 lcd_devices_lb216 lcd_devices_lcdm001 lcd_devices_mtxorb lcd_devices_ncurses lcd_devices_text ldap libg++ linguas_en linguas_ru linguas_uk mad mikmod mmx mng mp3 mpeg ncurses nls nptl nptlonly nsplugin ogg opengl pam pcre pdf perl png ppds pppd python qt3 qt4 quicktime rdesktop readline reflection samba scanner sdl session spell spl ssl tcpd tetex truetype truetype-fonts type1-fonts udev unicode userland_GNU video_cards_ati video_cards_radeon vorbis wifi win32codecs xine xinerama xml xorg xscreensaver xv zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 5 Dima Ryazanov 2007-01-26 07:18:23 UTC
Ok, found out exactly what causes X to freeze.

When I logged into KDE, Amarok would start, and try to access DRM - after I switched to a VT.

Same happens if I simply run glxgears after leaving X. glxgears prints:

libGL error: open DRM failed (Operation not permitted)
libGL error: reverting to (slow) indirect rendering

and X freezes.

I'll see if Xorg 7.2 still does that...
Comment 6 Dima Ryazanov 2007-01-26 08:19:05 UTC
Oh wow... It's actually fixed in 7.2.