Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 124888 - Nano memory/cpu leak in xterm
Summary: Nano memory/cpu leak in xterm
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: SpanKY
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-03 17:07 UTC by John
Modified: 2006-03-30 13:32 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John 2006-03-03 17:07:18 UTC
Hello,

There seems to be a problem with nano when run using xterm.  The problem only occurs in the superuser mode when running a windows manager as a user.  A memory/cpu leak occurs when you exit the terminal while not exiting nano first.  In this case nano runs as a "ghost" program and within 10 seconds runs up the cpu to 99%.  The only way to exit is to kill it as a superuser.

I have been unable to reproduce this using eterm (cvs), so I believe the problem lies in xterm.

Steps to reproduce:
1. open an xterm terminal in a windows manager as a user
2. su
3. nano a file
4. hit the x on the terminal
5. open a terminal and watch ps aux
Comment 1 SpanKY gentoo-dev 2006-03-05 08:36:45 UTC
you neglected to post `emerge info` ... also, what versions of nano do you have ?
Comment 2 John 2006-03-05 14:23:17 UTC
Sorry, I was planning to write a followup with my backtrace, but then I decided to reemerge glibc with nostrip and -g (REALLY BAD IDEA).  So for the past day I've been rebuilding all the libraries my computer uses.

But when I did run that backtrace I noticed that the error lies in xterm.  It said one thing about glibc, so I wanted to try and get all the unstriped libraries, but that didn't work as well as I had hoped.  I'm going to keep at it and see if I can do better than all those ??? and then one line about glibc.  Unfortunately that will have to wait a little longer while a few more things compile.

Anyway here's my emerge info:
Portage 2.0.54 (default-linux/amd64/2005.1, gcc-3.4.4, glibc-2.3.5-r0, 2.6.15-gentoo-r4 x86_64)
=================================================================
System uname: 2.6.15-gentoo-r4 x86_64 AMD Athlon(tm) 64 Processor 3200+
Gentoo Base System version 1.6.14
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/texmf/web2c /etc/env.d"
CXXFLAGS="-O2"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 X alsa audiofile avi berkdb bitmap-fonts bzip2 cdr crypt cups curl eds emboss encode exif expat fam ffmpeg flac foomaticdb fortran gdbm gif glut gnome gpm gstreamer gtk gtk2 idn imagemagick imlib ipv6 java jpeg kde lcms libwww lirc lzw lzw-tiff mad mng motif mp3 mpeg ncurses nls ogg openal opengl pam pcre pdflib perl png python qt quicktime readline scanner sdl snmp spell sqlite ssl tcpd tetex tiff truetype truetype-fonts type1-fonts udev usb userlocales vorbis xine xml2 xmms xpm xv xvid zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS, PORTDIR_OVERLAY

And the pakages installed are:
nano-1.3.10-r1 (and 1.3.9 before I updated- both with problem)
xterm-208 (and 207 before I updated- both with problem)
Comment 3 John 2006-03-05 20:30:42 UTC
Here's what I get with the backtrace of xterm.  I know it's not much, but xterm and nano are both compiled with CFLAGS -g and FEATURES nostrip.  If anyone can think of anything else that should be compiled with debugging please let me know. (minus glibc)

#0  0x00002aaaabcb1b05 in select () from /lib/libc.so.6
#1  0x000000000040f1f7 in ?? ()
#2  0x000000000040f2fb in ?? ()
#3  0x000000000040ea00 in ?? ()
#4  0x00000000004124b7 in ?? ()
#5  0x0000000000422a63 in ?? ()
#6  0x00002aaaabc1dd00 in __libc_start_main () from /lib/libc.so.6
#7  0x000000000040705a in ?? ()
#8  0x00007fffffdb52d8 in ?? ()
#9  0x000000000000001c in ?? ()
#10 0x0000000000000001 in ?? ()
#11 0x00007fffffdb684a in ?? ()
#12 0x0000000000000000 in ?? ()
Comment 4 John 2006-03-06 19:08:15 UTC
Reopening bug.
Comment 5 Thomas Dickey 2006-03-11 12:12:12 UTC
This might happen if xterm is installed setuid to root
(no easy fix for _that_).  It might also happen if the
application (nano) doesn't terminate (for instance, this
has been frequently reported for mc and screen over the
years).
Comment 6 SpanKY gentoo-dev 2006-03-29 23:35:37 UTC
nano-1.3.11 should have this issue fixed
Comment 7 John 2006-03-30 13:32:55 UTC
Thanks, this verson fixes the problem.