From nobody Mon Sep 15 11:49:03 2025 X-Original-To: dev-commits-src-all@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 4cQNc55tDLz67FMf; Mon, 15 Sep 2025 11:49:25 +0000 (UTC) (envelope-from dbaio@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cQNc556pzz42xR; Mon, 15 Sep 2025 11:49:25 +0000 (UTC) (envelope-from dbaio@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757936965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=m+v1FfL7YSmcELVN+/L/+3bupzJdnCviVTNnQGHP9rU=; b=Mv1J0Lo9wYrNScYVxknOlWWb0au+8HpqP5NYSxW750gzR2r+UKXoBkIa8d+DAmqlTS5mpA d7HHdS7aynSaHFwMsed0KTbsDbzwun/odAFRo5qWVz3EnNvKj6C2o1/WYOMQQmIuZgLfuA XxgGS7bG1VcRy8UeufjLeDjbxW/24j+ngrV0i54yysIkakQlmFsGBJmHETay3xqiT6PxYo 9vkWAxfUTemE1GiaRyrwSlfWLsji4IPLRa3DTr/OIRKO3suD327698nhnwKCfBcGab7gtQ KMF5n4kBMuKPAzyDkazU0xC86Kvg4UAhfesr7XOPrN5afWRcKJxpUeKzwDjp2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757936965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=m+v1FfL7YSmcELVN+/L/+3bupzJdnCviVTNnQGHP9rU=; b=LgLYN8+WvQcW6fW24iWox6kZwqghIG+7LfImsBt7U0yEeaX6jrS+j+SMoyWHOeVlaFehKx UWKGrtNN2NhkK1byVndOQwGPhODOai/9BGsxw7KX3Td/G3WttXkt3PnQvzYWGQGx82BwLs g41Yy7GIZ2h6f9mfTf41Ax+B6387wSPAS1zG344Z/Qj7owWQvdTCiD8l5qg5YECwjjagTB i/M3P+xta6ZYkNqFVM7zzeVEbXJWpnEyBIg8SYo5HoF7URpNa4YoiMHK8+fr03dKxdjL2d SDX9T4Zi8aXIc1DcVpZKfwfXk/yItKrpADKZYuPBBc4kXgeBjvCdxPErm+hIZw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1757936965; a=rsa-sha256; cv=none; b=Us1B3vt7ObduDO6eP0yiCPYMzDcxrE3cgpzXZEjtBn2lZFB1MbO5pbZV8aMoJ5fULzf+mn 3hWtE38KGotDcotuYQWzPCI3iCVjwAmL73DqhYPduHthJ/1ObzigyMrdJP6nYIUtcl19ro oiTdTzLyYFsw5EnM3yi5gItqTQkO3QIyX8H2BUom/OXNwZxyR9fonH/n1U3anwdlUOAAX6 dYdcVkZkM/LtHnmHPF31ykQh0TUW3FH4itESQ4nRTnXUoYkxTOLMxGXK8D/l4ar36zHYSF EZg7HV6ULg/S2QYFzbbh8Z8FmponUoeU/YeNjMB2rglMoJxbBqV/zdloAjeNLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from fauth-a2-smtp.messagingengine.com (fauth-a2-smtp.messagingengine.com [103.168.172.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: dbaio/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4cQNc546jZz13XL; Mon, 15 Sep 2025 11:49:25 +0000 (UTC) (envelope-from dbaio@FreeBSD.org) Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfauth.phl.internal (Postfix) with ESMTP id B5AD5F40066; Mon, 15 Sep 2025 07:49:24 -0400 (EDT) Received: from phl-imap-15 ([10.202.2.104]) by phl-compute-02.internal (MEProxy); Mon, 15 Sep 2025 07:49:24 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdefjeeiudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefoggffhffvvefkjghfufgtgfesthhqredtredtjeenucfhrhhomhepfdffrghnihhl ohcuifdruceurghiohdfuceouggsrghioheshfhrvggvuefuffdrohhrgheqnecuggftrf grthhtvghrnhepgeeuheefudfffeevjeeikeejvdeuffetkeekieelueekheeuledtuefg vddufeeunecuffhomhgrihhnpehfrhgvvggsshgurdhorhhgnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepuggsrghiohdomhgvshhmthhprghu thhhphgvrhhsohhnrghlihhthidquddukedufeeluddvtddqvdeikedtvdejieekqdgusg grihhopeephfhrvggvuefuffdrohhrghesfhgrshhtmhgrihhlrdgtohhmpdhnsggprhgt phhtthhopeehpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopeguvghvqdgtohhmmh hithhsqdhsrhgtqdgrlhhlsehfrhgvvggsshgurdhorhhgpdhrtghpthhtohepuggvvhdq tghomhhmihhtshdqshhrtgdqmhgrihhnsehfrhgvvggsshgurdhorhhgpdhrtghpthhtoh epkhgvvhgrnhhssehfrhgvvggsshgurdhorhhgpdhrtghpthhtohepshhrtgdqtghomhhm ihhtthgvrhhssehfrhgvvggsshgurdhorhhgpdhrtghpthhtohepjhgrmhhivgesghhrih htthhonhdrohhrgh X-ME-Proxy: Feedback-ID: i9d2946a4:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 8C495780271; Mon, 15 Sep 2025 07:49:24 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 X-ThreadId: Am1ynKg1lObs Date: Mon, 15 Sep 2025 08:49:03 -0300 From: "Danilo G. Baio" To: "James Gritton" , "Kyle Evans" Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Message-Id: In-Reply-To: References: <202507260314.56Q3E5cY002869@gitrepo.freebsd.org> <54e7f090-c031-47f2-bc51-c020a77ab00a@app.fastmail.com> Subject: Re: git: dbaaadd4373a - main - jls: minor simplification to arg handling Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Mon, Sep 15, 2025, at 01:05, James Gritton wrote: > On 2025-09-14 19:30, Kyle Evans wrote: >> On 9/14/25 20:00, Kyle Evans wrote: >>> On 9/14/25 19:14, Danilo G. Baio wrote: >>>>=20 >>>>=20 >>>> On Sat, Jul 26, 2025, at 00:14, Kyle Evans wrote: >>>>> The branch main has been updated by kevans: >>>>>=20 >>>>> URL: >>>>> https://cgit.FreeBSD.org/src/commit/?id=3Ddbaaadd4373a725950ad11e5= 78dab61537b7c4f2 >>>>>=20 >>>>> commit dbaaadd4373a725950ad11e578dab61537b7c4f2 >>>>> Author:=C2=A0=C2=A0=C2=A0=C2=A0 Kyle Evans >>>>> AuthorDate: 2025-07-26 03:13:41 +0000 >>>>> Commit:=C2=A0=C2=A0=C2=A0=C2=A0 Kyle Evans >>>>> CommitDate: 2025-07-26 03:13:41 +0000 >>>>>=20 >>>>> =C2=A0=C2=A0=C2=A0=C2=A0 jls: minor simplification to arg handling >>>>> =C2=A0=C2=A0=C2=A0=C2=A0 It's easier to reason about the state of = argc/argv if we just=20 >>>>> augment >>>>> =C2=A0=C2=A0=C2=A0=C2=A0 them by optind after our getopt() loop. >>>>> =C2=A0=C2=A0=C2=A0=C2=A0 No functional change, but this sets the s= tage for another=20 >>>>> change to add >>>>> =C2=A0=C2=A0=C2=A0=C2=A0 a `-c` mode to (c)heck for the existence = of a jail quietly=20 >>>>> without >>>>> =C2=A0=C2=A0=C2=A0=C2=A0 the caller having to worry about spurious= output. >>>>> =C2=A0=C2=A0=C2=A0=C2=A0 Reviewed by:=C2=A0=C2=A0=C2=A0 jamie >>>>> =C2=A0=C2=A0=C2=A0=C2=A0 Differential Revision:=C2=A0 https://revi= ews.freebsd.org/D51540 >>>>> --- >>>>> =C2=A0 usr.sbin/jls/jls.c | 10 ++++++---- >>>>> =C2=A0 1 file changed, 6 insertions(+), 4 deletions(-) >>>>>=20 >>>>> diff --git a/usr.sbin/jls/jls.c b/usr.sbin/jls/jls.c >>>>> index bd193a69c458..a1d1716713aa 100644 >>>>> --- a/usr.sbin/jls/jls.c >>>>> +++ b/usr.sbin/jls/jls.c >>>>> @@ -140,8 +140,11 @@ main(int argc, char **argv) >>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ip4_ok =3D feature_present("inet"); >>>>> =C2=A0 #endif >>>>>=20 >>>>> +=C2=A0=C2=A0=C2=A0 argc -=3D optind; >>>>> +=C2=A0=C2=A0=C2=A0 argv +=3D optind; >>>>> + >>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* Add the parameters to print. */ >>>>> -=C2=A0=C2=A0=C2=A0 if (optind =3D=3D argc) { >>>>> +=C2=A0=C2=A0=C2=A0 if (argc =3D=3D 0) { >>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (pflags = & (PRINT_HEADER | PRINT_NAMEVAL)) >>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 add_param("all", NULL, (size_t)0, NULL, JP_USER); >>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 else if (pf= lags & PRINT_VERBOSE) { >>>>> @@ -179,9 +182,8 @@ main(int argc, char **argv) >>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } else { >>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pflags &=3D= ~PRINT_VERBOSE; >>>>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 while (optind < argc) >>>>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= add_param(argv[optind++], NULL, (size_t)0, NULL, >>>>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 JP_USER); >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for (i =3D 0; i < argc= ; i++) >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= add_param(argv[i], NULL, (size_t)0, NULL, JP_USER); >>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >>>>>=20 >>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (pflags & PRINT_SKIP) { >>>>=20 >>>>=20 >>>> Hi, >>>>=20 >>>> Just replying to one of the recent changes on `jls`. >>>>=20 >>>> We use `jls -n` in many scripts, and recently, it stopped working. >>>>=20 >>>> The last build that was working for us: >>>> FreeBSD 15.0-CURRENT #0 main-n278879-4be9c6f38e78: Sat Jul 19=20 >>>> 13:19:25 UTC 2025 >>>>=20 >>>> We are now encountering the following issue on this build: >>>> FreeBSD 16.0-CURRENT #0 main-n280141-5e82eeccd252: Sat Sep=C2=A0 6=20 >>>> 05:27:34 UTC 2025 >>>>=20 >>>> $ jls -n >>>> desc=3D0 devfs_ruleset=3D0 nodying enforce_statfs=3D0 env=3D"" host= =3Ddisable=20 >>>> ip4=3Ddisable ip6=3Ddisable jid=3D0 meta=3D"" name=3D"" osreldate=3D= 0=20 >>>> osrelease=3D"" parent=3D0 path=3D"" nopersist securelevel=3D0 sysvm= sg=3Ddisable=20 >>>> sysvsem=3Ddisable sysvshm=3Ddisable vnet=3Ddisable zfs=3Ddisable=20 >>>> allow.noadjtime allow.nochflags allow.noextattr allow.nomlock=20 >>>> allow.nomount allow.mount.nodevfs allow.mount.nofdescfs=20 >>>> allow.mount.nonullfs allow.mount.noprocfs allow.mount.notmpfs=20 >>>> allow.mount.nozfs allow.nonfsd allow.noquotas allow.noraw_sockets=20 >>>> allow.noread_msgbuf allow.noreserved_ports allow.norouting=20 >>>> allow.noset_hostname allow.nosettime allow.nosocket_af allow.nosuse= r=20 >>>> allow.nosysvipc allow.nounprivileged_parent_tampering=20 >>>> allow.nounprivileged_proc_debug children.cur=3D0 children.max=3D0=20 >>>> cpuset.id=3D0 host.domainname=3D"" host.hostid=3D0 host.hostname=3D= ""=20 >>>> host.hostuuid=3D""=20 >>>> ip4.addr=3D0.0.0.0,0.0.0.0,0.0.0.0,0.0.0.0,0.0.0.0,0.0.0.0,0.0.0.0=20 >>>> ip4.nosaddrsel ip6.addr=3D::,::,::,::,::,:: ip6.nosaddrsel=20 >>>> zfs.mount_snapshot=3D0 >>>> desc=3D0 devfs_ruleset=3D0 nodying enforce_statfs=3D0 env=3D"" host= =3Ddisable=20 >>>> ip4=3Ddisable ip6=3Ddisable jid=3D0 meta=3D"" name=3D"" osreldate=3D= 0=20 >>>> osrelease=3D"" parent=3D0 path=3D"" nopersist securelevel=3D0 sysvm= sg=3Ddisable=20 >>>> sysvsem=3Ddisable sysvshm=3Ddisable vnet=3Ddisable zfs=3Ddisable=20 >>>> allow.noadjtime allow.nochflags allow.noextattr allow.nomlock=20 >>>> allow.nomount allow.mount.nodevfs allow.mount.nofdescfs=20 >>>> allow.mount.nonullfs allow.mount.noprocfs allow.mount.notmpfs=20 >>>> allow.mount.nozfs allow.nonfsd allow.noquotas allow.noraw_sockets=20 >>>> allow.noread_msgbuf allow.noreserved_ports allow.norouting=20 >>>> allow.noset_hostname allow.nosettime allow.nosocket_af allow.nosuse= r=20 >>>> allow.nosysvipc allow.nounprivileged_parent_tampering=20 >>>> allow.nounprivileged_proc_debug children.cur=3D0 children.max=3D0=20 >>>> cpuset.id=3D0 host.domainname=3D"" host.hostid=3D0 host.hostname=3D= ""=20 >>>> host.hostuuid=3D""=20 >>>> ip4.addr=3D0.0.0.0,0.0.0.0,0.0.0.0,0.0.0.0,0.0.0.0,0.0.0.0,0.0.0.0=20 >>>> ip4.nosaddrsel ip6.addr=3D::,::,::,::,::,:: ip6.nosaddrsel=20 >>>> zfs.mount_snapshot=3D0 >>>> desc=3D0 devfs_ruleset=3D0 nodying enforce_statfs=3D0 env=3D"" host= =3Ddisable=20 >>>> ip4=3Ddisable ip6=3Ddisable jid=3D0 meta=3D"" name=3D"" osreldate=3D= 0=20 >>>> osrelease=3D"" parent=3D0 path=3D"" nopersist securelevel=3D0 sysvm= sg=3Ddisable=20 >>>> sysvsem=3Ddisable sysvshm=3Ddisable vnet=3Ddisable zfs=3Ddisable=20 >>>> allow.noadjtime allow.nochflags allow.noextattr allow.nomlock=20 >>>> allow.nomount allow.mount.nodevfs allow.mount.nofdescfs=20 >>>> allow.mount.nonullfs allow.mount.noprocfs allow.mount.notmpfs=20 >>>> allow.mount.nozfs allow.nonfsd allow.noquotas allow.noraw_sockets=20 >>>> allow.noread_msgbuf allow.noreserved_ports allow.norouting=20 >>>> allow.noset_hostname allow.nosettime >>>> [...] >>>> infinite loop >>>>=20 >>>=20 >>> Adding jamie@, neither of the changes to jls(1) should've caused thi= s,=20 >>> as far as I can reason about (and I haven't observed this here, yet)= .=C2=A0=20 >>> This looks like a failure to terminate the print_jail loop at the en= d? >>=20 >> I still can't functionally update, but looking at the recent jaildesc=20 >> work, I wonder >> if this is a side effect that has since been fixed in=20 >> e75dda31c1eead9ad40580bd8 by >> removing the "desc" parameter. It would have been included in=20 >> jailparam_all(), and >> I wonder if that somehow broke jls-style iteration? > > I've verified that the patch stocks the problem, and took the liberty = of=20 > MFCing it a day early. > > - Jamie Thanks to both of you for taking a look at this. --=20 Danilo G. Baio