From nobody Sun Sep 10 15:43:24 2023 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RkDf85p1Tz4shGC for ; Sun, 10 Sep 2023 15:43:44 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic311-24.consmr.mail.gq1.yahoo.com (sonic311-24.consmr.mail.gq1.yahoo.com [98.137.65.205]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4RkDf837Mzz4gHF for ; Sun, 10 Sep 2023 15:43:44 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1694360621; bh=2rbZTEfWWo8RKoiAhtH6XccZ5H33oAnFblm39qEEt3k=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=OKD5xtPpL8WewSQaoVOf87gSf3MUPLYvU/w03OdXkP1yxKPwfrW9HNmuw2kv2jSoJ1fS2lGD528iinAV3SszMgcDSMv2hUZO3Hwk7939SFKKgPveFng17YDxu2M50yUGO+sn9JhQ3Tf5YVgC2+CGa8IrMKz+W2Jlz1oxqM3jdtRv2gf5zQg74d/erITugHhnkXBrT+UBNPEPXMT2ytS00Y00kNbRsMiIi+zPl0LAqCdcHY1EDbzCj0BGmBkuHI9Z4wDFFzMEk9Fftj+tGKe6efj2NkZnqBHxSRKc77kC3X1Pw7J0vl3IpwwoU56cajy4gGRc53ZqrMJp19WbvoTXSw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1694360621; bh=BULofRULbdIiQdtMMG/h7fR4pps1v2stgc2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z7pWAZWNN0NKsIdQHJoqpnhgGCV2cgHQC0Q eP9gmcwHsCB.l0Um2jR0qfmvqeLLSgM3xh9GiflYMW8HerDAtXiLaTWeahr44QSKCd3r9AeKhZBG ax4laU2vGg_zjFWdMKVgC0zLbkHz_QfMdapq3QrIIiXeRBLVQpPADdcI9_lqBw9KDaMDRHuqTgbS mbFWqzjVCqg3v6wNP9JHzT8pf85hL9aIVIYnLnOPErSkGjY2b0M0uAMUqOPvTINqzSQa2ETdoae2 gHc5FH_7PUP2bh_Pvvbcg5aSCVNxiYzIx4GkDLl8qHWMbsqKHNw4h_wm7_9Pe_Aa2aP18v9_F1_8 0fgaBQtA92P6ps.ETjoyoylrXqxjoApkb9ki44mmIKSc2_3dpyEuNBU.D6mxnZasd9a0CUMbsEHM XjyzVFrpvArSbWu2ugy0mb1IcRzqM5DSY9UedKkYExUZ3tQiSySEVpMYL4C29J3aCF_jthE..0np 89m1.VyCZbBVh9_PxmYAPtwL5XLAO.c9zHgKaZNRq2oUXpoC3IVzSBJPv3pEWhCdGyYhr4uKDCBW OnT4- X-Sonic-MF: X-Sonic-ID: bcd41371-d9aa-47f7-850e-47cc700bab0c Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.gq1.yahoo.com with HTTP; Sun, 10 Sep 2023 15:43:41 +0000 Received: by hermes--production-bf1-865889d799-7vf9r (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 40160cf81dc8e6fb3d3dc63f595ff7ec; Sun, 10 Sep 2023 15:43:37 +0000 (UTC) Content-Type: text/plain; charset=us-ascii List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: Re: Looks like the kyua zfs tests likely are not used on aarch64 or other contexts with unsigned char From: Mark Millard In-Reply-To: Date: Sun, 10 Sep 2023 08:43:24 -0700 Cc: Martin Matuska , Alexander Motin , Pawel Jakub Dawidek , Glen Barber , Current FreeBSD , FreeBSD-STABLE Mailing List , freebsd-arm Content-Transfer-Encoding: 7bit Message-Id: <02F48605-887C-446C-9647-8757D50B4B24@yahoo.com> References: <96C2F8F3-D3F0-48FC-BEEC-E3C983BD680A.ref@yahoo.com> <96C2F8F3-D3F0-48FC-BEEC-E3C983BD680A@yahoo.com> To: Mike Karels X-Mailer: Apple Mail (2.3731.700.6) X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US] X-Rspamd-Queue-Id: 4RkDf837Mzz4gHF On Sep 10, 2023, at 05:58, Mike Karels wrote: > On 10 Sep 2023, at 2:31, Mark Millard wrote: > >> kyua tests that use the: >> >> /usr/tests/sys/cddl/zfs/bin/mkfile >> >> program like so (for example): >> >> mkfile 500M /testpool.1861/bigfile.0 >> >> (which should be valid) end up with mkfile >> instead reporting: >> >> Standard error: >> Usage: mkfile [-nv] [e|p|t|g|m|k|b] ... >> >> which prevent the kyua test involved from working. >> >> Turns out this is from expecting char to be always >> signed (so a -1 vs. 255 distinction, here in an >> aarch64 context): >> >> . . . >> (gdb) list >> 179 /* Options. */ >> 180 while ((ch = getopt(argc, argv, "nv")) != -1) { >> 181 switch (ch) { >> 182 case 'n': >> 183 nofill = 1; >> 184 break; >> 185 case 'v': >> (gdb) print ch >> $16 = 255 '\377' >> (gdb) print/x -1 >> $17 = 0xffffffff >> (gdb) print/x ch >> $18 = 0xff >> . . . >> >> With the mix of unsigned and signed it ends up >> being a 0xffu != 0xffffffffu test, which is >> always true. > > mkfile is broken. getopt returns an int, and -1 on end. > It never returns 0xff. But mkfile declares ch as char, > which truncates the return value -1. ch is a bad (misleading) > variable name, although getopt(3) uses it as well (but declared > as int). Yep: for char being signed, the code is still wrong via the char ch use. But the observed behavior is very different than for char being used but being unsigned. In this context, consequences of the unsigned char behavioral results are observable in the kyua run results but went unnoticed. I used to run into examples of the use of unsigned char for holding the getopt result back in my powerpc days as well and dealt with upstreams for a port or 2 for getting it fixed after finding such was the source of odd behavior I'd observed. If I remember right, this is the first example of running into the specific issue in my aarch64 and armv7 time frame. > Mike > >> 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. >> >> 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. > === Mark Millard marklmi at yahoo.com