Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Sep 2023 12:24:30 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        Warner Losh <imp@bsdimp.com>
Cc:        Martin Matuska <mm@freebsd.org>, Alexander Motin <mav@freebsd.org>, Pawel Jakub Dawidek <pjd@freebsd.org>, Glen Barber <gjb@freebsd.org>, Mike Karels <mike@karels.net>, Current FreeBSD <freebsd-current@freebsd.org>, FreeBSD-STABLE Mailing List <freebsd-stable@freebsd.org>, freebsd-arm <freebsd-arm@freebsd.org>
Subject:   Re: Looks like the kyua zfs tests likely are not used on aarch64 or other contexts with unsigned char
Message-ID:  <FAB697B1-84BE-417F-AF09-ABF97194D422@yahoo.com>
In-Reply-To: <CANCZdfo5YwOdR7d0DNkf_VJ-wq4R=OVN=zafecShFLoA58qYJQ@mail.gmail.com>
References:  <96C2F8F3-D3F0-48FC-BEEC-E3C983BD680A@yahoo.com> <DF839928-F06A-4F0A-8C3B-CAC97060D1CB@yahoo.com> <CANCZdfo5YwOdR7d0DNkf_VJ-wq4R=OVN=zafecShFLoA58qYJQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sep 10, 2023, at 11:21, Warner Losh <imp@bsdimp.com> wrote:

> On Sun, Sep 10, 2023, 11:10 AM Mark Millard <marklmi@yahoo.com> wrote:
>> On Sep 10, 2023, at 00:31, Mark Millard <marklmi@yahoo.com> wrote:
>>=20
>> > kyua tests that use the:
>> >=20
>> > /usr/tests/sys/cddl/zfs/bin/mkfile
>> >=20
>> > program like so (for example):
>> >=20
>> > mkfile 500M /testpool.1861/bigfile.0
>> >=20
>> > (which should be valid) end up with mkfile
>> > instead reporting:
>> >=20
>> > Standard error:
>> > Usage: mkfile [-nv] <size>[e|p|t|g|m|k|b] <filename> ...
>> >=20
>> > which prevent the kyua test involved from working.
>> >=20
>> > Turns out this is from expecting char to be always
>> > signed (so a -1 vs. 255 distinction, here in an
>> > aarch64 context):
>> >=20
>> > . . .
>> > (gdb) list
>> > 179 /* Options. */
>> > 180 while ((ch =3D getopt(argc, argv, "nv")) !=3D -1) {
>> > 181 switch (ch) {
>> > 182 case 'n':
>> > 183 nofill =3D 1;
>> > 184 break;
>> > 185 case 'v':
>> > (gdb) print ch
>> > $16 =3D 255 '\377'
>> > (gdb) print/x -1
>> > $17 =3D 0xffffffff
>> > (gdb) print/x ch
>> > $18 =3D 0xff
>> > . . .
>> >=20
>> > With the mix of unsigned and signed it ends up
>> > being a 0xffu !=3D 0xffffffffu test, which is
>> > always true.
>> >=20
>> > So the switch is reached as if a "-" prefix was
>> > present (that is not). Then the "option" is classified
>> > as invalid and the usage message is produced.
>> >=20
>> > Apparently no one had noticed. That, in turn, suggests a
>> > lack of inspected testing on aarch64, powerpc64,
>> > powerpc64le, armv7, powerpc, and powerpcspe. That, in
>> > turn, suggests that kyua test inspection for the likes
>> > of aarch64 is not historically a part of the release
>> > process for openzfs or for operating systems that include
>> > openzfs.
>> >=20
>>=20
>> Looks like the mkfile.c traces back to a former port
>> sysutils/mkfile that was unfetchable as of 2019. And,
>> looking around, it seems the kyua zfs tests may be a
>> FreeBSD only thing, not adopted in openzfs.
>>=20
>> So various implicit assumptions when I wrote the note
>> do not actually hold.
>>=20
>> FreeBSD would have to do additional testing via kyua,
>> beyond what openzfs does for testing, to discover the
>> unsigned char related mis-behavior in the mkfile that
>> FreeBSD's kyua tests use. Only FreeBSD variants are
>> likely to have a similar status, not general openzfs
>> including operating systems.
>=20
> I wonder how hard ot would be to look for the char =3D getopt() =
pattern with coccinelle
>=20

Unsure.

But to be sure that the implication that I was also trying
to point out is not lost: kyua testing of zfs (and more?)
for aarch64 (tier 1) is apparently not being done (or at
least the results are not being inspected). Similarly for
armv7 and all the powerpc*'s (not tier 1's, however, so
not as surprising).


Side note:

Via other exchanges that have been going on I learned to
look in the likes of:

https://ci.freebsd.org/job/FreeBSD-main-amd64-testvm/*/consoleText

for what to "pkg install" for kyua test runs to use for
normal runs (at least the subset compatible with
architecture being tested). I'd only figured out a (large)
subset previously for aarch64 and armv7.

I'm not aware of there being other documentation for what
is appropriate for setting up such for kyua runs.

=3D=3D=3D
Mark Millard
marklmi at yahoo.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FAB697B1-84BE-417F-AF09-ABF97194D422>