Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 526802

Summary: x11-apps/xinit-1.3.4 - unresponsive keyboard, one cpu core at 100% load
Product: Gentoo Linux Reporter: Felix J. Ogris <fjo-gentoo>
Component: Current packagesAssignee: Gentoo X packagers <x11>
Status: RESOLVED FIXED    
Severity: normal CC: slashbeast, thunder367
Priority: Normal Keywords: PMASKED
Version: unspecified   
Hardware: AMD64   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=526762
Whiteboard:
Package list:
Runtime testing required: ---

Description Felix J. Ogris 2014-10-25 21:52:38 UTC
After updating to xinit-1.3.4, keyboard becomes unresponsive (even numlock and capslock are stuck) when I launch X via startx from a console. This happens immediately when the window manager (xfce in my case) has been loaded and I hit any key. Then, one cpu core gets 100% loaded.

Reproducible: Always

Steps to Reproduce:
either:
update to xinit 1.3.4, call "startx", press any key

or:
stick with xinit 1.3.3, call "startx -- vt1", press any key
Actual Results:  
unresponsive keyboard, even numlock and capslock are stuck, one cpu core gets 100% loaded


Strace'ing X reveals: select() is reporting that file descriptor 8 is ready for reading, the following read() on file descriptor 8 returns -1, and errno has been set to EIO. Then select() is called again, and so forth. Several thousand times per second. According to /proc/<PID_of_X>/fd file descriptor 8 is /dev/tty1 - the console where I called startx.
gdb indicates that it might be the select() called from the main event loop in WaitForSomething(), but that could be not true as I haven't compiled xorg-server with debug symbols.

Downgrading to xinit-1.3.3 fixes this issue. startx from 1.3.4 passes $vtarg to the X server. $vtarg contains "vt1" if you're coming from tty1, vt2 if from tty2, and so on.

You can forcefully trigger this behaviour by calling "startx -- vt1".
BTW: If you're on tty1 and launch "startx -- vt2", cpu will idle, but your keyboard will be unresponsive anyways.

