Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 May 2002 05:50:07 -0700 (PDT)
From:      Edwin Groothuis <edwin@mavetju.org>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/37702: /usr/bin/top uses 100% cpu in 'system'
Message-ID:  <200205031250.g43Co7H79157@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/37702; it has been noted by GNATS.

From: Edwin Groothuis <edwin@mavetju.org>
To: Avleen Vig <lists-sendpr@silverwraith.com>
Cc: bug-followup@FreeBSD.org
Subject: Re: bin/37702: /usr/bin/top uses 100% cpu in 'system'
Date: Fri, 3 May 2002 22:47:44 +1000

 On Fri, May 03, 2002 at 09:33:13AM -0000, Avleen Vig wrote:
 > >How-To-Repeat:
 > Run: 'top -s -o size'. I don't recommend doing this on a heavily
 > loaded box straight away. Try it on your desktop. You can still
 > quit top easily with the 'q' key.
 > 
 > >Fix:
 > Unknown
 
 Problem is that the handling of arguments is a little bit broken.
 For 4.5, the patch would be:
 
 --- /usr/src/contrib/top/top.c.old   Fri May  3 22:38:48 2002
 +++ /usr/src/contrib/top/top.c       Fri May  3 22:39:14 2002
 @@ -317,10 +317,10 @@
                 break;
  
               case 's':
 -               if ((delay = atoi(optarg)) < 0)
 +               if ((delay = atoi(optarg)) <= 0)
                 {
                     fprintf(stderr,
 -                       "%s: warning: seconds delay should be non-negative -- using default\n",
 +                       "%s: warning: seconds delay should be postive -- using default\n",
                         myname);
                     delay = Default_DELAY;
                     warnings++;
 
 With this information a similair patch for -current would be easy to make.
 
 The handling of the fact that the integer value of "size" is
 translated into 0 and is displaying zero lines of process-output
 is not tackled by this, since people might want to display zero
 processes and have only the summary.
 
 Edwin
 
 -- 
 Edwin Groothuis      |           Personal website: http://www.MavEtJu.org
 edwin@mavetju.org    |        Interested in MUDs? Visit Fatal Dimensions:
 bash$ :(){ :|:&};:   |                    http://www.FatalDimensions.org/

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




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