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

Bug 328813

Summary: app-editors/emacs-23.1-r3 freezes X (nvidia driver) with KDE-4.4.4
Product: Gentoo Linux Reporter: quazgar <quazgar>
Component: [OLD] KDEAssignee: Doug Goldstein (RETIRED) <cardoe>
Status: RESOLVED TEST-REQUEST    
Severity: critical CC: emacs, x11
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Photo of emacs' scratch buffer

Description quazgar 2010-07-18 12:56:17 UTC
Since I switched (from WindowMaker) to KDE, emacs sometimes makes X freeze nearly completely, i.e. X does not react to any user input any more, only the mouse cursor is still shown moving.

Logging in via ssh from another machine shows that the X process takes up 100% CPU (fortunately on one of the 2 cores), the only solution is to kill X and restart it.

When starting emacs, the window is typically shown alright, the freezing seems to start more or less when the emacs window resizes to fit its current contents/ font size/ etc.

I think I also remember this bug happening once or twice when resizing e.g. a Konsole window, which, just like emacs, has a rather coarse grid of allowed sizes (only integer multiples of it character size).  Maybe this may be a common cause?

Reproducible: Sometimes

Steps to Reproduce:
1. Start KDE 4
2. Start emacs.
3. If nothing happens, scroll around in emacs and/or resize its window.

Actual Results:  
The X process starts to use up 100% cpu power, thus effectively freezing the computer, except the mouse which still can be moved around.

Expected Results:  
Nothing buggy should happen.

KDE: 4.4.4
xorg-server: 1.7.6
xorg-x11: 7.4-r1
nvidia-drivers: 195.36.24

My emerge --info:

Portage 2.2_rc62 (default/linux/amd64/10.0/desktop, gcc-4.4.3, glibc-2.11.2-r0, 2.6.34-gentoo-r1 x86_64)
=================================================================
System uname: Linux-2.6.34-gentoo-r1-x86_64-AMD_Athlon-tm-_X2_Dual_Core_Processor_BE-2300-with-gentoo-1.12.13
Timestamp of tree: Sun, 18 Jul 2010 09:45:02 +0000
ccache version 2.4 [enabled]
app-shells/bash:     4.0_p37
dev-java/java-config: 2.1.11
dev-lang/python:     2.6.5-r2, 3.1.2-r3
dev-util/ccache:     2.4-r7
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.65
sys-devel/automake:  1.4_p6-r1, 1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.3-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=athlon64 -msse3 "
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /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=athlon64 -msse3 "
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y"
FEATURES="assume-digests ccache distlocks fixpackages news noclean parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://de-mirror.org/distro/gentoo/ http://gentoo.supp.name/ http://gentoo.tiscali.nl/ http://gentoo.virginmedia.com/ http://gentoo.wheel.sk/ http://gentoo.mirror.pw.edu.pl/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1"
LINGUAS="en de es"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
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="/var/lib/layman/sunrise /var/lib/layman/java-overlay /usr/local/portage"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="X a52 aac aalib acl acpi aim alsa amd64 apache2 bash-completion berkdb boost branding bzip2 cairo calendar caps cddb cdr cli consolekit cracklib crypt cups cxx dbus dga directfb dri dts dv dvd dvdr emacs emboss emf encode exif fam fbcon ffmpeg fftw firefox flac foomaticdb fortran ftp gcj gd gdbm gif gimp glut gphoto2 gpm gtk gtk2 gtkhtml guile hal iconv icq icu imagemagick java javascript jikes joystick jpeg jpeg2k kde kdexdeltas kpathsea lame lcms ldap leim libcaca libnotify libwww lm_sensors mad maildir mbox mcal memlimit mikmod mime mmx mng modules mp3 mp4 mpeg msn mudflap multilib ncurses neXt networking nls nocd nptl nptlonly nsplugin offensive ogg opengl openmp oscar pam pango pcre pdf perl plotutils png ppds pppd python qt3support qt4 quicktime readline reflection rtsp samba sdl semantic-desktop session sndfile sockets sound sox speex spell spl sse sse2 ssl startup-notification svg sysfs tcpd tetex theora threads tiff timidity truetype unicode usb v4l vcd videos vorbis webkit wma wmf wxwidgets x264 xcb xft xml xmms xorg xosd xulrunner xv xvid zlib" 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" 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 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" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse aiptek" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en de es" RUBY_TARGETS="ruby18" SANE_BACKENDS="net canon plustek" USERLAND="GNU" VIDEO_CARDS="vesa vga fbdev nv nvidia" 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, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 quazgar 2010-07-18 14:00:35 UTC
It's possibly at least partly a bug in the nvidia driver (or the nvidia driver gets fed bogus data), as can be seen from these lines from Xorg.0.log correlated with the problem:

