NetBSD Problem Report #58515
From www@netbsd.org Mon Jul 29 10:33:24 2024
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)
key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
client-signature RSA-PSS (2048 bits) client-digest SHA256)
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id BF2321A923C
for <gnats-bugs@gnats.NetBSD.org>; Mon, 29 Jul 2024 10:33:24 +0000 (UTC)
Message-Id: <20240729103323.24AF71A923E@mollari.NetBSD.org>
Date: Mon, 29 Jul 2024 10:33:23 +0000 (UTC)
From: hashikaw@mail.ru
Reply-To: hashikaw@mail.ru
To: gnats-bugs@NetBSD.org
Subject: struct acct at acct(5) man page is different from /usr/include/sys/acct.h
X-Send-Pr-Version: www-1.0
>Number: 58515
>Notify-List: christos@NetBSD.org
>Category: misc
>Synopsis: struct acct at acct(5) man page is different from /usr/include/sys/acct.h
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: misc-bug-people
>State: closed
>Class: doc-bug
>Submitter-Id: net
>Arrival-Date: Mon Jul 29 10:35:00 +0000 2024
>Closed-Date: Sun Oct 13 20:30:58 +0000 2024
>Last-Modified: Sun Oct 13 20:30:58 +0000 2024
>Originator: Kouichi Hashikawa
>Release: current, 10, 9
>Organization:
>Environment:
>Description:
struct acct at man page acct(5) is different from /usr/include/sys/acct.h.
/*
* Accounting structures; these use a comp_t type which is a 3 bits base 8
* exponent, 13 bit fraction ``floating point'' number. Units are 1/AHZ
* seconds.
*/
-typedef u_short comp_t;
+typedef uint16_t comp_t;
struct acct {
- char ac_comm[10]; /* name of command */
+ char ac_comm[16]; /* command name */
comp_t ac_utime; /* user time */
comp_t ac_stime; /* system time */
comp_t ac_etime; /* elapsed time */
time_t ac_btime; /* starting time */
uid_t ac_uid; /* user id */
gid_t ac_gid; /* group id */
- short ac_mem; /* memory usage average */
+ uint16_t ac_mem; /* average memory usage */
comp_t ac_io; /* count of IO blocks */
dev_t ac_tty; /* controlling tty */
-#define AFORK 0x01 /* forked but not execed */
+
+#define AFORK 0x01 /* fork'd but not exec'd */
#define ASU 0x02 /* used super-user permissions */
#define ACOMPAT 0x04 /* used compatibility mode */
#define ACORE 0x08 /* dumped core */
#define AXSIG 0x10 /* killed by a signal */
- char ac_flag; /* accounting flags */
+ uint8_t ac_flag; /* accounting flags */
};
/*
...
*/
#define AHZ 64
-#ifdef KERNEL
-struct vnode *acctp;
+#ifdef _KERNEL
+void acct_init(void);
+int acct_process(struct lwp *);
#endif
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/58515 CVS commit: src/share/man/man5
Date: Sat, 3 Aug 2024 19:49:06 -0400
Module Name: src
Committed By: christos
Date: Sat Aug 3 23:49:06 UTC 2024
Modified Files:
src/share/man/man5: acct.5
Log Message:
PR/58515: Kouichi Hashikawa: Sync with the header file
To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/share/man/man5/acct.5
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: riastradh@NetBSD.org
State-Changed-When: Tue, 08 Oct 2024 23:29:15 +0000
State-Changed-Why:
Fixed in HEAD? Needs pullups?
From: Christos Zoulas <christos@zoulas.com>
To: gnats-bugs@netbsd.org
Cc: misc-bug-people@netbsd.org,
netbsd-bugs@netbsd.org,
gnats-admin@netbsd.org,
"riastradh@netbsd.org" <riastradh@NetBSD.org>,
hashikaw@mail.ru,
"christos@netbsd.org" <christos@NetBSD.org>
Subject: Re: misc/58515 (struct acct at acct(5) man page is different from
/usr/include/sys/acct.h)
Date: Tue, 8 Oct 2024 19:42:28 -0400
--Apple-Mail=_8D362AB4-FE75-4CFF-97DE-79B2A9F66A94
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=utf-8
If the man page is pulled up it also needs acct_process.9 + sets.
christos
> On Oct 8, 2024, at 7:29=E2=80=AFPM, riastradh@netbsd.org =
<riastradh@NetBSD.org> wrote:
>=20
> Synopsis: struct acct at acct(5) man page is different from =
/usr/include/sys/acct.h
>=20
> State-Changed-From-To: open->feedback
> State-Changed-By: riastradh@NetBSD.org
> State-Changed-When: Tue, 08 Oct 2024 23:29:15 +0000
> State-Changed-Why:
> Fixed in HEAD? Needs pullups?
>=20
>=20
--Apple-Mail=_8D362AB4-FE75-4CFF-97DE-79B2A9F66A94
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename=signature.asc
Content-Type: application/pgp-signature;
name=signature.asc
Content-Description: Message signed with OpenPGP
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
iF0EARECAB0WIQS+BJlbqPkO0MDBdsRxESqxbLM7OgUCZwXDZAAKCRBxESqxbLM7
Ot/LAKCzov3VY/L0Y7aZy+F7CNnhmj1/XwCglgvxIpxNns7E+BwB8ofLubXrOEc=
=SVHg
-----END PGP SIGNATURE-----
--Apple-Mail=_8D362AB4-FE75-4CFF-97DE-79B2A9F66A94--
From: matthew green <mrg@eterna23.net>
To: gnats-bugs@netbsd.org
Cc: christos@NetBSD.org, misc-bug-people@netbsd.org,
netbsd-bugs@netbsd.org, gnats-admin@netbsd.org, riastradh@NetBSD.org,
hashikaw@mail.ru
Subject: re: misc/58515 (struct acct at acct(5) man page is different from /usr/include/sys/acct.h)
Date: Wed, 09 Oct 2024 15:51:40 +1100
riastradh@NetBSD.org writes:
> Synopsis: struct acct at acct(5) man page is different from /usr/include=
/sys/acct.h
>
> State-Changed-From-To: open->feedback
> State-Changed-By: riastradh@NetBSD.org
> State-Changed-When: Tue, 08 Oct 2024 23:29:15 +0000
> State-Changed-Why:
> Fixed in HEAD? Needs pullups?
i've been meaning to say... acct(5) was affected in netbsd 6.x
and beyond, as the size of time_t *and* dev_t members grew, but
there is no compat code etc:
struct acct {
...
time_t ac_btime; /* starting time */
...
dev_t ac_tty; /* controlling tty */
if we're gonna consider fixing this, i'd consider doing it as
part of an 3rd change that bumped the sizes of various things
that are kinda limited in 2024 (vs 1984):
/*
* Accounting structures; these use a comp_t type which is a 3 bits base 8
* exponent, 13 bit fraction ``floating point'' number. Units are 1/AHZ
* seconds.
*/
typedef uint16_t comp_t;
...
comp_t ac_utime; /* user time */
comp_t ac_stime; /* system time */
comp_t ac_etime; /* elapsed time */
...
comp_t ac_io; /* count of IO blocks */
limited in both ways:
- *tiny* cpu time is far more possible now
- *massive threaded* cpu time is far more possible now.
.mrg.
From: Robert Elz <kre@munnari.OZ.AU>
To: matthew green <mrg@eterna23.net>
Cc: gnats-bugs@netbsd.org, christos@NetBSD.org, misc-bug-people@netbsd.org,
netbsd-bugs@netbsd.org, riastradh@NetBSD.org, hashikaw@mail.ru
Subject: Re: misc/58515 (struct acct at acct(5) man page is different from /usr/include/sys/acct.h)
Date: Wed, 09 Oct 2024 12:35:04 +0700
Date: Wed, 09 Oct 2024 15:51:40 +1100
From: matthew green <mrg@eterna23.net>
Message-ID: <20001.1728449500@splode.eterna23.net>
| i've been meaning to say... acct(5) was affected in netbsd 6.x
| and beyond, as the size of time_t *and* dev_t members grew, but
| there is no compat code etc:
There doesn't really need to be, with the caveat that when switching
between kernels with different versions, the (I think just 2) userland
utilities that deal with these things (sa(8), and lastcomm(1)) need to be
updated as well, and all the old files need to be cleared (or turned
into text) - ie: /var/account/* .
It isn't really much of a hardship. There's no defined API to access
any of this that needs to be versioned.
| if we're gonna consider fixing this, i'd consider doing it as
| part of an 3rd change that bumped the sizes of various things
| that are kinda limited in 2024 (vs 1984):
| limited in both ways:
|
| - *tiny* cpu time is far more possible now
| - *massive threaded* cpu time is far more possible now.
They are indeed - unfortunately, the number of commands that can complete
per second is also far more now than in 1979 (which is when I think this
actually originated, as much as it might be nice to consider it a 1984
effect) which means that the file grows much much faster than it did then,
and increasing the size of each entry will make that much worse.
It isn't an easy decision to make.
kre
From: Kouichi Hashikawa <hashikaw@mail.ru>
To: gnats-bugs@netbsd.org
Cc: misc-bug-people@netbsd.org, netbsd-bugs@netbsd.org,
gnats-admin@netbsd.org, riastradh@netbsd.org, christos@netbsd.org
Subject: Re: misc/58515 (struct acct at acct(5) man page is different from /usr/include/sys/acct.h)
Date: Sun, 13 Oct 2024 12:11:02 +0900
Thank you for fixing the problem.
> Fixed in HEAD? Needs pullups?
Please pull-up to release branch.
--
Kouichi Hashikawa
State-Changed-From-To: feedback->pending-pullups
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Sun, 13 Oct 2024 12:46:13 +0000
State-Changed-Why:
pullup-10 #969 https://releng.netbsd.org/cgi-bin/req-10.cgi?show=969
pullup-9 #1910 https://releng.netbsd.org/cgi-bin/req-9.cgi?show=1910
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/58515 CVS commit: [netbsd-10] src/share/man/man5
Date: Sun, 13 Oct 2024 15:46:47 +0000
Module Name: src
Committed By: martin
Date: Sun Oct 13 15:46:47 UTC 2024
Modified Files:
src/share/man/man5 [netbsd-10]: acct.5
Log Message:
Pull up following revision(s) (requested by riastradh in ticket #969):
share/man/man5/acct.5: revision 1.11
share/man/man5/acct.5: revision 1.12
PR/58515: Kouichi Hashikawa: Sync with the header file
reference the correct function called.
To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.10.2.1 src/share/man/man5/acct.5
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/58515 CVS commit: [netbsd-9] src/share/man/man5
Date: Sun, 13 Oct 2024 15:50:27 +0000
Module Name: src
Committed By: martin
Date: Sun Oct 13 15:50:27 UTC 2024
Modified Files:
src/share/man/man5 [netbsd-9]: acct.5
Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1910):
share/man/man5/acct.5: revision 1.10
share/man/man5/acct.5: revision 1.11
share/man/man5/acct.5: revision 1.12
Explain the state of ASU and ACOMPAT.
PR/58515: Kouichi Hashikawa: Sync with the header file
reference the correct function called.
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.9.78.1 src/share/man/man5/acct.5
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: riastradh@NetBSD.org
State-Changed-When: Sun, 13 Oct 2024 20:30:58 +0000
State-Changed-Why:
fixed in HEAD, pulled up to 9 and 10
>Unformatted:
(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-2024
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.