Re: 11.1-RELEASE: new line containing garbage added to "top"

2017-07-28 Thread Peter

Glen Barber wrote:

On Fri, Jul 28, 2017 at 07:04:51PM +0200, Peter wrote:

Glen Barber wrote:

On Fri, Jul 28, 2017 at 03:24:50PM +0200, Peter wrote:

After upgrading to 11.1-RELEASE, a new line appears in the output of "top"
which contains rubbish:


last pid: 10789;  load averages:  5.75,  5.19,  3.89up 0+00:34:46 03:23:51
1030 processes:9 running, 1004 sleeping, 17 waiting
CPU 0: 16.0% user,  0.0% nice, 78.7% system,  4.9% interrupt,  0.4% idle
CPU 1:  8.0% user,  0.0% nice, 82.5% system,  9.1% interrupt,  0.4% idle
Mem: 218M Active, 34M Inact, 105M Laundry, 600M Wired, 18M Buf, 34M Free
ARC: 324M Total, 54M MFU, 129M MRU, 2970K Anon, 13M Header, 125M Other
 136¿176M Compress185 194M Uncompressed361.94:1 Ratio
Swap: 2441M Total, 277M Used, 2164M Free, 11% Inuse



  PID USERNAME   PRI NICE   SIZERES STATE   C   TIMEWCPU COMMAND

..


That looks funny. But I dont like it.



It appears to be fixed in 11-STABLE (r321419).

Glen



I don't think so. At least there is nothing in the commitlog. r318449 is the
last commit in 11-STABLE for the respective file; and thats before the
11.1-RELEASE branch.



See r321419.



Yes, thats the issue with the empty line when ZFS is *not* in use, which 
I mentioned below (bug #220996). For that a fix is committed.




The error is in the screen-formatting in "top", and that error was already
present back in 1997 (and probably earlier), and it is also present in HEAD.

What "top" does is basically this:


char *string = some_buffer_to_print;
printf("%.5s", [-4]);


A negative index on a string usually yields a nullified area. (Except if
otherwise *eg*) Thats why we usually don't see the matter - nullbytes are
invisible on screen.

Fix is very simple:

Index: contrib/top/display.c
===
--- display.c   (revision 321434)
+++ display.c   (working copy)
@@ -1310,7 +1310,7 @@
cursor_on_line = Yes;
putchar(ch);
*old = ch;
-   lastcol = 1;
+   lastcol++;
 }
 old++;


-
Then, since I was at it, I decided to beautify the proc display as well, as
I usually see >1000 procs:


--- display.c   (revision 321434)
+++ display.c   (working copy)
@@ -100,7 +100,7 @@
 int  y_loadave =   0;
 int  x_procstate = 0;
 int  y_procstate = 1;
-int  x_brkdn = 15;
+int  x_brkdn = 16;
 int  y_brkdn = 1;
 int  x_mem =   5;
 int  y_mem =   3;
@@ -373,9 +373,9 @@
 printf("%d processes:", total);
 ltotal = total;

-/* put out enough spaces to get to column 15 */
+/* put out enough spaces to get to column 16 */
 i = digits(total);
-while (i++ < 4)
+while (i++ < 5)
 {
putchar(' ');
 }