I was able to reproduce this issue on Linux 3.14.4, 3.14.22, 3.15.10, 3.16.6, and 3.17.1.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2014-10-26 08:08:03 UTC
Please post your `emerge --info' output in a comment.
Comment 2 Felix J. Ogris 2014-10-26 08:18:17 UTC
Portage 2.2.14 (python 2.7.8-final-0, default/linux/amd64/13.0, gcc-4.8.3, glibc-2.19-r1, 3.17.1 x86_64)
=================================================================
System uname: Linux-3.17.1-x86_64-Intel-R-_Core-TM-_i7-4770S_CPU_@_3.10GHz-with-gentoo-2.2
KiB Mem:    16250924 total,  15150780 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Sat, 25 Oct 2014 18:00:01 +0000
ld GNU ld (Gentoo 2.24 p1.4) 2.24
app-shells/bash:          4.3_p30
dev-java/java-config:     2.2.0
dev-lang/perl:            5.20.1-r1
dev-lang/python:          2.7.8, 3.3.5-r1, 3.4.2
dev-util/cmake:           3.0.2
dev-util/pkgconfig:       0.28-r2
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.13.1
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.14.1
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.8.3
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2-r1
sys-devel/make:           4.1-r1
sys-kernel/linux-headers: 3.17 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA googleearth AdobeFlash-10.3 AdobeFlash-11.x Oracle-BCLA-JavaSE QUAKE4 dlj-1.1"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=nocona"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /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"
CXXFLAGS="-O2 -pipe -march=nocona"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news notitles parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j8"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
USE="X a52 aac aalib acl acpi alsa amd64 apng asf async audiofile avahi avi bash-completion berkdb bitmap-fonts bzip2 cairo cdda cddb cdio cdparanoia cli color-console cpufreq cracklib crypt css cups cxx dbus dga dia dri dts dvd dvdnav dvdr dvdread encode exif extraengine extras f77 faac fam ffmpeg flac flash font-server fortran ftp fts3 fuse g3dvl gdbm gif gimp glib glut gmp gmplayer gtk gtk2 gtk3 gui havekernel hddtemp hfs highlight hipe iconv icu id3tag idn imagemagick imap imlib ipv6 jabber java javamail javascript jpeg jpeg2k kpathsea kpoll lame latex lcms libcaca libffi libg++ libv4l2 libwww lights lm_sensors log4j lua lvm lzo macosx-eyetv mad maildir management matroska md5sum mdnsresponder-compat ming minizip mmap mmx mmxext mng modules motif mp2 mp3 mpeg multilib mysql ncurses nfs nls nntp nptl nptlonly nsplugin nvidia ogg oggvorbis opengl openmp opus oss pam pcre pdf pdflib perl pg-intdatetime png pnm pop postgres python qemu qmax qt3support qt4 quicktime rdoc readline real rtsp samba sasl sdl secure-delete session smp smtp sndfile spell sqlite sse sse2 ssl startup-notification stream subversion svg sysfs syslog textures theora threads tiff tk tools truetype truetype-fonts type1-fonts unicode upcall upnp usb v4l v4l2 vcd vhosts vim-syntax vorbis win32codecs wma wmf x264 xanim xcomposite xext xinerama xml xml2 xmms xpm xsl xulrunner xv xvid xvmc zeroconf zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="canon ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en de" NETBEANS_MODULES="java php harness ide nb profiler websvccommon" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" QEMU_SOFTMMU_TARGETS="x86_64 i386" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="nv nvidia v4l" XFCE_PLUGINS="menu brightness clock logout trash" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON
Comment 3 Alex 2014-10-28 09:30:20 UTC
I am confirming this bug.

My case looks like that:
1. run `startx` from vt1
2. Start emacs
3. Nothing happens, htop shows, that `emacs` and `X`processes eat 100% of cpu.
4. strace of emacs shows, that it tries to `recvmsg` but getting -1 every time.
5. Kill X 
6. Run `startx -- vt7` from vt1
7. Emacs works.

version of xinit: 

     Installed versions:  Version:   1.3.4
                          Date:      18:14:42 27.10.2014
                          USE:       minimal
Comment 4 Alex 2014-10-28 09:30:46 UTC
Portage 2.2.14 (python 2.7.8-final-0, default/linux/amd64/13.0/desktop, gcc-4.8.3, glibc-2.19-r1, 3.17.1-gentoo-r1 x86_64)
=================================================================
System uname: Linux-3.17.1-gentoo-r1-x86_64-Intel-R-_Celeron-R-_CPU_G1620_@_2.70GHz-with-gentoo-2.2
KiB Mem:     8052476 total,   5961976 free
KiB Swap:    8388604 total,   8388604 free
Timestamp of tree: Sun, 26 Oct 2014 16:45:02 +0000
ld GNU ld (Gentoo 2.24 p1.4) 2.24
app-shells/bash:          4.3_p30
dev-java/java-config:     2.2.0
dev-lang/perl:            5.20.1-r2
dev-lang/python:          2.7.8, 3.3.5-r1, 3.4.1
dev-util/cmake:           3.0.2
dev-util/pkgconfig:       0.28-r2
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.13.1
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.14.1
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.8.3
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2-r1
sys-devel/make:           4.1-r1
sys-kernel/linux-headers: 3.17 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo gentoo-haskell
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -mtune=native -march=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /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"
CXXFLAGS="-O2 -pipe -mtune=native -march=native"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="-j2 --keep-going --backtrack=100 --autounmask n"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://mirror.yandex.ru/gentoo-distfiles/"
LANG="ru_RU.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j2 -l4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/haskell"
SYNC="rsync://rsync2.ru.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 avx bash-completion berkdb branding bzip2 cairo cdda cdr cjk cli consolekit cracklib crypt cups cxx dbus djvu dri dts dvd dvdr emacs emboss encode exif fam ffmpeg fftw firefox flac fontconfig fortran gallium gdbm gif glamor gmp gpm gtk iconv icu idn imagemagick ipv6 jemalloc joystick jpeg jpeg2k ladspa lcdfilter lcms ldap libnotify logrotate lzma lzo mad mmx mmxext mng modules mp3 mp4 mpeg mpi multilib ncurses nls nptl ogg openal openexr opengl openmp pam pango pcre pdf png policykit ppds profile pulseaudio qt3support qt4 readline sdl session spell sse sse2 sse3 sse4_1 sse4_2 ssl ssse3 startup-notification svg tcpd theora threads tiff truetype udev udisks unicode upower usb v4l vaapi vim-syntax vorbis vpx webkit wxwidgets x264 xcb xft xml xv xvid xvmc zlib zsh-completion" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="ru en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="intel i965" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 5 Chí-Thanh Christopher Nguyễn gentoo-dev 2014-11-02 17:35:15 UTC
*** Bug 527634 has been marked as a duplicate of this bug. ***
Comment 6 Piotr Karbowski (RETIRED) gentoo-dev 2015-01-04 20:21:09 UTC
Hi,

Can the status be changed to confirmed? The xinit-1.3.4 is masked already, which kinda confirms this bug.
Comment 7 Chí-Thanh Christopher Nguyễn gentoo-dev 2015-02-08 18:29:57 UTC
While not the most elegant solution, xinit-1.3.4-r1 now has a systemd USE flag for conditional patching of xinit. 

+  08 Feb 2015; Chí-Thanh Christopher Nguyễn <chithanh@gentoo.org>
+  +files/xinit-1.3.4-startx-current-vt.patch, +xinit-1.3.4-r1.ebuild:
+  conditionally revert upstream patch that broke startx on non-systemd systems,
+  bug #526802.
+

(In reply to Piotr Karbowski from comment #6)
The CONFIRMED/UNCONFIRMED status is mostly disregarded and does not affect the handling of this bug in any way.