NetBSD Problem Report #56014

From www@netbsd.org  Tue Feb 23 14:51:47 2021
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 7EEB61A921F
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 23 Feb 2021 14:51:47 +0000 (UTC)
Message-Id: <20210223145146.1DFDD1A9249@mollari.NetBSD.org>
Date: Tue, 23 Feb 2021 14:51:46 +0000 (UTC)
From: hashikaw@mail.ru
Reply-To: hashikaw@mail.ru
To: gnats-bugs@NetBSD.org
Subject: systat vm reports "1 users" after ^Z, fg.
X-Send-Pr-Version: www-1.0

>Number:         56014
>Category:       bin
>Synopsis:       systat vm reports "1 users" after ^Z, fg.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 23 14:55:00 +0000 2021
>Closed-Date:    Mon Dec 11 13:47:07 +0000 2023
>Last-Modified:  Mon Dec 11 13:47:07 +0000 2023
>Originator:     Kouichi Hashikawa
>Release:        NetBSD-9.99.80
>Organization:
>Environment:
NetBSD 9.99.80 (GENERIC64) #0: Sat Feb 20 22:18:32 UTC 2021
 	mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/evbarm/compile/GENERIC64

>Description:
systat vm reports "1 users" after ^Z, fg.

>How-To-Repeat:

>Fix:
--- src/usr.bin/systat/vmstat.c-dist    2020-03-02 18:50:12.000000000 +0900
+++ src/usr.bin/systat/vmstat.c 2021-02-23 14:03:50.087970983 +0900
@@ -725,19 +725,16 @@
 static int
 ucount(void)
 {
-       static int onusers = -1;
        int nusers = 0;
        struct utmpentry *ehead;

        nusers = getutentries(NULL, &ehead);

-       if (nusers != onusers) {
-               if (nusers == 1)
-                       mvprintw(STATROW, STATCOL + 8, " ");
-               else
-                       mvprintw(STATROW, STATCOL + 8, "s");
-       }
-       onusers = nusers;
+       if (nusers == 1)
+               mvprintw(STATROW, STATCOL + 8, " ");
+       else
+               mvprintw(STATROW, STATCOL + 8, "s");
+
        return (nusers);
 }


>Release-Note:

>Audit-Trail:
From: "Robert Elz" <kre@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56014 CVS commit: src/usr.bin/systat
Date: Tue, 28 Mar 2023 00:00:30 +0000

 Module Name:	src
 Committed By:	kre
 Date:		Tue Mar 28 00:00:30 UTC 2023

 Modified Files:
 	src/usr.bin/systat: vmstat.c

 Log Message:
 PR bin/56014 from Kouichi Hashikawa

 Don't try to optimise away placing the "s" or " " after "N user"
 (" " where N==1, "s" otherwise) when it seems unnecessary, as that
 fails when the number of users hasn't changed, but the screen is
 being redrawn from nothing (as in after being resumed from a ^Z,
 as in the PR, but just doing a ^L would make the same thing happen).

 XXX pullup -10 (maybe -9 as well - seems too trivial for -8).


 To generate a diff of this commit:
 cvs rdiff -u -r1.91 -r1.92 src/usr.bin/systat/vmstat.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: kre@NetBSD.org
State-Changed-When: Tue, 28 Mar 2023 00:08:17 +0000
State-Changed-Why:
Patch applied to HEAD (sorry it took 2 years to happen...)
Does that fix the problem for you?  (It was your patch!)

Pullups to -10 (perhaps -9 if it seems important enough)
will get requested after the change has baked in HEAD for
several days.


From: Kouichi Hashikawa <hashikaw@mail.ru>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: PR/56014 CVS commit: src/usr.bin/systat
Date: Sun, 10 Dec 2023 13:06:27 +0900

 Thank  you. The problem was fixed.

 >
  XXX pullup -10 (maybe -9 as well - seems too trivial for -8).
 Please pull-up to release branch.

 -- 
 Kouichi Hashikawa

State-Changed-From-To: feedback->needs-pullups
State-Changed-By: kre@NetBSD.org
State-Changed-When: Sun, 10 Dec 2023 15:40:56 +0000
State-Changed-Why:
Feedback received.   Needs pullup to -10.


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56014 CVS commit: [netbsd-10] src/usr.bin/systat
Date: Sun, 10 Dec 2023 17:25:30 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sun Dec 10 17:25:30 UTC 2023

 Modified Files:
 	src/usr.bin/systat [netbsd-10]: vmstat.c

 Log Message:
 Pull up following revision(s) (requested by kre in ticket #489):

 	usr.bin/systat/vmstat.c: revision 1.92

 PR bin/56014 from Kouichi Hashikawa

 Don't try to optimise away placing the "s" or " " after "N user"
 (" " where N==1, "s" otherwise) when it seems unnecessary, as that
 fails when the number of users hasn't changed, but the screen is
 being redrawn from nothing (as in after being resumed from a ^Z,
 as in the PR, but just doing a ^L would make the same thing happen).


 To generate a diff of this commit:
 cvs rdiff -u -r1.91 -r1.91.2.1 src/usr.bin/systat/vmstat.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: needs-pullups->pending-pullups
State-Changed-By: kre@NetBSD.org
State-Changed-When: Sun, 10 Dec 2023 17:45:38 +0000
State-Changed-Why:
Pullups requested to -8 -9 and -10

8: #1926
9: #1777
10: #489 (already applied)


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56014 CVS commit: [netbsd-9] src/usr.bin/systat
Date: Mon, 11 Dec 2023 12:28:06 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Mon Dec 11 12:28:06 UTC 2023

 Modified Files:
 	src/usr.bin/systat [netbsd-9]: vmstat.c

 Log Message:
 Pull up following revision(s) (requested by kre in ticket #1777):

 	usr.bin/systat/vmstat.c: revision 1.92

 PR bin/56014 from Kouichi Hashikawa

 Don't try to optimise away placing the "s" or " " after "N user"
 (" " where N==1, "s" otherwise) when it seems unnecessary, as that
 fails when the number of users hasn't changed, but the screen is
 being redrawn from nothing (as in after being resumed from a ^Z,
 as in the PR, but just doing a ^L would make the same thing happen).


 To generate a diff of this commit:
 cvs rdiff -u -r1.87 -r1.87.2.1 src/usr.bin/systat/vmstat.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56014 CVS commit: [netbsd-8] src/usr.bin/systat
Date: Mon, 11 Dec 2023 12:29:30 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Mon Dec 11 12:29:30 UTC 2023

 Modified Files:
 	src/usr.bin/systat [netbsd-8]: vmstat.c

 Log Message:
 Pull up following revision(s) (requested by kre in ticket #1926):

 	usr.bin/systat/vmstat.c: revision 1.92

 PR bin/56014 from Kouichi Hashikawa

 Don't try to optimise away placing the "s" or " " after "N user"
 (" " where N==1, "s" otherwise) when it seems unnecessary, as that
 fails when the number of users hasn't changed, but the screen is
 being redrawn from nothing (as in after being resumed from a ^Z,
 as in the PR, but just doing a ^L would make the same thing happen).


 To generate a diff of this commit:
 cvs rdiff -u -r1.81.8.2 -r1.81.8.3 src/usr.bin/systat/vmstat.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: pending-pullups->closed
State-Changed-By: kre@NetBSD.org
State-Changed-When: Mon, 11 Dec 2023 13:47:07 +0000
State-Changed-Why:
Pullups completed.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2023 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.