Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 19849 - pstree segfaults
Summary: pstree segfaults
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: Brandon Low (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-23 15:45 UTC by Drew Folta
Modified: 2003-07-29 19:02 UTC (History)
0 users

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 Drew Folta 2003-04-23 15:45:35 UTC
pstree (as part of sys-apps/psmisc) segfaults when I give it a username and run
it as a user.

(In these examples, "drew" is a user on my system).

Logged in as a user, this fails:
$ pstree drew

Logged in as a user, these succeed:
$ pstree
$ pstree 27946

Logged in as root, these succeed:
$ pstree
$ pstree 27946
$ pstree drew

Here's the output of 'emerge info sys-apps/psmisc':

Portage 2.0.47-r10 (default-x86-1.4, gcc-3.2.2, glibc-2.3.1-r4)
=================================================================
System uname: 2.4.20-gentoo-r2 i686 Intel(R) Pentium(R) III CPU family      1133MHz
GENTOO_MIRRORS="http://gentoo.oregonstate.edu/
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config
/usr/kde/2/share/config /usr/kde/3/share/config /opt/tomcat/conf"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
PORTDIR="/usr/portage"
DISTDIR="/usr/portage/distfiles"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR_OVERLAY=""
USE="x86 3dnow apm crypt cups encode libg++ mmx ncurses spell xml2 zlib gdbm
berkdb slang readline java gpm tcpd pam libwww ssl python snmp -arts -avi cdr
-gif -gnome -gtk imap -imlib innodb ipv6 -jpeg junit -kde maildir -mikmod -motif
-mpeg mysql -nls odbc -oggvorbis -opengl -oss -pdflib perl -png -qt -quicktime
-sdl sse -svga -truetype -X -xmms -xv"
COMPILER="gcc3"
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -O3 -pipe -mfpmath=sse -falign-functions=4"
CXXFLAGS="-march=pentium3 -O3 -pipe -mfpmath=sse -falign-functions=4"
ACCEPT_KEYWORDS="x86"
MAKEOPTS="-j2"
AUTOCLEAN="yes"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
FEATURES="sandbox ccache"
Comment 1 Drew Folta 2003-04-23 15:56:00 UTC
This is with version 21.2-r1 of sys-apps/psmisc.
Comment 2 Brandon Low (RETIRED) gentoo-dev 2003-04-24 19:20:33 UTC
Hrm, worked OK here... I'm going to test a few things to see if it might be a cflags issue of some sort.
Comment 3 Brandon Low (RETIRED) gentoo-dev 2003-04-24 19:23:36 UTC
Nope, with a superset of your flags and mine, and with no cflags it still worked fine here
Comment 4 Sven Vermeulen (RETIRED) gentoo-dev 2003-04-25 03:34:03 UTC
Drew: run a "strace pstree drew" and give us the last dozen lines, perhaps that'll help us define where the problem is situated.
Comment 5 Drew Folta 2003-04-25 09:48:25 UTC
read(4, "19463 (strace) S 17477 19463 174"..., 8192) = 207
read(4, "", 4096)                       = 0
close(4)                                = 0
munmap(0x41093000, 4096)                = 0
open("/proc/19464/stat", O_RDONLY|O_LARGEFILE) = 4
stat64("/proc/19464", {st_mode=S_IFDIR|0500, st_size=0, ...}) = 0
fstat64(4, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x41093000
read(4, "19464 (pstree) R 19463 19463 174"..., 8192) = 188
read(4, "", 4096)                       = 0
close(4)                                = 0
munmap(0x41093000, 4096)                = 0
getdents64(0x3, 0x804c588, 0x2000, 0x19) = 0
close(3)                                = 0
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++
Comment 6 Drew Folta 2003-04-25 09:54:58 UTC
Hmm... heres a backtrace from gdb.  It might be useful even though there are no debugging symbols:

#0  0x08049ab7 in strcpy ()
#1  0x3ea94af3 in ?? ()
#2  0x0804a57a in strcpy ()
#3  0x42b94dc4 in __libc_start_main () from /lib/libc.so.6

Comment 7 Brandon Low (RETIRED) gentoo-dev 2003-04-27 14:41:40 UTC
do you happen to use grsecurity or other special kernel security features?
Comment 8 Drew Folta 2003-05-01 10:52:58 UTC
Yes, quite a few of them.  From /proc/config:

CONFIG_GRKERNSEC=y
CONFIG_GRKERNSEC_CUSTOM=y
CONFIG_GRKERNSEC_PAX_ASLR=y
CONFIG_GRKERNSEC_PAX_RANDMMAP=y
CONFIG_GRKERNSEC_IO=y
CONFIG_GRKERNSEC_PROC_MEMMAP=y
CONFIG_GRKERNSEC_ACL_MAXTRIES=3
CONFIG_GRKERNSEC_ACL_TIMEOUT=30
CONFIG_GRKERNSEC_PROC=y
CONFIG_GRKERNSEC_PROC_USER=y
CONFIG_GRKERNSEC_PROC_ADD=y
CONFIG_GRKERNSEC_LINK=y
CONFIG_GRKERNSEC_FIFO=y
CONFIG_GRKERNSEC_CHROOT=y
CONFIG_GRKERNSEC_CHROOT_MOUNT=y
CONFIG_GRKERNSEC_CHROOT_DOUBLE=y
CONFIG_GRKERNSEC_CHROOT_PIVOT=y
CONFIG_GRKERNSEC_CHROOT_CHDIR=y
CONFIG_GRKERNSEC_CHROOT_CHMOD=y
CONFIG_GRKERNSEC_CHROOT_FCHDIR=y
CONFIG_GRKERNSEC_CHROOT_MKNOD=y
CONFIG_GRKERNSEC_CHROOT_SHMAT=y
CONFIG_GRKERNSEC_CHROOT_UNIX=y
CONFIG_GRKERNSEC_CHROOT_FINDTASK=y
CONFIG_GRKERNSEC_CHROOT_NICE=y
CONFIG_GRKERNSEC_CHROOT_SYSCTL=y
CONFIG_GRKERNSEC_CHROOT_CAPS=y
CONFIG_GRKERNSEC_RESLOG=y
CONFIG_GRKERNSEC_AUDIT_MOUNT=y
CONFIG_GRKERNSEC_SIGNAL=y
CONFIG_GRKERNSEC_TIME=y
CONFIG_GRKERNSEC_DMESG=y
CONFIG_GRKERNSEC_RANDPID=y
CONFIG_GRKERNSEC_RANDNET=y
CONFIG_GRKERNSEC_RANDISN=y
CONFIG_GRKERNSEC_RANDID=y
CONFIG_GRKERNSEC_RANDSRC=y
CONFIG_GRKERNSEC_RANDRPC=y
CONFIG_GRKERNSEC_RANDPING=y
CONFIG_GRKERNSEC_SYSCTL=y
CONFIG_GRKERNSEC_FLOODTIME=10
CONFIG_GRKERNSEC_FLOODBURST=4
Comment 9 Drew Folta 2003-06-02 19:20:54 UTC
I just upgraded to the lasted stable version (3.1.8) and it's still segfaulting in the same way.
Comment 10 Drew Folta 2003-07-29 19:02:19 UTC
Hmm... this appears to be working now, using sys-apps/psmisc-21.2-r2.  I'm not sure when this got fixed, or what fixed it, though.