From nobody Mon Sep 15 02:30:02 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 4cQ8Bg4qbkz67sdy; Mon, 15 Sep 2025 02:30:03 +0000 (UTC) (envelope-from kevans@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 4cQ8Bg49CFz3pXn; Mon, 15 Sep 2025 02:30:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757903403; 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=kdfNwAAa1b+fNjKrXYAIb7p5VOhytlBuRnEOlvzIeBA=; b=ARjxGbMOqUDS3db+J4O6tsZy9jJJ+afoMolwMOYrG918qiKAKt7xXA3jXAQWpNPAvLG3ZK mIA6Emm8hlDV1iX/aSdIMDNgpKaC3eDC/tpHuXVFRXzxUM6SlOl7O5wIjuTaehD5Jj1HoX AGV8uD2i1mV+yka+Og4N1WrG7bQovfFMoJqapzlwXPVGxqrXQeqcR20P0SX55Kbpxx9lZI 2SnZoMXTCz6+okuqt60F2yfiiO5xiawIsmjQH2lVpCQnq+lZr6AEtAW5C62cjsZ2eIuXA9 iB8o2MsG1xwMSo6RSy1p4+1LHORx2/zh1vhtGg9pZs/dhseFRhcErYnMpVCgyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757903403; 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=kdfNwAAa1b+fNjKrXYAIb7p5VOhytlBuRnEOlvzIeBA=; b=nE/pXx2WFP67WFTh+ZXOg9cmlgGcNAcOAgcm4V6MumGzmO+EuNqoiT+oXjDm0Tnywao880 XkA80VoMwf62/sCEJrxHJ+qcNSDF6cYhc0Xaffavbow58XY4rB8wgl2dnN2CSYkjxP1p7A aq93GgE0YH8LTPik1alBoVZ51JMDX89OFDzythz0RFUpkFWhjEgpn5uPYaHa9/it2o8xj3 eBVr5RQ2bQqXklFvMuz0D8Lei0CMtAo6ZRXlaGE91gMwohWj4jX6150RyvT9ynrQMcOOrK LTTvZFwr2uq+4bcdBOcbZb4FXIPKy3CbLTftbgIRgGfGu0POFqP21ml1NuvbSw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1757903403; a=rsa-sha256; cv=none; b=chLndDHJIU4+MUCB6KL/DRuW8B1ZPnR35bHntl+ruEx86mVeS2DEmmNQdOKAbysz2c4i98 gUHWBZzlmZBUGmQ5zqHFkvzDXOrIr8Df/Er8l0l0u8vaR5bScgUrIVCSfTZINAl1K+IG7j ikA0Z5vR+Sn6lQ8nDJDqfyDz6JkQeXLj8/mWCZcMyX2rc5BndTent8J/Re15/R/gg+/RCQ kGZxXEgK95ohi+zklEZ9DDii6L3vnWv11TT9ZISnEz8/sf4iAzlvUj+q5tfXle0pSEXiFX VNDXl7Ke43KLrVALFfi0O4iUrSF3zPEfdHuGHmXz/B5PSbdlaRNZC/BSNBksGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from [10.9.4.95] (unknown [209.182.120.176]) (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) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4cQ8Bg0cVpzpRq; Mon, 15 Sep 2025 02:30:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: Date: Sun, 14 Sep 2025 21:30:02 -0500 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 User-Agent: Mozilla Thunderbird Subject: Re: git: dbaaadd4373a - main - jls: minor simplification to arg handling From: Kyle Evans To: "Danilo G. Baio" , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Cc: James Gritton References: <202507260314.56Q3E5cY002869@gitrepo.freebsd.org> <54e7f090-c031-47f2-bc51-c020a77ab00a@app.fastmail.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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?