misc/74506: bad top command display

Defacto defacto at cvd.pl
Mon Nov 29 02:50:29 PST 2004


>Number:         74506
>Category:       misc
>Synopsis:       bad top command display
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 29 10:50:28 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Defacto
>Release:        6.0-CURRENT
>Organization:
>Environment:
FreeBSD test.build.priv 6.0-CURRENT FreeBSD 6.0-CURRENT #14: Mon Nov 29 09:16:05 CEST 2004     root at test.build.priv:/usr/src/sys/i386/compile/WORK  i386
>Description:
      The top command displays improperly informative screen (general information lines) where on SMP systems exists in passwd user name longer than 12 chars or on non-SMP systems user name is longer than 14 chars. This applies to standard text console (80x25 chars).
>How-To-Repeat:
      On SMP system:
pw useradd 1234567890abc; top
On non-SMP system:
pw useradd 1234567890abcde; top

>Fix:
      Apply following patch on /usr/src/usr.bin/top/machine.c:

--- machine.c.org       Mon Nov 29 09:50:14 2004
+++ machine.c   Mon Nov 29 10:01:55 2004
@@ -234,10 +234,10 @@
        }
        if (namelength < 8)
                namelength = 8;
-       if (smpmode && namelength > 13)
-               namelength = 13;
-       else if (namelength > 15)
-               namelength = 15;
+       if (smpmode && namelength > 12)
+               namelength = 12;
+       else if (namelength > 14)
+               namelength = 14;

        kd = kvm_open(NULL, _PATH_DEVNULL, NULL, O_RDONLY, "kvm_open");

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list