Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jan 2002 15:41:32 -0800
From:      Peter Wemm <peter@wemm.org>
To:        Bernd Walter <ticso@cicely8.cicely.de>
Cc:        Steve Price <steve@havk.org>, alpha@FreeBSD.ORG
Subject:   Re: ps(1) output Q 
Message-ID:  <20020131234132.18F293809@overcee.wemm.org>
In-Reply-To: <20020131103128.GA6082@cicely8.cicely.de> 

next in thread | previous in thread | raw e-mail | index | archive | help
Bernd Walter wrote:
> On Wed, Jan 30, 2002 at 10:00:15PM -0600, Steve Price wrote:
> > Here's a really stupid question but something I've wondered for a long
> > time.  Why is it that the output of ps(1) on the Alpha always looks like
> > this?
> > 
> >   PID  TT  STAT      TIME COMMAND
> > 77337  p0  Ss     0:00.21  (csh)
> > 78179  p0  R+     0:00.00  (ps)
> 
> You can't access the remaining process informations, either by
> permission or if the process is swapped.

It's a 64 bit long/int bug on RELENG_4.

> > While on the x86 it look like this?
> > 
> >   PID  TT  STAT      TIME COMMAND
> > 80796  p0  Is+    0:00.04 zsh
> > 14534  r5  I+     3:48.99 mutt -y
> 
> Put some mmeory load on the host or look at process from other users
> and you will see this too.

Not with the ps args cache stuff in 4.x and beyond.  (assuming the bug is
fixed).

beast.freebsd.org (running 5.x) works as expected:
peter@beast[3:36pm]~-103> mount | grep /proc
peter@beast[3:36pm]~-104> ps -ax 
  PID  TT  STAT      TIME COMMAND
...
   30  ??  IL     0:02.98  (nfsiod 3)
  162  ??  Ss     0:38.91 /usr/sbin/syslogd -s
  166  ??  Ss     8:21.62 ntpd -p /var/run/ntpd.pid
  168  ??  Is     0:00.09 /usr/sbin/rpcbind
  170  ??  Is     1:24.82 ypbind
  176  ??  Ss   105:46.87 amd -p -a /.amd_mnt -l syslog /host /etc/amd.map /net
  180  ??  Ss     2:27.50 rwhod
  185  ??  Ss     1:17.82 /usr/sbin/cron
...

Whereas on 4.x:

peter@axp0[3:39pm]~-1# umount /proc
peter@axp0[3:39pm]~-2# ps -ax -Upeter
  PID  TT  STAT      TIME COMMAND
  338  p0  IWs    0:00.00  (tcsh)
  365  p1  IWs    0:00.00  (tcsh)
  386  p2  IWs    0:00.00  (tcsh)
43639  p3  Ss     0:00.15  (tcsh)
 1243  p4  IWs    0:00.00  (tcsh)
peter@axp0[3:39pm]~-3# mount -t procfs /proc /proc
peter@axp0[3:39pm]~-4# ps -ax -Upeter
  PID  TT  STAT      TIME COMMAND
  338  p0  IWs    0:00.00 -tcsh (tcsh)
  365  p1  IWs    0:00.00 -tcsh (tcsh)
  386  p2  IWs    0:00.00 -tcsh (tcsh)
43639  p3  Is     0:00.15 -tcsh (tcsh)
 1243  p4  IWs    0:00.00 -tcsh (tcsh)

/bin/ps is no longer setgid, so it cannot read /proc/*/mem for other
users on alpha.  That explains why you see that quirk.

/proc/*/mem is associated with lockups from a long while back.  We should
not depend on it.

Cheers,
-Peter
--
Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au
"All of this is for nothing if we don't go to the stars" - JMS/B5


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020131234132.18F293809>