[6553] in RedHat Linux List
Re: ps axf
daemon@ATHENA.MIT.EDU (Wojtek Pilorz)
Thu Nov 28 02:49:42 1996
Date: Thu, 28 Nov 1996 08:49:16 +0100 (MET)
From: Wojtek Pilorz <wpilorz@celebris.bdk.lublin.pl>
To: Gabriel Akos <gabriel@rocker.sch.bme.hu>
Cc: Robert Hart <hartr@interweft.com.au>, RedHat List <redhat-list@redhat.com>,
Piete.Brooks@cl.cam.ac.uk
In-Reply-To: <Pine.LNX.3.95.961127154541.24245A-100000@rocker.sch.bme.hu>
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com
On Wed, 27 Nov 1996, Gabriel Akos wrote:
> Date: Wed, 27 Nov 1996 15:46:46 +0100 (MET)
> From: Gabriel Akos <gabriel@rocker.sch.bme.hu>
> To: Robert Hart <hartr@interweft.com.au>
> Cc: RedHat List <redhat-list@redhat.com>
> Subject: Re: ps axf
>
> On Thu, 28 Nov 1996, Robert Hart wrote:
>
> > On Wed, 27 Nov 1996, Gabriel Akos wrote:
> >
> > > Hi!
> > >
> > > If I issue that command, I get a segmentation fault... Why?
> > > I have Colgate installed...
> > > Where is the fix?
> >
> > Hmmm
> >
> > ps -axf (and 'ps axf')
> >
> > works just fine here on Red Hat 4 - are you sure you have all the
> > updates installed?
>
> How many processes do you have?
> I had trouble only >64 processes... try it around 70...
> And if works, please send me yor output of:
> rpm -qa|grep ps
>
> Thanks!
>
> Udv:
>
> Gabriel Akos http://www.sch.bme.hu/~gabriel
>
> Tried to do some good for somebody today?
>
Yes, Yes, there is a bug in ps!!
It fails for me too, when I have more than 64 processes
(I tried with 68).
There was a patch sent to this list some time ago;
I haven't seen that, but it is quoted in a later mail that I have saved;
Here it is:
-----------------------------------------------------------------------
From: "Mick Ghazey" <mghazey@miso.lowdown.com>
To: redhat-list@redhat.com
Date: Tue, 19 Nov 1996 02:14:13 +0000
Mime-Version: 1.0
Content-Type: text/plain;
charset=US-ASCII
Content-Transfer-Encoding: 7BIT
Subject: RPM to fix procps bug?
Reply-To: mGhazey@lowdown.com
Ps has a bug if there are more than 64 processes running and the "f"
flag is used. Krzysztof Halasa posted a fix to the source code.
Unfortunately I wasn't able to compile it because I'm missing one of
the required files.
Would some kind person please create an RPM?
On Nov. 15, 1996 Krzysztof Halasa <khc@hq.pm.waw.pl> wrote:
------------------------
Hi,
There is a bug in procps-1.01 ps.c file. ps segfaults when launched
with "-axf" ("f" is important) on system with more than 64 processes.
Hand-made fix follows (file ps.c):
void add_node(char *s, proc_t *task) {
if (maxnodes == 0) {
maxnodes = 64;
node = (struct tree_node *)
malloc(sizeof(struct tree_node) * maxnodes);
}
- if (nodes > maxnodes) {
+ if (nodes >= maxnodes) {
maxnodes *= 2;
node = (struct tree_node *)
realloc(node, sizeof(struct tree_node) * maxnodes);
}
node[nodes].proc = task;
node[nodes].pid = task->pid;
node[nodes].ppid = task->ppid;
node[nodes].line = strdup(s);
node[nodes].cmd = task->cmd;
node[nodes].cmdline = task->cmdline;
node[nodes].environ = task->environ;
node[nodes].children = 0;
node[nodes].have_parent = 0;
nodes++;
}
Please reply to <khc@hq.pm.waw.pl> if required.
--
Krzysztof Halasa
Network Administrator of The Palace of Youth in Warsaw
-------------------------------------
-----------------------------------------------------------------------
I haven't tried that yet, but it seems to be
a good correction of a simple 'too far by 1' bug.
Regards,
Wojtek
Wojtek.Pilorz@bdk.lublin.pl
--
PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
________________________________________________________________________
http://www.redhat.com/RedHat-FAQ http://www.redhat.com/RedHat-Errata
http://www.redhat.com/RedHat-Tips http://www.redhat.com/mailing-lists
------------------------------------------------------------------------
To unsubscribe: mail -s unsubscribe redhat-list-request@redhat.com < /dev/null