Then, concerning the complaint about the empty line (bug #220996), I
couldn't really reproduce this. But it seems that specifically this issue
was already fixed in HEAD by this one here:
https://reviews.freebsd.org/D11693


Now, can anybody make the above snippets appear in HEAD and 11-STABLE?



I've CC'd allanjude, who has touched some of these in the past.


Thanks a lot!
___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: 11.1-RELEASE: new line containing garbage added to "top"

2017-07-28 Thread Glen Barber
On Fri, Jul 28, 2017 at 07:04:51PM +0200, Peter wrote:
> Glen Barber wrote:
> > On Fri, Jul 28, 2017 at 03:24:50PM +0200, Peter wrote:
> > > After upgrading to 11.1-RELEASE, a new line appears in the output of "top"
> > > which contains rubbish:
> > > 
> > > > last pid: 10789;  load averages:  5.75,  5.19,  3.89up 0+00:34:46 
> > > > 03:23:51
> > > > 1030 processes:9 running, 1004 sleeping, 17 waiting
> > > > CPU 0: 16.0% user,  0.0% nice, 78.7% system,  4.9% interrupt,  0.4% idle
> > > > CPU 1:  8.0% user,  0.0% nice, 82.5% system,  9.1% interrupt,  0.4% idle
> > > > Mem: 218M Active, 34M Inact, 105M Laundry, 600M Wired, 18M Buf, 34M Free
> > > > ARC: 324M Total, 54M MFU, 129M MRU, 2970K Anon, 13M Header, 125M Other
> > > >  136¿176M Compress185 194M Uncompressed361.94:1 Ratio
> > > > Swap: 2441M Total, 277M Used, 2164M Free, 11% Inuse
> > > 
> > > >   PID USERNAME   PRI NICE   SIZERES STATE   C   TIMEWCPU COMMAND
> > > ..
> > > 
> > > 
> > > That looks funny. But I dont like it.
> > > 
> > 
> > It appears to be fixed in 11-STABLE (r321419).
> > 
> > Glen
> > 
> 
> I don't think so. At least there is nothing in the commitlog. r318449 is the
> last commit in 11-STABLE for the respective file; and thats before the
> 11.1-RELEASE branch.
> 

See r321419.

> The error is in the screen-formatting in "top", and that error was already
> present back in 1997 (and probably earlier), and it is also present in HEAD.
> 
> What "top" does is basically this:
> 
> > char *string = some_buffer_to_print;
> > printf("%.5s", [-4]);
> 
> A negative index on a string usually yields a nullified area. (Except if
> otherwise *eg*) Thats why we usually don't see the matter - nullbytes are
> invisible on screen.
> 
> Fix is very simple:
> 
> Index: contrib/top/display.c
> ===
> --- display.c   (revision 321434)
> +++ display.c   (working copy)
> @@ -1310,7 +1310,7 @@
> cursor_on_line = Yes;
> putchar(ch);
> *old = ch;
> -   lastcol = 1;
> +   lastcol++;
>  }
>  old++;
> 
> 
> -
> Then, since I was at it, I decided to beautify the proc display as well, as
> I usually see >1000 procs:
> 
> 
> --- display.c   (revision 321434)
> +++ display.c   (working copy)
> @@ -100,7 +100,7 @@
>  int  y_loadave =   0;
>  int  x_procstate = 0;
>  int  y_procstate = 1;
> -int  x_brkdn = 15;
> +int  x_brkdn = 16;
>  int  y_brkdn = 1;
>  int  x_mem =   5;
>  int  y_mem =   3;
> @@ -373,9 +373,9 @@
>  printf("%d processes:", total);
>  ltotal = total;
> 
> -/* put out enough spaces to get to column 15 */
> +/* put out enough spaces to get to column 16 */
>  i = digits(total);
> -while (i++ < 4)
> +while (i++ < 5)
>  {
> putchar(' ');
>  }
> 
> 
> 
> Then, concerning the complaint about the empty line (bug #220996), I
> couldn't really reproduce this. But it seems that specifically this issue
> was already fixed in HEAD by this one here:
> https://reviews.freebsd.org/D11693
> 
> 
> Now, can anybody make the above snippets appear in HEAD and 11-STABLE?
> 

I've CC'd allanjude, who has touched some of these in the past.

Glen



signature.asc
Description: PGP signature


Re: 11.1-RELEASE: new line containing garbage added to "top"

2017-07-28 Thread Peter

Glen Barber wrote:

On Fri, Jul 28, 2017 at 03:24:50PM +0200, Peter wrote:

After upgrading to 11.1-RELEASE, a new line appears in the output of "top"
which contains rubbish:


last pid: 10789;  load averages:  5.75,  5.19,  3.89up 0+00:34:46 03:23:51
1030 processes:9 running, 1004 sleeping, 17 waiting
CPU 0: 16.0% user,  0.0% nice, 78.7% system,  4.9% interrupt,  0.4% idle
CPU 1:  8.0% user,  0.0% nice, 82.5% system,  9.1% interrupt,  0.4% idle
Mem: 218M Active, 34M Inact, 105M Laundry, 600M Wired, 18M Buf, 34M Free
ARC: 324M Total, 54M MFU, 129M MRU, 2970K Anon, 13M Header, 125M Other
 136¿176M Compress185 194M Uncompressed361.94:1 Ratio
Swap: 2441M Total, 277M Used, 2164M Free, 11% Inuse



  PID USERNAME   PRI NICE   SIZERES STATE   C   TIMEWCPU COMMAND

..


That looks funny. But I dont like it.



It appears to be fixed in 11-STABLE (r321419).

Glen



I don't think so. At least there is nothing in the commitlog. r318449 is 
the last commit in 11-STABLE for the respective file; and thats before 
the 11.1-RELEASE branch.


The error is in the screen-formatting in "top", and that error was 
already present back in 1997 (and probably earlier), and it is also 
present in HEAD.


What "top" does is basically this:

> char *string = some_buffer_to_print;
> printf("%.5s", [-4]);

A negative index on a string usually yields a nullified area. (Except if 
otherwise *eg*) Thats why we usually don't see the matter - nullbytes 
are invisible on screen.


Fix is very simple:

Index: contrib/top/display.c
===
--- display.c   (revision 321434)
+++ display.c   (working copy)
@@ -1310,7 +1310,7 @@
cursor_on_line = Yes;
putchar(ch);
*old = ch;
-   lastcol = 1;
+   lastcol++;
 }
 old++;


