From nobody Mon Sep 15 04:05:24 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 4cQBJj3p13z67yxQ; Mon, 15 Sep 2025 04:05:25 +0000 (UTC) (envelope-from jamie@gritton.org) Received: from m2.gritton.org (gritton.org [67.43.236.212]) (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) by mx1.freebsd.org (Postfix) with ESMTPS id 4cQBJj1Gd3z43Qc; Mon, 15 Sep 2025 04:05:25 +0000 (UTC) (envelope-from jamie@gritton.org) Authentication-Results: mx1.freebsd.org; none Received: from gritton.org (localgritton [127.0.0.212]) by m2.gritton.org (Postfix) with ESMTPSA id AE20F7F295; Sun, 14 Sep 2025 21:05:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gritton.org; s=m2; t=1757909124; bh=JpVodKY+lLtlGHxKF0kflf7hUCo3OK9kNFzGcahxP50=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=J9c67R0bC5k3Cj9FUfVKCXRu2vSLeXdFQ0wgxhkB/Jc1x6Fe2wxihtxiJFjnoKIzZ jyiGLNuNRIE0iQ4wWOkp3teuIxfo5LEF6L25gJMdaNOIAJgeLYF5AQxDoUaCRo6Jg/ kQdsro1Dnlof5uYRaOdZ/D8nsAXBdLhEtTIyi8yc= 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 Date: Sun, 14 Sep 2025 21:05:24 -0700 From: James Gritton To: Kyle Evans Cc: "Danilo G. Baio" , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: dbaaadd4373a - main - jls: minor simplification to arg handling In-Reply-To: References: <202507260314.56Q3E5cY002869@gitrepo.freebsd.org> <54e7f090-c031-47f2-bc51-c020a77ab00a@app.fastmail.com> Message-ID: X-Sender: jamie@gritton.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4cQBJj1Gd3z43Qc 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: >>> >>> >>> On Sat, Jul 26, 2025, at 00:14, Kyle Evans wrote: >>>> The branch main has been updated by kevans: >>>> >>>> URL: >>>> https://cgit.FreeBSD.org/src/commit/?id=dbaaadd4373a725950ad11e578dab61537b7c4f2 >>>> >>>> commit dbaaadd4373a725950ad11e578dab61537b7c4f2 >>>> Author:     Kyle Evans >>>> AuthorDate: 2025-07-26 03:13:41 +0000 >>>> Commit:     Kyle Evans >>>> CommitDate: 2025-07-26 03:13:41 +0000 >>>> >>>>      jls: minor simplification to arg handling >>>>      It's easier to reason about the state of argc/argv if we just >>>> augment >>>>      them by optind after our getopt() loop. >>>>      No functional change, but this sets the stage for another >>>> change to add >>>>      a `-c` mode to (c)heck for the existence of a jail quietly >>>> without >>>>      the caller having to worry about spurious output. >>>>      Reviewed by:    jamie >>>>      Differential Revision:  https://reviews.freebsd.org/D51540 >>>> --- >>>>   usr.sbin/jls/jls.c | 10 ++++++---- >>>>   1 file changed, 6 insertions(+), 4 deletions(-) >>>> >>>> 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) >>>>       ip4_ok = feature_present("inet"); >>>>   #endif >>>> >>>> +    argc -= optind; >>>> +    argv += optind; >>>> + >>>>       /* Add the parameters to print. */ >>>> -    if (optind == argc) { >>>> +    if (argc == 0) { >>>>           if (pflags & (PRINT_HEADER | PRINT_NAMEVAL)) >>>>               add_param("all", NULL, (size_t)0, NULL, JP_USER); >>>>           else if (pflags & PRINT_VERBOSE) { >>>> @@ -179,9 +182,8 @@ main(int argc, char **argv) >>>>           } >>>>       } else { >>>>           pflags &= ~PRINT_VERBOSE; >>>> -        while (optind < argc) >>>> -            add_param(argv[optind++], NULL, (size_t)0, NULL, >>>> -                JP_USER); >>>> +        for (i = 0; i < argc; i++) >>>> +            add_param(argv[i], NULL, (size_t)0, NULL, JP_USER); >>>>       } >>>> >>>>       if (pflags & PRINT_SKIP) { >>> >>> >>> Hi, >>> >>> Just replying to one of the recent changes on `jls`. >>> >>> We use `jls -n` in many scripts, and recently, it stopped working. >>> >>> The last build that was working for us: >>> FreeBSD 15.0-CURRENT #0 main-n278879-4be9c6f38e78: Sat Jul 19 >>> 13:19:25 UTC 2025 >>> >>> We are now encountering the following issue on this build: >>> FreeBSD 16.0-CURRENT #0 main-n280141-5e82eeccd252: Sat Sep  6 >>> 05:27:34 UTC 2025 >>> >>> $ jls -n >>> desc=0 devfs_ruleset=0 nodying enforce_statfs=0 env="" host=disable >>> ip4=disable ip6=disable jid=0 meta="" name="" osreldate=0 >>> osrelease="" parent=0 path="" nopersist securelevel=0 sysvmsg=disable >>> sysvsem=disable sysvshm=disable vnet=disable zfs=disable >>> allow.noadjtime allow.nochflags allow.noextattr allow.nomlock >>> allow.nomount allow.mount.nodevfs allow.mount.nofdescfs >>> allow.mount.nonullfs allow.mount.noprocfs allow.mount.notmpfs >>> allow.mount.nozfs allow.nonfsd allow.noquotas allow.noraw_sockets >>> allow.noread_msgbuf allow.noreserved_ports allow.norouting >>> allow.noset_hostname allow.nosettime allow.nosocket_af allow.nosuser >>> allow.nosysvipc allow.nounprivileged_parent_tampering >>> allow.nounprivileged_proc_debug children.cur=0 children.max=0 >>> cpuset.id=0 host.domainname="" host.hostid=0 host.hostname="" >>> host.hostuuid="" >>> ip4.addr=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.0 >>> ip4.nosaddrsel ip6.addr=::,::,::,::,::,:: ip6.nosaddrsel >>> zfs.mount_snapshot=0 >>> desc=0 devfs_ruleset=0 nodying enforce_statfs=0 env="" host=disable >>> ip4=disable ip6=disable jid=0 meta="" name="" osreldate=0 >>> osrelease="" parent=0 path="" nopersist securelevel=0 sysvmsg=disable >>> sysvsem=disable sysvshm=disable vnet=disable zfs=disable >>> allow.noadjtime allow.nochflags allow.noextattr allow.nomlock >>> allow.nomount allow.mount.nodevfs allow.mount.nofdescfs >>> allow.mount.nonullfs allow.mount.noprocfs allow.mount.notmpfs >>> allow.mount.nozfs allow.nonfsd allow.noquotas allow.noraw_sockets >>> allow.noread_msgbuf allow.noreserved_ports allow.norouting >>> allow.noset_hostname allow.nosettime allow.nosocket_af allow.nosuser >>> allow.nosysvipc allow.nounprivileged_parent_tampering >>> allow.nounprivileged_proc_debug children.cur=0 children.max=0 >>> cpuset.id=0 host.domainname="" host.hostid=0 host.hostname="" >>> host.hostuuid="" >>> ip4.addr=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.0 >>> ip4.nosaddrsel ip6.addr=::,::,::,::,::,:: ip6.nosaddrsel >>> zfs.mount_snapshot=0 >>> desc=0 devfs_ruleset=0 nodying enforce_statfs=0 env="" host=disable >>> ip4=disable ip6=disable jid=0 meta="" name="" osreldate=0 >>> osrelease="" parent=0 path="" nopersist securelevel=0 sysvmsg=disable >>> sysvsem=disable sysvshm=disable vnet=disable zfs=disable >>> allow.noadjtime allow.nochflags allow.noextattr allow.nomlock >>> allow.nomount allow.mount.nodevfs allow.mount.nofdescfs >>> allow.mount.nonullfs allow.mount.noprocfs allow.mount.notmpfs >>> allow.mount.nozfs allow.nonfsd allow.noquotas allow.noraw_sockets >>> allow.noread_msgbuf allow.noreserved_ports allow.norouting >>> allow.noset_hostname allow.nosettime >>> [...] >>> infinite loop >>> >> >> Adding jamie@, neither of the changes to jls(1) should've caused this, >> as far as I can reason about (and I haven't observed this here, yet).  >> This looks like a failure to terminate the print_jail loop at the end? > > I still can't functionally update, but looking at the recent jaildesc > work, I wonder > if this is a side effect that has since been fixed in > e75dda31c1eead9ad40580bd8 by > removing the "desc" parameter. It would have been included in > 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 MFCing it a day early. - Jamie