From owner-freebsd-stable@freebsd.org Fri Jul 28 23:13:17 2017 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31056DAA5BD for ; Fri, 28 Jul 2017 23:13:17 +0000 (UTC) (envelope-from li-fbsd@citylink.dinoex.sub.org) Received: from uucp.dinoex.sub.de (uucp.dinoex.sub.de [IPv6:2001:1440:5001:1::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "uucp.dinoex.sub.de", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A889C76407 for ; Fri, 28 Jul 2017 23:13:16 +0000 (UTC) (envelope-from li-fbsd@citylink.dinoex.sub.org) Received: from uucp.dinoex.sub.de (uucp.dinoex.sub.de [194.45.71.2]) by uucp.dinoex.sub.de (8.15.2/8.14.9) with ESMTPS id v6SND4cs060719 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sat, 29 Jul 2017 01:13:05 +0200 (CEST) (envelope-from li-fbsd@citylink.dinoex.sub.org) X-MDaemon-Deliver-To: Received: from citylink.dinoex.sub.org (uucp@localhost) by uucp.dinoex.sub.de (8.15.2/8.14.9/Submit) with UUCP id v6SND4YY060718 for freebsd-stable@FreeBSD.ORG; Sat, 29 Jul 2017 01:13:04 +0200 (CEST) (envelope-from li-fbsd@citylink.dinoex.sub.org) Received: from gate.oper.dinoex.org (gate-e [192.168.98.2]) by citylink.dinoex.sub.de (8.15.2/8.15.2) with ESMTP id v6SMPNux038503 for ; Sat, 29 Jul 2017 00:25:23 +0200 (CEST) (envelope-from li-fbsd@citylink.dinoex.sub.org) Received: from gate.oper.dinoex.org (gate-e [192.168.98.2]) by gate.oper.dinoex.org (8.15.2/8.15.2) with ESMTP id v6SMO0Z7038271 for ; Sat, 29 Jul 2017 00:24:01 +0200 (CEST) (envelope-from li-fbsd@citylink.dinoex.sub.org) Received: (from news@localhost) by gate.oper.dinoex.org (8.15.2/8.15.2/Submit) id v6SMO0Jm038269 for freebsd-stable@FreeBSD.ORG; Sat, 29 Jul 2017 00:24:00 +0200 (CEST) (envelope-from li-fbsd@citylink.dinoex.sub.org) X-Authentication-Warning: gate.oper.dinoex.org: news set sender to li-fbsd@citylink.dinoex.sub.org using -f From: Peter Subject: Re: 11.1-RELEASE: new line containing garbage added to "top" Date: Sat, 29 Jul 2017 00:13:32 +0200 Organization: even some more stinky socks Message-ID: <7c852560-987c-433c-1471-bdccd76949e2@citylink.dinoex.sub.org> References: <20170728160436.GE32551@FreeBSD.org> <20170728181859.GI32551@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: oper.dinoex.de; logging-data="36885"; mail-complaints-to="usenet@citylink.dinoex.sub.org" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:51.0) Gecko/20100101 Firefox/51.0 SeaMonkey/2.48 In-Reply-To: <20170728181859.GI32551@FreeBSD.org> Sender: li-fbsd@citylink.dinoex.sub.org To: freebsd-stable@FreeBSD.ORG X-Milter: Spamilter (Reciever: uucp.dinoex.sub.de; Sender-ip: 194.45.71.2; Sender-helo: uucp.dinoex.sub.de; ) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (uucp.dinoex.sub.de [194.45.71.2]); Sat, 29 Jul 2017 01:13:05 +0200 (CEST) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jul 2017 23:13:17 -0000 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.89 up 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 SIZE RES STATE C TIME WCPU 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", &string[-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!