-
Then, since I was at it, I decided to beautify the proc display as well, 
as I usually see >1000 procs:



--- display.c   (revision 321434)
+++ display.c   (working copy)
@@ -100,7 +100,7 @@
 int  y_loadave =   0;
 int  x_procstate = 0;
 int  y_procstate = 1;
-int  x_brkdn = 15;
+int  x_brkdn = 16;
 int  y_brkdn = 1;
 int  x_mem =   5;
 int  y_mem =   3;
@@ -373,9 +373,9 @@
 printf("%d processes:", total);
 ltotal = total;

-/* put out enough spaces to get to column 15 */
+/* put out enough spaces to get to column 16 */
 i = digits(total);
-while (i++ < 4)
+while (i++ < 5)
 {
putchar(' ');
 }



Then, concerning the complaint about the empty line (bug #220996), I 
couldn't really reproduce this. But it seems that specifically this 
issue was already fixed in HEAD by this one here: 
https://reviews.freebsd.org/D11693



Now, can anybody make the above snippets appear in HEAD and 11-STABLE?

___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: 11.1-RELEASE: new line containing garbage added to "top"

2017-07-28 Thread Peter

Glen Barber wrote:

On Fri, Jul 28, 2017 at 03:24:50PM +0200, Peter wrote:

After upgrading to 11.1-RELEASE, a new line appears in the output of "top"
which contains rubbish:


last pid: 10789;  load averages:  5.75,  5.19,  3.89up 0+00:34:46

03:23:51

1030 processes:9 running, 1004 sleeping, 17 waiting
CPU 0: 16.0% user,  0.0% nice, 78.7% system,  4.9% interrupt,  0.4% idle
CPU 1:  8.0% user,  0.0% nice, 82.5% system,  9.1% interrupt,  0.4% idle
Mem: 218M Active, 34M Inact, 105M Laundry, 600M Wired, 18M Buf, 34M Free
ARC: 324M Total, 54M MFU, 129M MRU, 2970K Anon, 13M Header, 125M Other
 136¿176M Compress185 194M Uncompressed361.94:1 Ratio
Swap: 2441M Total, 277M Used, 2164M Free, 11% Inuse



  PID USERNAME   PRI NICE   SIZERES STATE   C   TIMEWCPU COMMAND

..


That looks funny. But I dont like it.

(Actually it looks like a wrong TERMCAP, but wasn't that ~20 years ago?
checking...)


Do you mean the blank line between the 'Swap:' line and 'PID'?

If so, that has been there as long as I can recall.  It is used for
things like killing processes, etc.  (Hit 'k' when using top(1), and you
will see a prompt for a PID to kill.)

Glen



No, I mean the line *above* the 'Swap:' line, which is new and
*should* show compressed arc stats. (What we actually see there is
the printing of a random memory location - working on it...)
___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: 11.1-RELEASE: new line containing garbage added to "top"

2017-07-28 Thread Glen Barber
On Fri, Jul 28, 2017 at 03:24:50PM +0200, Peter wrote:
> After upgrading to 11.1-RELEASE, a new line appears in the output of "top"
> which contains rubbish:
> 
> > last pid: 10789;  load averages:  5.75,  5.19,  3.89up 0+00:34:46 
> > 03:23:51
> > 1030 processes:9 running, 1004 sleeping, 17 waiting
> > CPU 0: 16.0% user,  0.0% nice, 78.7% system,  4.9% interrupt,  0.4% idle
> > CPU 1:  8.0% user,  0.0% nice, 82.5% system,  9.1% interrupt,  0.4% idle
> > Mem: 218M Active, 34M Inact, 105M Laundry, 600M Wired, 18M Buf, 34M Free
> > ARC: 324M Total, 54M MFU, 129M MRU, 2970K Anon, 13M Header, 125M Other
> >  136¿176M Compress185 194M Uncompressed361.94:1 Ratio
> > Swap: 2441M Total, 277M Used, 2164M Free, 11% Inuse
> 
> >   PID USERNAME   PRI NICE   SIZERES STATE   C   TIMEWCPU COMMAND
> ..
> 
> 
> That looks funny. But I dont like it.
> 

It appears to be fixed in 11-STABLE (r321419).

Glen



signature.asc
Description: PGP signature


Re: 11.1-RELEASE: new line containing garbage added to "top"

2017-07-28 Thread Brandon Allbery
On Fri, Jul 28, 2017 at 10:17 AM, Glen Barber  wrote:

> > > ARC: 324M Total, 54M MFU, 129M MRU, 2970K Anon, 13M Header, 125M Other
> > >  136¿176M Compress185 194M Uncompressed361.94:1 Ratio
> > > Swap: 2441M Total, 277M Used, 2164M Free, 11% Inuse
> >
> > >   PID USERNAME   PRI NICE   SIZERES STATE   C   TIMEWCPU
> COMMAND
>
> Do you mean the blank line between the 'Swap:' line and 'PID'?
>

I assumed it meant the second line of the ARC summary, which has some
missing and/or wrong separators? ("¿"?)
(Presumably the (missing, there) ARC summary is also the source of the
extraneous blank line reported later.)

-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net
___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"

Re: 11.1-RELEASE: new line containing garbage added to "top"

2017-07-28 Thread Jov
This is another problem I find on top with extra new line:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220996

Jov

2017年7月28日 10:18 PM,"Glen Barber" 写道:

> On Fri, Jul 28, 2017 at 03:24:50PM +0200, Peter wrote:
> > After upgrading to 11.1-RELEASE, a new line appears in the output of
> "top"
> > which contains rubbish:
> >
> > > last pid: 10789;  load averages:  5.75,  5.19,  3.89up 0+00:34:46
> > 03:23:51
> > > 1030 processes:9 running, 1004 sleeping, 17 waiting
> > > CPU 0: 16.0% user,  0.0% nice, 78.7% system,  4.9% interrupt,  0.4%
> idle
> > > CPU 1:  8.0% user,  0.0% nice, 82.5% system,  9.1% interrupt,  0.4%
> idle
> > > Mem: 218M Active, 34M Inact, 105M Laundry, 600M Wired, 18M Buf, 34M
> Free
> > > ARC: 324M Total, 54M MFU, 129M MRU, 2970K Anon, 13M Header, 125M Other
> > >  136¿176M Compress185 194M Uncompressed361.94:1 Ratio
> > > Swap: 2441M Total, 277M Used, 2164M Free, 11% Inuse
> >
> > >   PID USERNAME   PRI NICE   SIZERES STATE   C   TIMEWCPU
> COMMAND
> > ..
> >
> >
> > That looks funny. But I dont like it.
> >
> > (Actually it looks like a wrong TERMCAP, but wasn't that ~20 years ago?
> > checking...)
>
> Do you mean the blank line between the 'Swap:' line and 'PID'?
>
> If so, that has been there as long as I can recall.  It is used for
> things like killing processes, etc.  (Hit 'k' when using top(1), and you
> will see a prompt for a PID to kill.)
>
> Glen
>
>
___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"

Re: 11.1-RELEASE: new line containing garbage added to "top"

2017-07-28 Thread Glen Barber
On Fri, Jul 28, 2017 at 03:24:50PM +0200, Peter wrote:
> After upgrading to 11.1-RELEASE, a new line appears in the output of "top"
> which contains rubbish:
> 
> > last pid: 10789;  load averages:  5.75,  5.19,  3.89up 0+00:34:46
> 03:23:51
> > 1030 processes:9 running, 1004 sleeping, 17 waiting
> > CPU 0: 16.0% user,  0.0% nice, 78.7% system,  4.9% interrupt,  0.4% idle
> > CPU 1:  8.0% user,  0.0% nice, 82.5% system,  9.1% interrupt,  0.4% idle
> > Mem: 218M Active, 34M Inact, 105M Laundry, 600M Wired, 18M Buf, 34M Free
> > ARC: 324M Total, 54M MFU, 129M MRU, 2970K Anon, 13M Header, 125M Other
> >  136¿176M Compress185 194M Uncompressed361.94:1 Ratio
> > Swap: 2441M Total, 277M Used, 2164M Free, 11% Inuse
> 
> >   PID USERNAME   PRI NICE   SIZERES STATE   C   TIMEWCPU COMMAND
> ..
> 
> 
> That looks funny. But I dont like it.
> 
> (Actually it looks like a wrong TERMCAP, but wasn't that ~20 years ago?
> checking...)

Do you mean the blank line between the 'Swap:' line and 'PID'?

If so, that has been there as long as I can recall.  It is used for
things like killing processes, etc.  (Hit 'k' when using top(1), and you
will see a prompt for a PID to kill.)

Glen



signature.asc
Description: PGP signature


11.1-RELEASE: new line containing garbage added to "top"

2017-07-28 Thread Peter
After upgrading to 11.1-RELEASE, a new line appears in the output of 
"top" which contains rubbish:


> last pid: 10789;  load averages:  5.75,  5.19,  3.89up 0+00:34:46 
03:23:51

> 1030 processes:9 running, 1004 sleeping, 17 waiting
> CPU 0: 16.0% user,  0.0% nice, 78.7% system,  4.9% interrupt,  0.4% idle
> CPU 1:  8.0% user,  0.0% nice, 82.5% system,  9.1% interrupt,  0.4% idle
> Mem: 218M Active, 34M Inact, 105M Laundry, 600M Wired, 18M Buf, 34M Free
> ARC: 324M Total, 54M MFU, 129M MRU, 2970K Anon, 13M Header, 125M Other
>  136¿176M Compress185 194M Uncompressed361.94:1 Ratio
> Swap: 2441M Total, 277M Used, 2164M Free, 11% Inuse

>   PID USERNAME   PRI NICE   SIZERES STATE   C   TIMEWCPU COMMAND
..


That looks funny. But I dont like it.

(Actually it looks like a wrong TERMCAP, but wasn't that ~20 years ago?
checking...)
___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"