From nobody Mon Sep 15 01:00:54 2025 X-Original-To: dev-commits-src-main@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 4cQ6Cr294Vz67mNG; Mon, 15 Sep 2025 01:00:56 +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 4cQ6Cr1TQXz3jkm; Mon, 15 Sep 2025 01:00:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757898056; 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=SJqx6rs8OGgTffmC2BwzN/DorYSgvL5/ArPU6ArS7b8=; b=Q6NBcLCIXspH4chZFOuJzyrEs5Mf1saC0Ht9Ax0C6UULtJc66UinpD0dM9SOMix3m+DEFk Djx6MDEbOK4CLUlgp+dfISQzso++kjY8TcTmuWvrRCZRAdS8QMn74KXGlqhUgDyZLJhkXd 3XWho6rUYdWr+NVsJg8Fyj70b3mNH57VZvZoT/xb2ikficT95Bt++Q5NJZq8TE4BHNNTZ5 wF1DVUHEfZZM9iv10lekU00oaQhrQIbmhqopekOMT4z3hhx/8P5nW6f5l8V5Z4SpEbH4hm 4iNuek76H2uRfqvJENQI+y3CeGa474MX50Z5LrV6MKqZgLbTeF7dXym67+KUEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757898056; 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=SJqx6rs8OGgTffmC2BwzN/DorYSgvL5/ArPU6ArS7b8=; b=TJrU4FY4HXZIZXGZlQh2DhodYgDOoU/NnnT9HlUAhbsG3h7U+Ywx+//GUwvNvGSnEVmkgq m20u8pf8eCJE0kX/E0UVO92tv2yz15yzFvwskwbva+eUEAOFbtN4gY6p10vRyaCYc0kYHP QeF3mwqI1l7hsnQSO1uXWCkkvi7AhGMzr/JUhoMEBOJSgYwVp1Jxxyai0oHKqwajzVn8Lh bcL4yJV/y5womacfD7Uho8FDT3KD1YQ8z29U+gMvyk/XiE2Xbw7jSZ6e3hiHKkbae7wjGV v+QUpkmq9dIpXTvxRS5ZfhJndqivl6CGbXvxT1jZtoLrD8xpaHxJRk209tnxiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1757898056; a=rsa-sha256; cv=none; b=N9vJmG8WxuyntcbCemJE43YckYN6uiJC373R1CuUpDcp0BBW5Yhzg8dx24fY4HySPIfGC/ QWGusFLnExEOabbpZOJIJFqD9nPYD+NyFIjScqvE0Di14ZAO501yfPY5Nn58Q2mbAtyxJ/ mKRVlDAZMmxWWQ+3jAXYlOzvWlqzWeBaeMQk6XFqqS332c+FNeF4+YMiC6nAjMOu7kNRad ztMC2kiGYTNaggMn7doMxNjagAHAHF76Fysxl9iUhqZeta2fB04H97IBbAarEWWLsmL8Rz OtGeSKMO0JYItAD2Oxsiq2auwOyWd8GdsW3g/ErJwKBC/iOJtXFLEimEEbXT5A== 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 4cQ6Cq4vkbzqFL; Mon, 15 Sep 2025 01:00:55 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: Date: Sun, 14 Sep 2025 20:00:54 -0500 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: dbaaadd4373a - main - jls: minor simplification to arg handling To: "Danilo G. Baio" , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202507260314.56Q3E5cY002869@gitrepo.freebsd.org> <54e7f090-c031-47f2-bc51-c020a77ab00a@app.fastmail.com> Content-Language: en-US Cc: James Gritton From: Kyle Evans In-Reply-To: <54e7f090-c031-47f2-bc51-c020a77ab00a@app.fastmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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?