[5110] in RedHat Linux List

home help back first fref pref prev next nref lref last post

RPM to fix procps bug?

daemon@ATHENA.MIT.EDU (Mick Ghazey)
Tue Nov 19 02:18:20 1996

From: "Mick Ghazey" <mghazey@miso.lowdown.com>
To: redhat-list@redhat.com
Date: Tue, 19 Nov 1996 02:14:13 +0000
Reply-to: mGhazey@lowdown.com
X-Confirm-Reading-To: mGhazey@lowdown.com
Resent-From: redhat-list@redhat.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

-------------------------------------


--
  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


home help back first fref pref prev next nref lref last post