Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 197104 - x11-base/xorg-server-1.3 and 1.4 consumes 100% CPU, locking the keyboard, apparently triggered by opening an OpenOffice pulldown menu
Summary: x11-base/xorg-server-1.3 and 1.4 consumes 100% CPU, locking the keyboard, app...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: x86 Linux
: High critical (vote)
Assignee: Gentoo X packagers
URL: https://bugs.freedesktop.org/show_bug...
Whiteboard:
Keywords: Inclusion
Depends on:
Blocks:
 
Reported: 2007-10-26 03:51 UTC by Steven Winikoff
Modified: 2008-05-05 21:21 UTC (History)
2 users (show)

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


Attachments
patch using sigaction instead of signal (no glibc-only extensions) (1.4-dont-hang-openoffice.patch,2.21 KB, patch)
2008-05-04 03:52 UTC, Billy Dorminy
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Winikoff 2007-10-26 03:51:02 UTC
Details are available here:
https://bugs.launchpad.net/ubuntu/+source/xorg/+bug/152992
https://bugs.launchpad.net/ubuntu/+source/xorg/+bug/135878
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=433131
https://bugs.freedesktop.org/show_bug.cgi?id=10525
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=411287
http://qa.openoffice.org/issues/show_bug.cgi?id=75578

The summary is of the symptoms is that the keyboard occasionally locks up completely, with no response even to NumLock or CapsLock.  The mouse pointer tracks, but mouse button events are ignored.  The only way to recover the system from the console is to reset or power cycle, but the system itself is still up and will respond to ssh connections.  Underneath, the X server is consuming 100% of the CPU.  The triggering event is usually an attempt to open a menu in any of the OpenOffice applications, but I've personally seen the same condition triggered by GoogleEarth and Dosemu.

There seems to be no commonality of hardware (at least x86 and amd64), distribution (I'm on Gentoo, but bug reports are common on Debian, Ubuntu and Suse among others), Xorg server version (I've personally witnessed at least x11-base/xorg-server-1.1.1-r4 through 1.3.0.0-r1), video card (at least Nvidia and Intel), kernel version (in my case from 2.6.19.something through 2.6.22.1, the most recent vanilla-sources kernel at the moment) or anything else I can think of offhand.

This is almost certainly an upstream problem.  A patch is available here:
http://cvs.fedora.redhat.com/viewcvs/devel/xorg-x11-server/xserver-1.3.0-xkb-and-loathing.patch?view=markup
...but this patch is not incorporated into the upstream release of version 1.4, at least not as of this writing (2007/10/25).

Basically I'm just requesting that this patch or something like it be incorporated into the next ebuild for x11-base/xorg-server

Reproducible: Sometimes

Steps to Reproduce:
Basically the only way I've found to reproduce this is to keep using OpenOffice.  The length of time may vary (from a low of a few hours to a high of about three weeks of using OpenOffice 3-4 times per week), but sooner or later the system will lock up when clicking on a pulldown menu in OpenOffice.

Actual Results:  
As above, the system will enter the state in which the X server is consuming all available CPU cycles and the keyboard is completely unresponsive.

Some people have reported that their systems returned to normal eventually with no intervention (where "eventually" is on the order of 5-30 minutes), but in my experience if the machine hangs at night, it will still be hung until the next morning when I can log into it remotely.

Expected Results:  
The system shouldn't lock up this way. :-)

My personal configuration is an Asus P5B-VM motherboard with an Intel Core 2 Q6600 CPU, onboard Intel X3000 (965G) graphics, 4 Gb of memory, 32-bit (x86) Gentoo with vanilla-sources kernel 2.6.22.1.  However, as described above, the problem appears not to be specific to any of these details; the same problem has been reported on systems that vary in all of the above respects.
Comment 1 Alexandre Rostovtsev (RETIRED) gentoo-dev 2007-11-07 04:58:29 UTC
Same issue here, in both openoffice and openoffice-bin. Opening any openoffice menu has a 25% chance of freezing X.

Portage 2.1.3.19 (default-linux/amd64/2007.0/desktop, gcc-4.2.2, glibc-2.6.1-r0, 2.6.22-gentoo-r8 x86_64)
=================================================================
System uname: 2.6.22-gentoo-r8 x86_64 Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz
Comment 2 Donnie Berkholz (RETIRED) gentoo-dev 2007-11-07 07:21:56 UTC
It's on master branch, but it hasn't yet 1.4 branch yet. I asked ajax about that, and I'm waiting to hear back.

commit a5b8053606d6e786cdcf6734f271acc05f9cc588
Author: Adam Jackson <ajax@benzedrine.nwnk.net>
Date:   Tue Sep 11 11:37:06 2007 -0400

    Ignore - not just block - SIGALRM around Popen()/Pclose().
    
    Because our "popen" implementation uses stdio, and because nobody's stdio
    library is capable of surviving signals, we need to make absolutely sure
    that we hide the SIGALRM from the smart scheduler.  Otherwise, when you
    open a menu in openoffice, and it recompiles XKB to deal with the
    accelerators, and you popen xkbcomp because we suck, then the scheduler
    will tell you you're taking forever doing something stupid, and the
    wait() code will get confused, and input will hang and your CPU usage
    slams to 100%.  Down, not across.