(WW) Jul 18 15:41:44 NVIDIA(0): The NVIDIA X driver has encountered too many errors.  Falling
(WW) Jul 18 15:41:44 NVIDIA(0):     back to legacy PCI mode.

Some camera shots of emacs before failing will follow.
Comment 2 quazgar 2010-07-18 14:08:32 UTC
Created attachment 239249 [details]
Photo of emacs' scratch buffer

This image shows a garbled emacs window.  It seems as if the characters' background would access the same memory as use by KDE's panel (notice the program icons clearly visible there).  I find it hard to guess if this is a cause for X freezing or maybe "just" another bug.  Also I don't know if this is the fault of the Nvidia driver, KDE (maybe plasma), QT, GTK (emacs was compiled with +gtk) or emacs itself.
Comment 3 Christian Faulhammer (RETIRED) gentoo-dev 2010-07-18 14:40:50 UTC
Could you please try with Emacs 23 and if this goes with no success with the emacs-vcs-24* ebuild?
Comment 4 quazgar 2010-07-18 22:15:18 UTC
(In reply to comment #3)
> Could you please try with Emacs 23
Which minor version of 23 did you mean?  I have 23.1-r3 installed here.

> and if this goes with no success with the
> emacs-vcs-24* ebuild?
Tried it and I can't reproduce any of the errors with that version (yet).  Is there any estimate how long 24 will take for the next stable release (a matter of few/many months/years)?

I'll also do more testing with emacs-vcs-24 and try to use Emacs 23 compiled without the gtk use flag.
Comment 5 Christian Faulhammer (RETIRED) gentoo-dev 2010-07-19 06:12:30 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Could you please try with Emacs 23
> Which minor version of 23 did you mean?  I have 23.1-r3 installed here.

 23.2 was intended.

> > and if this goes with no success with the
> > emacs-vcs-24* ebuild?
> Tried it and I can't reproduce any of the errors with that version (yet).  Is
> there any estimate how long 24 will take for the next stable release (a matter
> of few/many months/years)?

 No estimate here.  But it will be longer.  What you can do though is run the 24 version and select it as your active main version with eselect-emacs.

> I'll also do more testing with emacs-vcs-24 and try to use Emacs 23 compiled
> without the gtk use flag.

 That may be a good idea.
Comment 6 quazgar 2010-07-21 20:49:12 UTC
Some more tests and two freezes later (Alt-SysRq-... still works, fortunately) it seems that 23.2 does not help, turning off KDE compositing may be helpful, but I'll test it more.  Since this bug is not always reproducible, I cannot say I'm 100% sure it can not happen with the 24 vcs version.

One more thing:  Even after killing X and restarting /etc/init.d/xdm, some areas of the display are still garbled, looks like some deeper memory corruption to me.
Comment 7 Christian Faulhammer (RETIRED) gentoo-dev 2010-07-26 06:14:34 UTC
This is extremely hard to debug as it can happen anywhere in the graphics driver, toolkit or the application itself.  Do you have a garbled screen if you disable the gtk USE flag and build with motif (yes, I know it is ugly)?
Comment 8 quazgar 2010-07-31 15:59:11 UTC
(In reply to comment #7)
> Do you have a garbled screen if you
> disable the gtk USE flag and build with motif (yes, I know it is ugly)?

The complete freeze also happens with motif instead of gtk, at least with desktop compositing enabled.  I'll try it without compositing the next days, maybe that will allow some conclusions.
Comment 9 quazgar 2010-07-31 16:02:39 UTC
Actually it seems as if the last time, there was a "regular" X crash, unless the following messages in Xorg.1.log.old come from shutting down the machine with the Magic SysReq keys:

...
[mi] EQ overflowing. The server is probably stuck in an infinite loop.

Backtrace:
0: /usr/bin/X (xorg_backtrace+0x28) [0x49e758]
1: /usr/bin/X (mieqEnqueue+0x203) [0x49e133]
2: /usr/bin/X (xf86PostKeyEventP+0x66) [0x479276]
3: /usr/bin/X (xf86PostKeyboardEvent+0x19) [0x4792f9]
4: /usr/lib64/xorg/modules/input/evdev_drv.so (0x7fbbee6d8000+0x40d7) [0x7fbbee6dc0d7]
5: /usr/bin/X (0x400000+0x6ced7) [0x46ced7]
6: /usr/bin/X (0x400000+0x114c36) [0x514c36]
7: /lib/libpthread.so.0 (0x7fbbf371f000+0xf010) [0x7fbbf372e010]
8: /usr/lib64/xorg/modules/drivers/nvidia_drv.so (0x7fbbef420000+0x77e42) [0x7fbbef497e42]
9: /usr/lib64/xorg/modules/drivers/nvidia_drv.so (0x7fbbef420000+0xb02b9) [0x7fbbef4d02b9]
10: /usr/lib64/xorg/modules/drivers/nvidia_drv.so (0x7fbbef420000+0xb0656) [0x7fbbef4d0656]
11: /usr/lib64/xorg/modules/drivers/nvidia_drv.so (_nv002733X+0x9d) [0x7fbbef4d0c7d]
12: /usr/lib64/xorg/modules/drivers/nvidia_drv.so (_nv001056X+0x19e) [0x7fbbef498c8e]
13: /usr/lib64/xorg/modules/drivers/nvidia_drv.so (0x7fbbef420000+0xdadf6) [0x7fbbef4fadf6]
14: /usr/lib64/xorg/modules/drivers/nvidia_drv.so (0x7fbbef420000+0xdaa22) [0x7fbbef4faa22]
15: /usr/lib64/xorg/modules/drivers/nvidia_drv.so (0x7fbbef420000+0x33cfce) [0x7fbbef75cfce]
16: /usr/lib64/xorg/modules/drivers/nvidia_drv.so (0x7fbbef420000+0x340db3) [0x7fbbef760db3]
17: /usr/bin/X (0x400000+0xd413c) [0x4d413c]
18: /usr/lib64/xorg/modules/extensions/libextmod.so (0x7fbbf2122000+0xc815) [0x7fbbf212e815]
19: /usr/lib64/xorg/modules/drivers/nvidia_drv.so (0x7fbbef420000+0x2fde57) [0x7fbbef71de57]
20: /usr/bin/X (miGlyphs+0x5e6) [0x55e6e6]
21: /usr/lib64/xorg/modules/drivers/nvidia_drv.so (0x7fbbef420000+0x332473) [0x7fbbef752473]
22: /usr/bin/X (0x400000+0xd1675) [0x4d1675]
23: /usr/bin/X (0x400000+0xcbaa6) [0x4cbaa6]
24: /usr/bin/X (0x400000+0x2f634) [0x42f634]
25: /usr/bin/X (0x400000+0x2508b) [0x42508b]
26: /lib/libc.so.6 (__libc_start_main+0xfd) [0x7fbbf2571bbd]
27: /usr/bin/X (0x400000+0x24c39) [0x424c39]
Comment 10 Andreas K. Hüttel archtester gentoo-dev 2010-11-13 20:46:37 UTC
It's probably better if the x11 and nvidia people have a look at this bug then.
Comment 11 Doug Goldstein (RETIRED) gentoo-dev 2012-07-14 20:45:05 UTC
I assume newer versions have resulted in this working since there's been no further news.