Comment 3 Donnie Berkholz (RETIRED) gentoo-dev 2007-12-14 07:59:44 UTC
Should be fixed in 1.4.0.90, please reopen if it's not.
Comment 4 Carlos Eduardo Santos 2008-04-14 22:49:10 UTC
I added this in /etc/portage/package.keywords:
# bugs
# xorg-1.3.0.0-r5
x11-base/xorg-server
x11-libs/pixman
x11-libs/libXrender
x11-proto/renderproto
media-libs/mesa
x11-libs/xtrans
x11-drivers/xf86-input-keyboard
# not asked by portage but required
x11-drivers/xf86-input-mouse
x11-drivers/xf86-video-ati

emerge --sync and emerge -u xorg-server
revdep-rebuild -i -p shows only gobby which fails to compile (another bug)

The behaviour is the same as 1.3.0.0-r5: I can run X, alone, but starting gdm, xdm or slim locks the keyboard, mouse and X (100% CPU) cannot be killed.

Portage 2.1.4.4 (default/linux/x86/2008.0/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.24-gentoo-r3 i686)
=================================================================
System uname: 2.6.24-gentoo-r3 i686 AMD Athlon(tm) XP 2600+
Timestamp of tree: Mon, 14 Apr 2008 20:04:01 +0000
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p17-r1
dev-java/java-config: 1.3.7, 2.1.4
dev-lang/python:     2.3.5-r3, 2.4.4-r9
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"
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/config /var/bind"
CONFIG_PROTECT_MASK="/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/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"
DISTDIR="/mnt/sata/portage/distfiles"
FEATURES="ccache distlocks fixpackages metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://www.gtlib.gatech.edu/pub/gentoo http://mirror.datapipe.net/gentoo http://gentoo.mirrors.pair.com/"
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
LINGUAS="en"
MAKEOPTS="-j2"
PKGDIR="/mnt/sata/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="/mnt/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext 7zip X acpi alsa apache2 bash-completion berkdb bluetooth branding bzip2 bzlib cairo cddb cdr cli cracklib crypt cups dbus divx4linux djvu dri dvd dvdr dvdread emboss esd evo fam firefox flac foomaticdb fortran gdbm gif gnome gphoto2 gpm gstreamer gtk gtk2 hal iconv innodb isdnlog javascript jpeg jpeg2k kdeenablefinal kdexdeltas keyring lcms libnotify logrotate mad matroska midi mmx mmx2 mmxext mng mp3 mpeg msn mudflap ncurses network-cron nls nptl nptlonly nsplugin offensive ogg opengl openmp oscar pam pcre pdf perl php png ppds pppd python qt3support qt4 quicktime readline reflection rtc ruby samba sasl sdl session spl sse ssl startup-notification svg tcpd threads truetype unicode v4l v4l2 vhosts vim-syntax vorbis win32codecs x86 xinetd xml xorg xosd xprint xv xvid xvmc yv12 zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter 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 so speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="worker" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" USERLAND="GNU" VIDEO_CARDS="radeon"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

I'll try recompile everything with stable version
Comment 5 Billy Dorminy 2008-05-04 03:52:46 UTC
Created attachment 151747 [details, diff]
patch using sigaction instead of signal (no glibc-only extensions)

Type sighandler_t and function signal() are glibc extensions and as such do not work on systems without glibc (for instance, Darwin/OS X). This patch uses POSIX signal-handling functions and structs instead, for cross-platform compatibility.
Comment 6 Billy Dorminy 2008-05-04 03:57:43 UTC
(In reply to comment #5)
> Created an attachment (id=151747) [edit]
> patch using sigaction instead of signal (no glibc-only extensions)
> 
> Type sighandler_t and function signal() are glibc extensions and as such do not
> work on systems without glibc (for instance, Darwin/OS X). This patch uses
> POSIX signal-handling functions and structs instead, for cross-platform
> compatibility.
> 
Apologies for not knowing where to put this patch/the correct format/etc. It's Adam Jackson's patch, updated to use the POSIX sighandlers instead.
Comment 7 Carlos Eduardo Santos 2008-05-04 13:57:46 UTC
I forgot to mention that rebuilding system/world worked for me. But that takes a loooong time!
Comment 8 Donnie Berkholz (RETIRED) gentoo-dev 2008-05-05 21:21:41 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > Created an attachment (id=151747) [edit]
> > patch using sigaction instead of signal (no glibc-only extensions)
> > 
> > Type sighandler_t and function signal() are glibc extensions and as such do not
> > work on systems without glibc (for instance, Darwin/OS X). This patch uses
> > POSIX signal-handling functions and structs instead, for cross-platform
> > compatibility.
> > 
> Apologies for not knowing where to put this patch/the correct format/etc. It's
> Adam Jackson's patch, updated to use the POSIX sighandlers instead.

It needs to go upstream to bugs.freedesktop.org in the xorg product. You can get the latest copy of the xserver source to patch against by running `git clone git://anongit.freedesktop.org/git/xorg/xserver`.