From nobody Mon Dec 1 00:46:35 2025 X-Original-To: dev-commits-src-branches@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 4dKQFm1LXhz6HXKZ for ; Mon, 01 Dec 2025 00:46:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKQFm0Vqdz3RMN for ; Mon, 01 Dec 2025 00:46:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764549996; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1CU8AH21zU353VYc3mJthroFz387T4MgqX8ROFU1H6k=; b=LIAWSHWBoFNsQzGAmjTCUH2j0NBautZ6CtJk8jWr+vYBmGN0tFrtEA0M/Du6sJXFKmPTru 9nXPFGDfvOPzHEFydYyN8vWux0dAlfNQ/zhduthmvruxR9BHzUSicsInUvhf65RRcFw8yE aVJy+CtTSTlv5g/7aKpwSiov3DNau/l79PWOP1cSC2ETF/mPl9GSZsY9h5ERpgQ315HxUq fFbgYLZnbDHgu2dVIUx0APeN7KQ1Zyzsef3MBQXdKRjHtISJhmSIyQKfa1j40PDoccKb0H rO9CG7rkYJFwsne0O0huz6eegHTdXdlQ/kJiiW0HsUrOT5bOrR2QAbqzPpXmFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764549996; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1CU8AH21zU353VYc3mJthroFz387T4MgqX8ROFU1H6k=; b=XcbSohUg6biQ8vWjN0S54mdH9ymhJasU10x5xXJk66ZVZlh04VaejXwEFLtgJf0udYXKAY UopoBc23mIvBX1ObkbMNv4BW55YNd2Ehex5faV+PU61rhxMDHqWuUMFZ/FIr3+RpFhIvpl kYaqXyr2KPmxRR315jn3RPunyyOkcs9o9pxoxALy1orgymmzYHBv8rz8pjePwQ74QIjaxs pd8ArSABXDX1ajZHsTnztxrZ1p0qmYkciwQztHrecKw71SKAkymJhjSN8uebrvxcVawRGv ljZ8hzcqAboGCuqH8hZSzTtstUD1UOpqTRiwK8r+mcInAV5Y1azZoFDIdU+UTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764549996; a=rsa-sha256; cv=none; b=tSrMNqvVrh4K+KkBNCbwVjfb/mKBqsMjpPNARyNZ2/v5c08FsgG4DxGnrOnpD3RlydaT6+ StlH1bYEDBgrUJ6jLNvHKqJM5loIHWbvRXu0PAM2YoCAlk06xrWZVz48ky44ZFJQPMgbnS oF/Cub+xJK6TsKQdMchJMdPNa3RTngkq6XtM1MkAM+jfLLPpbjKzdbg3Mddcndy3DIBGKv +pFIFxfyN4Pr0OUFjncJ+EZLUYxkXoXnDcZqe00Yu/MRkWwpt6JNGvDwvQSRsjQyXKLlsn HZIAaUMEq5TSvojk8ifgpYunPt3ktP8mdDLUGIisx+orCohRF1bOZSmOG1Tehg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKQFl6f6Vzygx for ; Mon, 01 Dec 2025 00:46:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id de9a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 01 Dec 2025 00:46:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 10f12fbe67ae - stable/15 - vm_object_page_remove(): clear pager even if there is no resident pages List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 10f12fbe67ae07b7e321c2def4ef93fb126695e0 Auto-Submitted: auto-generated Date: Mon, 01 Dec 2025 00:46:35 +0000 Message-Id: <692ce56b.de9a.6e0563d7@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=10f12fbe67ae07b7e321c2def4ef93fb126695e0 commit 10f12fbe67ae07b7e321c2def4ef93fb126695e0 Author: Konstantin Belousov AuthorDate: 2025-11-22 20:39:27 +0000 Commit: Konstantin Belousov CommitDate: 2025-12-01 00:46:09 +0000 vm_object_page_remove(): clear pager even if there is no resident pages (cherry picked from commit 72a447d0bc768c7fe8a9c972f710c75afebd581b) --- sys/vm/vm_object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 5b4517d2bf0c..413ba5459e3d 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -1988,7 +1988,7 @@ vm_object_page_remove(vm_object_t object, vm_pindex_t start, vm_pindex_t end, (options & (OBJPR_CLEANONLY | OBJPR_NOTMAPPED)) == OBJPR_NOTMAPPED, ("vm_object_page_remove: illegal options for object %p", object)); if (object->resident_page_count == 0) - return; + goto remove_pager; vm_object_pip_add(object, 1); vm_page_iter_limit_init(&pages, object, end); again: @@ -2061,6 +2061,7 @@ wired: } vm_object_pip_wakeup(object); +remove_pager: vm_pager_freespace(object, start, (end == 0 ? object->size : end) - start); } From nobody Mon Dec 1 00:46:36 2025 X-Original-To: dev-commits-src-branches@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 4dKQFn1Jtfz6HXGt for ; Mon, 01 Dec 2025 00:46:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKQFn0Pp9z3RB9 for ; Mon, 01 Dec 2025 00:46:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764549997; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k36rtyfQt6gWpz3F5mRNEiwWkskk3epDxuzZ24nYfNc=; b=gzB5HnIb7N6oLrvqz4FHxAu3uqLqvoAh0kMH34REEPkVitb2NfI3c8sPAaC2iO4U6ywzqk WTrtO1o+QEGWmFZ2JdOezKWglVqBOvLCz7DUwbhP/9vb8RDAmaq01umD8/3vjHSufyj9pa BWHRWZdroWOMT6t2A0RamVveQRwCZtJTgUhFxTcCpvvXtvS6W+uOqfuHd2Q8KcWWoDiBMS 1xfu9nGbGHH3pkGz2V9ZvgJuFtW+yXXnqjbAVYOcg7cVaMr7jzr/lxbD8blsnQDab8k5sd bBcEKbS+SZ38yks0fc1jIMMIgHmBxgoWXHVGQL8I93ZWFcyu9EKa5b3mu45F+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764549997; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k36rtyfQt6gWpz3F5mRNEiwWkskk3epDxuzZ24nYfNc=; b=ohv1fss+OgSXknFl2pYPvzvugITeG8rDguzN268Sxwf+GTums4WKCG3V3PigAeC/xLhgrl 1wRCZMJN0DcNiyk8hFBYJ3N3aGG3ZMat0ngS28RinXGOkn1cPWftGQOZQ5aAMJnUNTDFpP 9yzrI1A9/TH68XWomMAdOjqopQwtASG/2/cZmvzo35tALBQs3Lu+bn0dsaA+yGwtP7wtnP 6l9azVZ/UJKIweR8n/FUwLR0BDkZWXsJ5/+4axUP3BQ441XPlfFo/9zNigUSRS3B7TzQ1H QHSBBjzRKypvr+opjiHV/L/omUgbGkveN8tjqLhcBXSl/MQBFFYrmvRMc4aUAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764549997; a=rsa-sha256; cv=none; b=e3X81700o4yEJ0G6UlIm8NbA/UeoW6Q17ax5I17cH3rd2cZySijziRSynFV8Yeh9IEkItZ 0Sbpjn4BbIoWZvq3W+26CZdAwsRVu/QlT6Iivpr1nTiHXLQKqpE9Klc9t955pyBew72q9g EzdFrUvs4PZC3Y/SIcEGI1hgGoFhBt96NMximlRSqYnf2WKPLVpgTl+yuGcjVBUP/VBoo3 IBRyzzDyKrGwhyFX7KF1hS7Nm6YVmFIdg+/BVMTb0AV4gQT+6C6XewXUWppDkkN/6JWarH F7pHjh4NL37iaSHdz+5YVQHffeUGKNdxdnmpHhpFL2Y52QSc6rYTOkMRYjttaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKQFm6pxJzyZH for ; Mon, 01 Dec 2025 00:46:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id d815 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 01 Dec 2025 00:46:36 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: ba5ef9dfa8e5 - stable/15 - bsd.lib.mk: document INTERNALLIB and PRIVATELIB List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: ba5ef9dfa8e54f4ee74d85bab0f2cb0ffcca7622 Auto-Submitted: auto-generated Date: Mon, 01 Dec 2025 00:46:36 +0000 Message-Id: <692ce56c.d815.16710a01@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ba5ef9dfa8e54f4ee74d85bab0f2cb0ffcca7622 commit ba5ef9dfa8e54f4ee74d85bab0f2cb0ffcca7622 Author: Konstantin Belousov AuthorDate: 2025-11-27 16:41:29 +0000 Commit: Konstantin Belousov CommitDate: 2025-12-01 00:46:09 +0000 bsd.lib.mk: document INTERNALLIB and PRIVATELIB (cherry picked from commit e60861eb41ca9d141a0d967db3ecbe2b2909c300) --- share/mk/bsd.lib.mk | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 159957b6300b..e3b3d760ff28 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -1,3 +1,18 @@ +# If INTERNALLIB is defined, we build lib.a and lib_pie.a, +# i.e. only static archives without dso, in both non-PIE and PIE variants, +# suitable for static linking into binaries. +# INTERNALLIB library headers are not installed. A component that uses +# the library should add explicit -I$(LIBDIR) to CFLAGS. +# +# If PRIVATELIB is defined, we build and install both libprivate.a +# and libprivate.so, so the library can be linked dynamically, but +# cannot be picked up by third-party configure scripts. +# PRIVATELIB library headers are installed into include/private/. +# +# If neither of control variables are defined, we install headers into +# include/, and both non-pic static and shared libraries under the defined +# name. + .include .include .include From nobody Mon Dec 1 00:47:32 2025 X-Original-To: dev-commits-src-branches@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 4dKQGr6ycgz6HXXV for ; Mon, 01 Dec 2025 00:47:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKQGr5vpnz3RxJ for ; Mon, 01 Dec 2025 00:47:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764550052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GWRX7h3F2flUoyQukXjFXvG1XCZ4RjtdNVitY64bvJs=; b=Ij2pHTHCkdcbghlCHtuHkom0Uf+gGAmor+GeaNh/7IInVX/qEc1MZK6CfdOOGc+adeShJ/ 2QCBNxizRRsUFyRxm0p06WQMEzOaBkGYThoYfu8zQuE0Q60qLYrSx7+cg8SKu63wdyTcLq rsmNUPhCyZk/tGcwx/HIuf6yq2umYJZWNSpQtkV1GcHURNhLehi2d7QeJtd3aahabvHjpm ste0wggQz8Dzv76WnniYQ+RLX5jTaXq2aoq+t4XuvmwHq1iEVzEU0Ls91qlFqYRdIsjqX5 yfh6TgEJcT3mhJAGyiybI6QalHRFsFN0kJraGnkp5vjqHHk26f1KV3BOzv17kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764550052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GWRX7h3F2flUoyQukXjFXvG1XCZ4RjtdNVitY64bvJs=; b=i6vIGmUYaWr64NNtzKPgKING+qE5lQeoONMHt8qf/Suokq2mrAWOk9TGLUpsMHE4SULNm2 kjuvtqBNP46lE74Ajxhf6zr4ds1S2KphR55wpDNMzshQK4U5CNBwqMtHyDeYWSZr5v+dlc BJoZ6/gf5ebNELR2eG0XhyIC2hCSmFIfDBmKQ8qzSMqjzzn84HTjxhByST99WEeBhlF9tK dHrSMWNXLY3mGhYtgaxBej662Vgy0bA1F+HId2vS274J10OC/oYt+uBbcFjh7UboRu+S5a Bw0l/oTbu0pQCpkgFoL4gOUpTzYcYqNrwbEqi6FCJS3ECpcWNfIFER7GCTMluw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764550052; a=rsa-sha256; cv=none; b=mLrgdbmqH9/37gVuL1IpzsEJk7HB5KpNKiZ4ACWmW7jA15tvAJy2eQSnmEjt3M3tma/8um 9CeD/Mp0vp3eOFDPBhmSc+MxVelzZlKugF6mP5hiHWdXXd/dQbbWEtcjnSstfFHPtYijkK ecCT+6CJ4qzWdOnkuprGhibNaokcj6hAMsqvqC9IBbsrvr6hFKFW3koY/bkEmOoVDxk3FJ hHi6oHnqzODWY5Mgg+RN2IVbBKZUlc6EB1jjmOX+CF8mt5PBTtpajak/Jn04co6UTx+dul vT9CTsRniYewgDAxybq544sjMuNlZHp+qQVE9jMKREATD4I8IW369BptijlvuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKQGr4zh2zyMP for ; Mon, 01 Dec 2025 00:47:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id cc44 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 01 Dec 2025 00:47:32 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: feac4c32a5f8 - stable/14 - vm_object_page_remove(): clear pager even if there is no resident pages List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: feac4c32a5f87434a17a804d8148cea78f81ebea Auto-Submitted: auto-generated Date: Mon, 01 Dec 2025 00:47:32 +0000 Message-Id: <692ce5a4.cc44.781ef6aa@gitrepo.freebsd.org> The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=feac4c32a5f87434a17a804d8148cea78f81ebea commit feac4c32a5f87434a17a804d8148cea78f81ebea Author: Konstantin Belousov AuthorDate: 2025-11-22 20:39:27 +0000 Commit: Konstantin Belousov CommitDate: 2025-12-01 00:47:07 +0000 vm_object_page_remove(): clear pager even if there is no resident pages (cherry picked from commit 72a447d0bc768c7fe8a9c972f710c75afebd581b) --- sys/vm/vm_object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index aa8044c10665..ff164c03c5a5 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -2088,7 +2088,7 @@ vm_object_page_remove(vm_object_t object, vm_pindex_t start, vm_pindex_t end, (options & (OBJPR_CLEANONLY | OBJPR_NOTMAPPED)) == OBJPR_NOTMAPPED, ("vm_object_page_remove: illegal options for object %p", object)); if (object->resident_page_count == 0) - return; + goto remove_pager; vm_object_pip_add(object, 1); again: p = vm_page_find_least(object, start); @@ -2164,6 +2164,7 @@ wired: } vm_object_pip_wakeup(object); +remove_pager: vm_pager_freespace(object, start, (end == 0 ? object->size : end) - start); } From nobody Mon Dec 1 00:47:33 2025 X-Original-To: dev-commits-src-branches@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 4dKQGs6s7Tz6HXQh for ; Mon, 01 Dec 2025 00:47:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKQGs6DvWz3Rs3 for ; Mon, 01 Dec 2025 00:47:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764550053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PIqIB7jRvvzzWoKvgSz7aUegw47d8P6FtpoM9YqmREI=; b=mllUQZq8xSek7cfuffm6lAOCd3E6N49GtBXcmgmdPo4KixnrZ5eUoY2oKIaVEngvBkC2mH DZeVmsvL5c5eSw2gB8DNK4Ob/+yMejY9h7JKh/Kb7g3Ll+sbn4MenzeHIWJ+iggXzpCNMQ 4/IPafE4ju4/vvk8bWabWENuNio24XsE1cjbNIt1y4gAFEvTlXSef41WmY8ooayRHnanC0 aXa60oOiVZKzfdw7Xw8HhzgNWXIgFimGR85Wsf4V6vO5YsOWJWbU1ZsEZVtmf84x2cdRgm 08uuEghWFZ2UlsP33cIQnLgXN8utDtRvtCX/TRT+WT8EFfZAQVrKK0n4ViRD9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764550053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PIqIB7jRvvzzWoKvgSz7aUegw47d8P6FtpoM9YqmREI=; b=gxfDhcpDwuam6l9RPXN3ozBwH3Gvq0rxpkvYhhFkr+8RlM7+PeseTmYq/xKp7quWNitVks nFdK+Xb7G7TeLSMOrStjLKlFrsv+OwgQXi5zsMoZB6rq1OND+f/ez16iSVubPitaQsyc12 L1kLBh6Z+Xvo2ThZhD33m4ypQIUGUD3V36TP3uszv2t7yLrnODXpgV6JJmEpRtcZE6MMCQ 9i/D85aDmdGF8Ln2Tvn2YjPiv4/+9GegPJ0ZjiRxhr6jIaBd4zfHXgBj0ojd87olXag+CD KCknpOasA7S1ERFpv6dPzpenKBwnvUkkzZ7cV7O5mqn+6rzTuitQSvybOKr7XQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764550053; a=rsa-sha256; cv=none; b=kJ2Mg/EruZMaklz4HYiWuMvc7DN0t8w61WVhCkz1//JlRgf6oUKPdpBlJ9cENKdYwUmHPX uQCzz7EgE/dGGHKALxoFPLutYN5iX/gQ0JlWq6sl/gFa3Ndkbv29WbDoUXW9Sn31DL8aMI wLNmY+GvtrligSMY10LxCpQsMSaS7uKxaS5TeaJQZSra/1E4VYP8hMsjBuWeJZxHTqYII5 coJZyciuKhBn5vvzcCqgC8FSU++cwfKlCPXHxIu19/A1iTlbeg5bfCzzJKzb+5ph8Myg42 LM/ydGmjDQoGwFi2Q1tP1ZVeYiFlHXtBqcXyvMxofjn/+GKPCDLBUhMPGjvJ9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKQGs5mSRzyKD for ; Mon, 01 Dec 2025 00:47:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id c9ad by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 01 Dec 2025 00:47:33 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 7e356823ac3a - stable/14 - bsd.lib.mk: document INTERNALLIB and PRIVATELIB List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7e356823ac3aa648ddb42703b6a7254472d4bb81 Auto-Submitted: auto-generated Date: Mon, 01 Dec 2025 00:47:33 +0000 Message-Id: <692ce5a5.c9ad.231e6b27@gitrepo.freebsd.org> The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7e356823ac3aa648ddb42703b6a7254472d4bb81 commit 7e356823ac3aa648ddb42703b6a7254472d4bb81 Author: Konstantin Belousov AuthorDate: 2025-11-27 16:41:29 +0000 Commit: Konstantin Belousov CommitDate: 2025-12-01 00:47:08 +0000 bsd.lib.mk: document INTERNALLIB and PRIVATELIB (cherry picked from commit e60861eb41ca9d141a0d967db3ecbe2b2909c300) --- share/mk/bsd.lib.mk | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index f2ed34b11edc..17a5ac969860 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -1,5 +1,19 @@ # from: @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91 # +# If INTERNALLIB is defined, we build lib.a and lib_pie.a, +# i.e. only static archives without dso, in both non-PIE and PIE variants, +# suitable for static linking into binaries. +# INTERNALLIB library headers are not installed. A component that uses +# the library should add explicit -I$(LIBDIR) to CFLAGS. +# +# If PRIVATELIB is defined, we build and install both libprivate.a +# and libprivate.so, so the library can be linked dynamically, but +# cannot be picked up by third-party configure scripts. +# PRIVATELIB library headers are installed into include/private/. +# +# If neither of control variables are defined, we install headers into +# include/, and both non-pic static and shared libraries under the defined +# name. .include .include From nobody Mon Dec 1 03:48:22 2025 X-Original-To: dev-commits-src-branches@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 4dKVHV5J72z6HtGP for ; Mon, 01 Dec 2025 03:48:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKVHV2ggpz3mdS for ; Mon, 01 Dec 2025 03:48:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764560902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j1Gm9sjzvb879sjfWjj6iNjZBOC3ypvJ7zDv5dB2wvo=; b=aL24MOoFxaglDAlvLMD47azkuP6dA2KHkmNS6yDVZv3j47e3M60HpGHY2yBumlC6SqinYZ WksPt+kbEOEzJOtfzI51b8bZzq4M11pFJ2GDojH/k8ue8/Wj6H6ePPs3qdOCmCTocQbtHE tzpNDWMu4aP2WFeaqSN1WYxoU/oxyZv49pFZHzdYAix2Hf+0kTNgeiqnSQNO+ozVNsOv4/ d5Fi6aiJJS3t40YF3vfEaV0VCu1h6QFhtYoPB0jXOj2NR/9Ej7OVbE/wiVyaOGKFlnzABT zF3RA3F5ANJmYiDBeG1+kwfvefafPEhUlAXyEsyzwf4lpIrL/WpC6naXyPcS6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764560902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j1Gm9sjzvb879sjfWjj6iNjZBOC3ypvJ7zDv5dB2wvo=; b=fEB+07K+x89mXI4QbiT/KKL8PFCSbJ1RteXk2Sp6rCCLCB6rFhTp+Llz9x/X2Iuoz+rezF Six6Meu2LxeBh+jaMTBiLCD8+5Iy/OlMpEbuGWyL01nF4yeJpXwjY/6hiEFUVyE/oKoFq7 1cDl4drKJGwJ4NK6p353/Wy3/1s09V4srpHCVGut9wdr0hA33mZ+mpasmBBFrc5as9cPM0 yJnZiNisLsrXpdUwd165Xx2ZIWHd63RcXbX0m7S5OpuOJqwY8c1lcB1MpdqbcAqhBNLp8w HNLk/25v5R4afzvmKKnitF0hLjXwVq0W6KIV750FyiqIleQSTOw6AsXg63Rpdg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764560902; a=rsa-sha256; cv=none; b=ZE7hxG2+hI0oNQTYp91Mnu/Xfhe6ZunU5bsDXSERmWLaQTY2T2zyoS9P1xjUo3PE0zQGV1 NuPWNYzQE/wnhAZRBT8eqD6/bYSOAbb9L5F1FpjsoW2+JT00G74VMfpgnqOYQBFP9ii/TC +JOZjhORexZ4221N03uaEQsrT3iadbpnaeK3ujcJSrKiYskAJoR1b5KBz7Ysf8bL9rjiTR G+d+7JbwzVZnaXT2l2nZ+iCHYPYO9R07WeVoWt370Y4hSDnsnyYqVUrpe1Yg1z6s4b0/nb +IwwRS/SCK3qj0XVecMfKZlkU+roSRNd361Nr+ol8WJqhkfscjVIG30BQvno5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKVHV2D3lz14LY for ; Mon, 01 Dec 2025 03:48:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2fbc5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 01 Dec 2025 03:48:22 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 05e683f3de7f - stable/15 - exterror(9): add SETEXTERROR_KE() macro List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 05e683f3de7fb7873c48a4189b47c1d92eae7fe1 Auto-Submitted: auto-generated Date: Mon, 01 Dec 2025 03:48:22 +0000 Message-Id: <692d1006.2fbc5.6e0ec4f2@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=05e683f3de7fb7873c48a4189b47c1d92eae7fe1 commit 05e683f3de7fb7873c48a4189b47c1d92eae7fe1 Author: Konstantin Belousov AuthorDate: 2025-10-25 09:12:33 +0000 Commit: Konstantin Belousov CommitDate: 2025-12-01 03:39:09 +0000 exterror(9): add SETEXTERROR_KE() macro (cherry picked from commit 7746b51dae12b09266d02f02f8d3b772282ddaf1) --- sys/sys/exterrvar.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sys/sys/exterrvar.h b/sys/sys/exterrvar.h index 6783a0d2d84f..5fce8ae7ffbe 100644 --- a/sys/sys/exterrvar.h +++ b/sys/sys/exterrvar.h @@ -37,6 +37,26 @@ #define SET_ERROR_MSG(mmsg) NULL #endif +#define _SET_ERROR2_KE(kep, eerror, mmsg, pp1, pp2) ({ \ + (kep)->error = (eerror); \ + (kep)->cat = EXTERR_CATEGORY; \ + (kep)->msg = SET_ERROR_MSG(mmsg); \ + (kep)->p1 = (pp1); \ + (kep)->p2 = (pp2); \ + (kep)->src_line = __LINE__; \ + (kep)->error; \ +}) +#define _SET_ERROR0_KE(kep, eerror, mmsg) \ + _SET_ERROR2_KE(kep, eerror, mmsg, 0, 0) +#define _SET_ERROR1_KE(kep, eerror, mmsg, pp1) \ + _SET_ERROR2_KE(kep, eerror, mmsg, pp1, 0) + +#define _EXTERROR_MACRO_KE(kep, eerror, mmsg, _1, _2, NAME, ...) \ + NAME +#define EXTERROR_KE(...) \ + _EXTERROR_MACRO_KE(__VA_ARGS__, _SET_ERROR2_KE, _SET_ERROR1_KE, \ + _SET_ERROR0_KE)(__VA_ARGS__) + #define _SET_ERROR2(eerror, mmsg, pp1, pp2) \ exterr_set(eerror, EXTERR_CATEGORY, SET_ERROR_MSG(mmsg), \ (uintptr_t)(pp1), (uintptr_t)(pp2), __LINE__) From nobody Mon Dec 1 03:48:23 2025 X-Original-To: dev-commits-src-branches@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 4dKVHW5cHLz6Ht8B for ; Mon, 01 Dec 2025 03:48:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKVHW3Y26z3mgt for ; Mon, 01 Dec 2025 03:48:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764560903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pKneJqnxdbBQJr6TK1a4VWSDnhnTu1GDQLBhWge2JuM=; b=CWV9PJ5G6NJ+h7qUpOlyOdf5KDp8FmSthvhhtArSSj21Wbxea/XHOsMjEFxSxSQ3S/2UWS 0Kh/k7demAkPDGU1Npc1C+fC3HTgt980idERoaNLP5q6n9/nSSgDXRl5PK33/nzsnY6tiT CLqRQVmTQZScOYCpqQqw1X8GgeVpbVDwmPhNZmpJYQ+6svxbJpJlVwMu84RPd1ESkiBszI 9q+dmnr+UT1/wzl+RGYy9GzfI10Xtv7eMbFT+vAP5UQTY778p8upqvW4SoHsY5vY18jx3J fG09bps/d691tkSJcnfuaUgbFcdlk299Ts0Q8An+meB8OzlrGCStoorrlTeNaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764560903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pKneJqnxdbBQJr6TK1a4VWSDnhnTu1GDQLBhWge2JuM=; b=mLrf9IVhPFbPcW3kcNCUho5q2wSnot6369FzaxUPJa2zS3Shxj/9npomF3WfMP3uQkdwAm fiAJlJcdd3mYTMwXKUWVGXIJYJjZ9JV18ZGEsXEjoqEMXPASVAHKfOqGAZCP2mZx0g+prZ vItdvyd0Ft0UCFyimUuxaKElLnaCxXMndnLIVIik5vH3yfPng1v/8rRba2vpE0jbMNi1Dh J5KKEU7jB1nxKHmXkuZqTN2l9fiL+UyQFsSort13OslUbx/7kCukIyTXwHzPldMVuYhlf8 HmP7iq2u3b1SbJNAqH69VLtNHEtFE+wrsPDFVjG+DtOVL3H83WZc+bJE+Rgw5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764560903; a=rsa-sha256; cv=none; b=KbdmD549uKzvhuseHy2cKxcert0OIljsMw6Ao09YBXHnhAxkaQ9NrFf1H3oIUbUmPDb1jq ACz8chWXBF3T5N29KndJdAhNd6ijq3PoGtE0V0Dh+bRNI76Vnr6Tu6Xfxoc37dUmmQOLkX D0Y7/Bv30JDIXDYHAIdsP3p7+gDU0YgF3BZS4/keMN/1hEmeiNZ8Klkk69hYmdIcADckQx oZ7INAyiDNjGTB3h06y3ieg1Bpg5Nc4l2oiRCs5PsLAuIQYPoQQRFKNRzYGvo+Cdwts9px X2pf84EIBAICtZKHDYF/8KtWUOowp5zbFGAKYib9+qm2xhvqtGbXM5kBxihuRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKVHW2yTxz14Gf for ; Mon, 01 Dec 2025 03:48:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2fc4d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 01 Dec 2025 03:48:23 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 0e1fcec72a05 - stable/15 - exterror(9): add two helpers List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 0e1fcec72a0515749b5dc9b7baeca4d345b49c62 Auto-Submitted: auto-generated Date: Mon, 01 Dec 2025 03:48:23 +0000 Message-Id: <692d1007.2fc4d.7590e5f5@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0e1fcec72a0515749b5dc9b7baeca4d345b49c62 commit 0e1fcec72a0515749b5dc9b7baeca4d345b49c62 Author: Konstantin Belousov AuthorDate: 2025-10-25 09:14:59 +0000 Commit: Konstantin Belousov CommitDate: 2025-12-01 03:39:09 +0000 exterror(9): add two helpers (cherry picked from commit 069e2fb5506f8301cd9e2da1946c718bd268c50c) --- sys/kern/sys_generic.c | 19 +++++++++++++++++++ sys/sys/exterrvar.h | 2 ++ 2 files changed, 21 insertions(+) diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index 5606b36f772f..79628f1389e4 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -2339,3 +2339,22 @@ exterr_set(int eerror, int category, const char *mmsg, uintptr_t pp1, } return (eerror); } + +int +exterr_set_from(const struct kexterr *ke) +{ + struct thread *td; + + td = curthread; + if ((td->td_pflags2 & TDP2_UEXTERR) != 0) { + td->td_pflags2 |= TDP2_EXTERR; + td->td_kexterr = *ke; + } + return (td->td_kexterr.error); +} + +void +exterr_clear(struct kexterr *ke) +{ + memset(ke, 0, sizeof(*ke)); +} diff --git a/sys/sys/exterrvar.h b/sys/sys/exterrvar.h index 5fce8ae7ffbe..1e07f6afb547 100644 --- a/sys/sys/exterrvar.h +++ b/sys/sys/exterrvar.h @@ -69,6 +69,8 @@ _EXTERROR_MACRO(__VA_ARGS__, _SET_ERROR2, _SET_ERROR1, \ _SET_ERROR0)(__VA_ARGS__) +void exterr_clear(struct kexterr *ke); +int exterr_set_from(const struct kexterr *ke); int exterr_set(int eerror, int category, const char *mmsg, uintptr_t pp1, uintptr_t pp2, int line); int exterr_to_ue(struct thread *td, struct uexterror *ue); From nobody Mon Dec 1 03:48:24 2025 X-Original-To: dev-commits-src-branches@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 4dKVHX603pz6Ht3D for ; Mon, 01 Dec 2025 03:48:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKVHX4lMDz3mdb for ; Mon, 01 Dec 2025 03:48:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764560904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UBSn/KzEHbte0tuaen1QZV4svJnwcv5FCBXcw8W1PXI=; b=R1BNFB+ZZi9DpTThdFscWqu7YdsFamfKlC3VJP030iBXYXq5iDUlKF0m0mgO0LNsVs94CZ zKyeJbNSwMMrtQeGH5ua+MhoGSBWMN+i4qAE+mMs/vDdSkwS9RCv+llcjgsiaKePFKDm6H mie0Jjo9rIN4QJ/angplk0pgKZxEa2Aar2G8DdT1dqiexswQ+MnE3X0HjKIwvVdo5hHcjI BvzDXRh2X02N7pr1hNi3TsvUVGT6lb3vPhZVc3doch7gYQvBOH9ENuW3HesScX/1/H7ny0 +lMFjbVSzhaUOCpCl3cKYMudQHURe6a+kV7o/aG1OKmxeds12XmGZ7Q+4TrYcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764560904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UBSn/KzEHbte0tuaen1QZV4svJnwcv5FCBXcw8W1PXI=; b=TOzVEvODgvg2ZtdZYIC02YoZHfk4PvceDCtsyZY2ax5XHCpj6yOFKnSri8LMZeVaPcVylV aocyW2sL7KDETUIiwgxyuxwecbyLcneQeNcBvFuJz9m2LpM7ChuJr7nzRIS+jhUZQlfMJU H3kzxj4xzmWoyQa8X2n/PGvBQPxotx7vf5Anq3J+AhaJAnMypEE7YSuXV5F5mwxCQ88FM0 r2Ybq9NAGNbX1/tsHXDzDVwntOga754MVYGqdaM7n75KjbsbqGdQq3wk7TWFO+ar/B2Nfz s/OKWsbqpF4wu1QuBUIp+idhnRNhQgMTjJriaukFXO8U4PJXuguGyFl+FN6YZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764560904; a=rsa-sha256; cv=none; b=O2WBqe0Ss1DOEp9TvXe/JBWvqWgpqdqqrJI4olZhuGm8OnvM9MkscnLVRna3kmfdpkS1qN vSWrvfY7Puk0rIps6fMddj4dhKCC7nhIYgS89q38oVjcev6EugxYuS1ef0HmgLYkl1uIA8 eMCoC3r92QV/lns+LkW/8RRSZAGkG7hAzVu3TuHKIKF6OJoSOzeHHa5ttf3kpnHFK1aoIO G78I7quM4O/wPUZChaVRy4fCZykS3fMmJXXI8C+HI5x8yx9iCHUXKb90zx6jt1Y2nKhduc +XHRdy9sizIxOEStM+PwCilkVx47PX56kzATM9Mm2cBZgKeXVsQapVusRuvsmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKVHX3pDqz14Gg for ; Mon, 01 Dec 2025 03:48:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 30f0e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 01 Dec 2025 03:48:24 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: cb85c2e2e995 - stable/15 - exterror(9): add infra for bufs and bios List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: cb85c2e2e99551fb067ef8a20400e419069a871e Auto-Submitted: auto-generated Date: Mon, 01 Dec 2025 03:48:24 +0000 Message-Id: <692d1008.30f0e.4bd107a0@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cb85c2e2e99551fb067ef8a20400e419069a871e commit cb85c2e2e99551fb067ef8a20400e419069a871e Author: Konstantin Belousov AuthorDate: 2025-10-25 09:18:28 +0000 Commit: Konstantin Belousov CommitDate: 2025-12-01 03:39:09 +0000 exterror(9): add infra for bufs and bios MFC note: this commit changes the layout for both struct buf and bio. As such, it breaks KBI for VFS, which by itself often happens after X.0, so this is not a precedent. Discussed with: mckusick Approved by: re (cperciva) (cherry picked from commit 6c406b5b93125d030f0e63716ff389ce1a6ec4c5) --- sys/geom/geom_dev.c | 4 ++++ sys/geom/geom_disk.c | 10 ++++++++-- sys/geom/geom_subr.c | 10 ++++++++-- sys/geom/geom_vfs.c | 7 ++++++- sys/kern/vfs_bio.c | 15 +++++++++++---- sys/sys/bio.h | 7 ++++++- sys/sys/buf.h | 10 +++++++++- sys/sys/exterr_cat.h | 2 ++ 8 files changed, 54 insertions(+), 11 deletions(-) diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c index 46e2695293b8..e47be2768090 100644 --- a/sys/geom/geom_dev.c +++ b/sys/geom/geom_dev.c @@ -734,6 +734,10 @@ g_dev_done(struct bio *bp2) g_trace(G_T_BIO, "g_dev_done(%p) had error %d", bp2, bp2->bio_error); bp->bio_flags |= BIO_ERROR; + if ((bp2->bio_flags & BIO_EXTERR) != 0) { + bp->bio_flags |= BIO_EXTERR; + bp->bio_exterr = bp2->bio_exterr; + } } else { if (bp->bio_cmd == BIO_READ) KNOTE_UNLOCKED(&sc->sc_selinfo.si_note, NOTE_READ); diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c index 9dbf00371dba..b267130d1e0c 100644 --- a/sys/geom/geom_disk.c +++ b/sys/geom/geom_disk.c @@ -235,8 +235,14 @@ g_disk_done(struct bio *bp) bp2 = bp->bio_parent; binuptime(&now); mtx_lock(&sc->done_mtx); - if (bp2->bio_error == 0) - bp2->bio_error = bp->bio_error; + if (bp2->bio_error == 0) { + if ((bp->bio_flags & BIO_EXTERR) != 0) { + bp2->bio_flags |= BIO_EXTERR; + bp2->bio_exterr = bp->bio_exterr; + } else { + bp2->bio_error = bp->bio_error; + } + } bp2->bio_completed += bp->bio_length - bp->bio_resid; if (bp->bio_cmd == BIO_READ) diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c index 1429c84942ed..c002a5d9acfe 100644 --- a/sys/geom/geom_subr.c +++ b/sys/geom/geom_subr.c @@ -1151,8 +1151,14 @@ g_std_done(struct bio *bp) struct bio *bp2; bp2 = bp->bio_parent; - if (bp2->bio_error == 0) - bp2->bio_error = bp->bio_error; + if (bp2->bio_error == 0) { + if ((bp->bio_flags & BIO_EXTERR) != 0) { + bp2->bio_flags |= BIO_EXTERR; + bp2->bio_exterr = bp->bio_exterr; + } else { + bp2->bio_error = bp->bio_error; + } + } bp2->bio_completed += bp->bio_completed; g_destroy_bio(bp); bp2->bio_inbed++; diff --git a/sys/geom/geom_vfs.c b/sys/geom/geom_vfs.c index 9b5e5a84191f..f074ac43d245 100644 --- a/sys/geom/geom_vfs.c +++ b/sys/geom/geom_vfs.c @@ -26,9 +26,11 @@ * SUCH DAMAGE. */ +#define EXTERR_CATEGORY EXTERR_CAT_GEOMVFS #include #include #include +#include #include #include #include @@ -156,10 +158,13 @@ g_vfs_done(struct bio *bip) " suppressing further ENXIO"); } } - bp->b_error = bip->bio_error; bp->b_ioflags = bip->bio_flags; if (bip->bio_error) bp->b_ioflags |= BIO_ERROR; + if ((bp->b_ioflags & BIO_EXTERR) != 0) + bp->b_exterr = bip->bio_exterr; + else + bp->b_error = bip->bio_error; bp->b_resid = bp->b_bcount - bip->bio_completed; g_destroy_bio(bip); diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 19c39e42bafa..22b7fe8d059a 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -44,6 +44,7 @@ * see man buf(9) for more info. */ +#define EXTERR_CATEGORY EXTERR_CAT_VFSBIO #include #include #include @@ -55,6 +56,7 @@ #include #include #include +#include #include #include #include @@ -1775,7 +1777,6 @@ buf_alloc(struct bufdomain *bd) bp->b_blkno = bp->b_lblkno = 0; bp->b_offset = NOOFFSET; bp->b_iodone = 0; - bp->b_error = 0; bp->b_resid = 0; bp->b_bcount = 0; bp->b_npages = 0; @@ -1785,6 +1786,7 @@ buf_alloc(struct bufdomain *bd) bp->b_fsprivate1 = NULL; bp->b_fsprivate2 = NULL; bp->b_fsprivate3 = NULL; + exterr_clear(&bp->b_exterr); LIST_INIT(&bp->b_dep); return (bp); @@ -2276,7 +2278,7 @@ breadn_flags(struct vnode *vp, daddr_t blkno, daddr_t dblkno, int size, } if ((flags & GB_CVTENXIO) != 0) bp->b_xflags |= BX_CVTENXIO; - bp->b_ioflags &= ~BIO_ERROR; + bp->b_ioflags &= ~(BIO_ERROR | BIO_EXTERR); if (bp->b_rcred == NOCRED && cred != NOCRED) bp->b_rcred = crhold(cred); vfs_busy_pages(bp, 0); @@ -2353,7 +2355,7 @@ bufwrite(struct buf *bp) bundirty(bp); bp->b_flags &= ~B_DONE; - bp->b_ioflags &= ~BIO_ERROR; + bp->b_ioflags &= ~(BIO_ERROR | BIO_EXTERR); bp->b_flags |= B_CACHE; bp->b_iocmd = BIO_WRITE; @@ -4520,8 +4522,11 @@ biowait(struct bio *bp, const char *wmesg) while ((bp->bio_flags & BIO_DONE) == 0) msleep(bp, mtxp, PRIBIO, wmesg, 0); mtx_unlock(mtxp); - if (bp->bio_error != 0) + if (bp->bio_error != 0) { + if ((bp->bio_flags & BIO_EXTERR) != 0) + return (exterr_set_from(&bp->bio_exterr)); return (bp->bio_error); + } if (!(bp->bio_flags & BIO_ERROR)) return (0); return (EIO); @@ -4568,6 +4573,8 @@ bufwait(struct buf *bp) return (EINTR); } if (bp->b_ioflags & BIO_ERROR) { + if ((bp->b_ioflags & BIO_EXTERR) != 0) + exterr_set_from(&bp->b_exterr); return (bp->b_error ? bp->b_error : EIO); } else { return (0); diff --git a/sys/sys/bio.h b/sys/sys/bio.h index 74d2b03bd180..fa7f19961ebd 100644 --- a/sys/sys/bio.h +++ b/sys/sys/bio.h @@ -37,6 +37,7 @@ #ifndef _SYS_BIO_H_ #define _SYS_BIO_H_ +#include #include #include @@ -65,6 +66,7 @@ #define BIO_TRANSIENT_MAPPING 0x20 #define BIO_VLIST 0x40 #define BIO_SWAP 0x200 /* Swap-related I/O */ +#define BIO_EXTERR 0x2000 #define BIO_SPEEDUP_WRITE 0x4000 /* Resource shortage at upper layers */ #define BIO_SPEEDUP_TRIM 0x8000 /* Resource shortage at upper layers */ @@ -94,7 +96,6 @@ struct bio { struct vm_page **bio_ma; /* Or unmapped. */ int bio_ma_offset; /* Offset in the first page of bio_ma. */ int bio_ma_n; /* Number of pages in bio_ma. */ - int bio_error; /* Errno for BIO_ERROR. */ long bio_resid; /* Remaining I/O in bytes. */ void (*bio_done)(struct bio *); void *bio_driver1; /* Private use by the provider. */ @@ -130,8 +131,12 @@ struct bio { /* XXX: these go away when bio chaining is introduced */ daddr_t bio_pblkno; /* physical block number */ + struct kexterr bio_exterr; }; +/* Errno for BIO_ERROR. */ +#define bio_error bio_exterr.error + struct uio; struct devstat; diff --git a/sys/sys/buf.h b/sys/sys/buf.h index 064d5cb05214..f08f05e6d50f 100644 --- a/sys/sys/buf.h +++ b/sys/sys/buf.h @@ -37,6 +37,7 @@ #ifndef _SYS_BUF_H_ #define _SYS_BUF_H_ +#include #include #include #include @@ -98,7 +99,6 @@ struct buf { long b_bcount; void *b_caller1; caddr_t b_data; - int b_error; uint16_t b_iocmd; /* BIO_* bio_cmd from bio.h */ uint16_t b_ioflags; /* BIO_* bio_flags from bio.h */ off_t b_iooffset; @@ -153,10 +153,12 @@ struct buf { #elif defined(BUF_TRACKING) const char *b_io_tracking; #endif + struct kexterr b_exterr; struct vm_page *b_pages[]; }; #define b_object b_bufobj->bo_object +#define b_error b_exterr.error /* * These flags are kept in b_flags. @@ -390,6 +392,12 @@ struct buf { _lockmgr_disown(&(bp)->b_lock, LOCK_FILE, LOCK_LINE) #endif +#define BUF_EXTERR_FROM_CURTHR(bp) \ + bp->b_exterr = curthread->td_kexterr + +#define BUF_EXTERR_TO_CURTHR(bp) \ + curthread->td_kexterr = bp->b_exterr + #endif /* _KERNEL */ struct buf_queue_head { diff --git a/sys/sys/exterr_cat.h b/sys/sys/exterr_cat.h index 43f31e1d5dd6..34a4b9f86694 100644 --- a/sys/sys/exterr_cat.h +++ b/sys/sys/exterr_cat.h @@ -21,6 +21,8 @@ #define EXTERR_CAT_BRIDGE 7 #define EXTERR_CAT_SWAP 8 #define EXTERR_CAT_VFSSYSCALL 9 +#define EXTERR_CAT_VFSBIO 10 +#define EXTERR_CAT_GEOMVFS 11 #endif From nobody Mon Dec 1 03:48:25 2025 X-Original-To: dev-commits-src-branches@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 4dKVHY71Qqz6HtLr for ; Mon, 01 Dec 2025 03:48:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKVHY52qfz3mQw for ; Mon, 01 Dec 2025 03:48:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764560905; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Df/u//M1P8hQGre1QlJqEzLSauOZqck8vnSUmhuhbK0=; b=UrM0WDph/h99TjryKM4QAqebzh2WYwlKpGG7mDMunHwVKoL0e2F4dHkw6mgmx4T1DHSZYL qt1G+AjpMfqzKDkzMhdEe2ysfvCJ+pxm8BCKgfVeq2xNdMALMcVtNeuPiKQPY5G2N0AHJb U/jb9sEavlPTSCHhNSffryzDrprB91KXJUTieglAtgr8xZDVHcTNs006/mqvEPM+eRUDRx axReGYQJLl6IBMfHHZEvJ/82/VVjAeExTtxPTucn32dZzLmQKMDtwvGTGkOkuclCHLQVLT J/QY7M7uBOH0S2cEyA2H2NlVGpIbW+loDxUNDczACdf1zcbWeaUP1deHPD7kPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764560905; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Df/u//M1P8hQGre1QlJqEzLSauOZqck8vnSUmhuhbK0=; b=guM27D1UQz++XZpthxHeWJOG5D7tkAqW2EqnQXEDaeXflvs8evWs59eZh1YoOsmzXAMYP0 4ndfxmPobLdEZrPCPUT3N1OXuRIFrEu9nPsnNhN08nddjHdYZXUacp8cjvR/dBjHv4uccL 01dY85jYnFkLLraDrWOCZhA46FJgV6goo1hn/7jePF5gqYUQw5kRxC2HvFyYnaw8B9qREm BTOq+sjwSpMUeaWqLCcaF48ukpnJzmzgePalk+6LFqfo9TpYJuijk7n368O5Wzwk0/b/FS g550Fv21IdXSaWs4cxuSptiLIuSGl9JOhuBB5IEsfd4L0O4IvrdjVhd6jX6uuw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764560905; a=rsa-sha256; cv=none; b=JMlB4Bj4ovh1dyUg0HtLT6BO3VFBi5+wrcSR32pPVhu+PlaoqciYhmRunpkoehMKDJD3z7 FyJ3N0WJdrBdDUsxW0U9+Xsuc9vJNW9O14rFVaNWWdexLWhb8MZg3stUr76f9AfK2Lur4j Lh5e3FT+HGUNJHiubGb06BKm0rtPT51DxdKtGL8yKL1eY+kJsYEY69hwr1TT8DUp5j4taL R61so4jgeIg9IPnQDi6384grhJOF7OfREMwvTLUSLzY6svkiyCAg0CAfUET0Ft3ff1ChK3 FAUDp7jB9FMH2YDcRU+XXlLGAvFFqlkXbBbzR53fR2xsJwCb2G7tCtQuo7rihw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKVHY4bN1z1450 for ; Mon, 01 Dec 2025 03:48:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2fc51 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 01 Dec 2025 03:48:25 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: a4fadc6c0784 - stable/15 - geom/geom_vfs.c: use EXTERROR_KE() in g_vfs_strategy for ENXIOs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: a4fadc6c0784c7d7892389f638f605abe8deeda8 Auto-Submitted: auto-generated Date: Mon, 01 Dec 2025 03:48:25 +0000 Message-Id: <692d1009.2fc51.d50651f@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a4fadc6c0784c7d7892389f638f605abe8deeda8 commit a4fadc6c0784c7d7892389f638f605abe8deeda8 Author: Konstantin Belousov AuthorDate: 2025-10-25 09:17:02 +0000 Commit: Konstantin Belousov CommitDate: 2025-12-01 03:40:55 +0000 geom/geom_vfs.c: use EXTERROR_KE() in g_vfs_strategy for ENXIOs (cherry picked from commit 515fa5ff2e4db907379c284fb7e7df77b4096948) --- sys/geom/geom_vfs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/geom/geom_vfs.c b/sys/geom/geom_vfs.c index f074ac43d245..122e2f6a02ec 100644 --- a/sys/geom/geom_vfs.c +++ b/sys/geom/geom_vfs.c @@ -200,6 +200,8 @@ g_vfs_strategy(struct bufobj *bo, struct buf *bp) mtx_unlock(&sc->sc_mtx); bp->b_error = ENXIO; bp->b_ioflags |= BIO_ERROR; + EXTERROR_KE(&bp->b_exterr, ENXIO, + "orphaned or enxio active"); bufdone(bp); return; } From nobody Mon Dec 1 03:48:21 2025 X-Original-To: dev-commits-src-branches@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 4dKVHZ4rjMz6HtJv for ; Mon, 01 Dec 2025 03:48:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKVHZ20pkz3mNR for ; Mon, 01 Dec 2025 03:48:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764560906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vZzcxV3BbOiNW8Br3Irxkkt41hy+CoZFFsMtLZKHOzI=; b=HGgp61fDycTfsOIZEV/1cQrJ03ishURhTz/xFVM9Q3ZgyvtxYXqRcrnJZW72pZU89IsTuL LZGrfBwmB0UYcro1LIpjZgSHGKp9orzO0gCLXi303g/Weo9vOyIPCdEGVxkNmQobk9sofy b1yZkJp+Xcmjd2EtFJ7Hb0eaqw0iQHp8f/eN1hzcuBbheOmu6yMkjVSOROPWysoLUq4YM7 nccUxnTpewFY1hlDOlXmiDq7Kw12XfQndfoNRV1nG4ewfob0VR/Hij6FKs8d/TonMCGgUI ZKKGg2K8XWBnr6kIGgnygXf+nppQHtxcGcg8ZMlc/kR+rg2lbFYl26eFj74ZdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764560906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vZzcxV3BbOiNW8Br3Irxkkt41hy+CoZFFsMtLZKHOzI=; b=TnWCwjAGyhaxPiQK/+I8Hi+sVm4nHZ8Lc3UwKCrL2XQ2FeDNqOg8QkEcSntGeufHGFVovH zmHABu2HjFo//fi9RD2i/+Tzvv6lv14SGk898kn2NrtTrMflW/ty1roeEvDT1f4h0/0rsB vzmTCLvpmYe0Ot3/ERtMSBa3urD6MHH9YzMcP5pYI9B9V8ZlTlyAKMhd5u/8S/fMJOefPs Pe5YkZ689S19DlFqMBuBbBdfwC/si0G+HORpKh/IhHotE2fOHQZJZKyWvy3ooPB65X7ddw 0dOA/TkHlcsiZskUbnXbmLJeEd4noSWOcEZdoXWlQGaMLnm6FcZQHLY5rVrrnQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764560906; a=rsa-sha256; cv=none; b=Fl8NTvQXEGEvQ4BN9+Q8BfzFVpx9i74AM0Gk7yfuQvZwZhODirquVoTPLnIJ4tGKsD2Hgs ERfI8nQSHcKQqGLqh8aFauIIQVzfOvhS27daMdpFqg8PDYF8ygROnTcaJOrPdwnyPHpfN5 1IQMRON2H+Cb42RzZ7RNEJADAIr39qjGAwwlyAfNFg+sBHVdEz1yNTJEpYFsu8JiunfbQR cpQpiqPz4Jin82Qws1aPPCZinEgYgdTdSiFtdbkw3A4BvxDuTV6tBIqgkykVNZoulT11KP W81opMcU5Ke7VRzAUwSDNtFwksPtlg7VOokm7/XyYfroT8gOqqRMDIF7psLDWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKVHZ1S8hz14LZ for ; Mon, 01 Dec 2025 03:48:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2eef4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 01 Dec 2025 03:48:21 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: cdf37c58727f - stable/15 - sys/: rename bio_error variable to abio_error List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: cdf37c58727fa3d32de9300233d7295abf63ddde Auto-Submitted: auto-generated Date: Mon, 01 Dec 2025 03:48:21 +0000 Message-Id: <692d1005.2eef4.90bbb58@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cdf37c58727fa3d32de9300233d7295abf63ddde commit cdf37c58727fa3d32de9300233d7295abf63ddde Author: Konstantin Belousov AuthorDate: 2025-10-25 08:37:14 +0000 Commit: Konstantin Belousov CommitDate: 2025-12-01 03:39:09 +0000 sys/: rename bio_error variable to abio_error (cherry picked from commit 58e5f3b84df0aeaaf4b56a5e48bcb4b3e1d9c097) --- sys/dev/mmc/mmcsd.c | 8 ++++---- sys/dev/nvme/nvme_ns.c | 14 +++++++------- sys/kern/vfs_aio.c | 10 +++++----- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/sys/dev/mmc/mmcsd.c b/sys/dev/mmc/mmcsd.c index 5b9cb93c7b31..f2965048b285 100644 --- a/sys/dev/mmc/mmcsd.c +++ b/sys/dev/mmc/mmcsd.c @@ -1422,7 +1422,7 @@ mmcsd_task(void *arg) struct mmcsd_softc *sc; struct bio *bp; device_t dev, mmcbus; - int bio_error, err, sz; + int abio_error, err, sz; part = arg; sc = part->sc; @@ -1430,7 +1430,7 @@ mmcsd_task(void *arg) mmcbus = sc->mmcbus; while (1) { - bio_error = 0; + abio_error = 0; MMCSD_DISK_LOCK(part); do { if (part->running == 0) @@ -1475,11 +1475,11 @@ mmcsd_task(void *arg) } else if (bp->bio_cmd == BIO_DELETE) block = mmcsd_delete(part, bp); else - bio_error = EOPNOTSUPP; + abio_error = EOPNOTSUPP; release: MMCBUS_RELEASE_BUS(mmcbus, dev); if (block < end) { - bp->bio_error = (bio_error == 0) ? EIO : bio_error; + bp->bio_error = (abio_error == 0) ? EIO : abio_error; bp->bio_resid = (end - block) * sz; bp->bio_flags |= BIO_ERROR; } else diff --git a/sys/dev/nvme/nvme_ns.c b/sys/dev/nvme/nvme_ns.c index 17f6c205752b..f50b8993a362 100644 --- a/sys/dev/nvme/nvme_ns.c +++ b/sys/dev/nvme/nvme_ns.c @@ -45,7 +45,7 @@ #include "nvme_private.h" #include "nvme_linux.h" -static void nvme_bio_child_inbed(struct bio *parent, int bio_error); +static void nvme_bio_child_inbed(struct bio *parent, int abio_error); static void nvme_bio_child_done(void *arg, const struct nvme_completion *cpl); static uint32_t nvme_get_num_segments(uint64_t addr, uint64_t size, @@ -279,14 +279,14 @@ nvme_ns_bio_done(void *arg, const struct nvme_completion *status) } static void -nvme_bio_child_inbed(struct bio *parent, int bio_error) +nvme_bio_child_inbed(struct bio *parent, int abio_error) { struct nvme_completion parent_cpl; int children, inbed; - if (bio_error != 0) { + if (abio_error != 0) { parent->bio_flags |= BIO_ERROR; - parent->bio_error = bio_error; + parent->bio_error = abio_error; } /* @@ -313,12 +313,12 @@ nvme_bio_child_done(void *arg, const struct nvme_completion *cpl) { struct bio *child = arg; struct bio *parent; - int bio_error; + int abio_error; parent = child->bio_parent; g_destroy_bio(child); - bio_error = nvme_completion_is_error(cpl) ? EIO : 0; - nvme_bio_child_inbed(parent, bio_error); + abio_error = nvme_completion_is_error(cpl) ? EIO : 0; + nvme_bio_child_inbed(parent, abio_error); } static uint32_t diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 65d7ffc9b742..2a790237d30e 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -2487,7 +2487,7 @@ aio_biowakeup(struct bio *bp) long bcount = bp->bio_bcount; long resid = bp->bio_resid; int opcode, nblks; - int bio_error = bp->bio_error; + int abio_error = bp->bio_error; uint16_t flags = bp->bio_flags; opcode = job->uaiocb.aio_lio_opcode; @@ -2503,16 +2503,16 @@ aio_biowakeup(struct bio *bp) * error of whichever failed bio completed last. */ if (flags & BIO_ERROR) - atomic_store_int(&job->error, bio_error); + atomic_store_int(&job->error, abio_error); if (opcode & LIO_WRITE) atomic_add_int(&job->outblock, nblks); else atomic_add_int(&job->inblock, nblks); if (refcount_release(&job->nbio)) { - bio_error = atomic_load_int(&job->error); - if (bio_error != 0) - aio_complete(job, -1, bio_error); + abio_error = atomic_load_int(&job->error); + if (abio_error != 0) + aio_complete(job, -1, abio_error); else aio_complete(job, atomic_load_long(&job->nbytes), 0); } From nobody Mon Dec 1 03:48:26 2025 X-Original-To: dev-commits-src-branches@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 4dKVHb2ylvz6HtLy for ; Mon, 01 Dec 2025 03:48:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKVHZ66q8z3mYg for ; Mon, 01 Dec 2025 03:48:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764560906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pAg2yPgVLO8O5nObRxXrWdkz2iuOdrmytLvnqgp8G1k=; b=nGr48Z5dx4/eXlcn1Rtgd+fGeokgAEAuS5MhcC7MfHr/HwtocW0tJTS9+ywSX5SgWmpxhl o28/yd4D6hMNnjzuStSrDJ3kUopI4lvV3vz9cwWtHBOcQh7quANmBDSmYX1vDA1Zs5/gm2 DYipTWhKw3weEz+sRWR3TCErbW5w7k90fWm8Ky864oX8egXu5mJxtsyjBectfiNWaV5v2O jZ2P/psiZEYI1aOXOE0ZWxH/wlSeCIhcKC7QzEy4ByyXjmP+LwZrG/AJbRl/DyGShCwEWG 81X5bfJoUBUEandW6VoL6lDEnttr22tn9AvWXRp3G0SwIZgkP5dIRGa14fvVLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764560906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pAg2yPgVLO8O5nObRxXrWdkz2iuOdrmytLvnqgp8G1k=; b=nibQFpKL6D7Lnsr6eCG4daTPZu+Sg5OYJ5CJ1MlNURtWUK+fXg9Wh1jhI1jja36/mKj2ov XT3i+ABGAw18HoXxQSA58wrt+Nq5TPlequhtiU4C0GG4nGA7DNna+Uwjqv0oLoEHU3/9Uf f0zIN1EXB8a0Y0Q8ES72ikI/ORujpI3M0jr6LwKPo4fNqer8Ww/fDOQhFWBiHVa5yPFZFK Aq+rlQLAEf7/sCIeCKNpktkpksuDBrMsn+DlYGV0l8ihMPJhAt6P08xYFWtshHLNefyR1b 2OC2X0ydAH5X5Z+X3mUiPBtjBv4IC3WwCKv4QdzXqaUw+7wTEpSpMEMo8GsA8Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764560906; a=rsa-sha256; cv=none; b=A6yVvasu/AStbOsRPuGLLKgUZlOnm2U5h9N4qagrWAZhLE2d97hV0uVll0Q2IkHbWm9vVZ VmKVAHCw16LGQSdfz+EF0mhep337C+AZofzmWhswLtdnJMnEVtjsyGyIa4vgl3mJhnIk7b fsrZ8Og/fIDob8SXC+IOeIw3UToYjeE0uT2hg+TpZPe69q/+/X3Hed4vFFIaN+0sQ4zkFV gUvNiSq65JGG/HtlAZk9b+YtBlcjvp/rshv5AidnWHIgmHMqYZVGpad2OM+kgkZHaFdZ9j zDl10TykiYTLcAuyw/qHGItGNCLkn0sUq+e4BSd2aWXyv0jpJiQFl0A+FgeqHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKVHZ5R70z13sb for ; Mon, 01 Dec 2025 03:48:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 30856 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 01 Dec 2025 03:48:26 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 72bbd1891498 - stable/15 - exterr: add exterr_db_print(), to be used by several ddb dumpers List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 72bbd1891498036752c52ac5806292f369918611 Auto-Submitted: auto-generated Date: Mon, 01 Dec 2025 03:48:26 +0000 Message-Id: <692d100a.30856.6d05cd02@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=72bbd1891498036752c52ac5806292f369918611 commit 72bbd1891498036752c52ac5806292f369918611 Author: Konstantin Belousov AuthorDate: 2025-11-04 20:51:19 +0000 Commit: Konstantin Belousov CommitDate: 2025-12-01 03:40:55 +0000 exterr: add exterr_db_print(), to be used by several ddb dumpers (cherry picked from commit 9521b0b91ea31b7f31b3800772ac6502c822ae56) --- sys/kern/sys_generic.c | 13 +++++++++++++ sys/sys/exterrvar.h | 1 + 2 files changed, 14 insertions(+) diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index 79628f1389e4..5a7c6abec0cb 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -2358,3 +2358,16 @@ exterr_clear(struct kexterr *ke) { memset(ke, 0, sizeof(*ke)); } + +#include "opt_ddb.h" +#ifdef DDB +#include + +void +exterr_db_print(struct kexterr *ke) +{ + db_printf("errno %d cat %d msg %s p1 %#jx p2 %#jx line %d\n", + ke->error, ke->cat, ke->msg == NULL ? "" : ke->msg, + (uintmax_t)ke->p1, (uintmax_t)ke->p2, ke->src_line); +} +#endif diff --git a/sys/sys/exterrvar.h b/sys/sys/exterrvar.h index 1e07f6afb547..8e2961356a1e 100644 --- a/sys/sys/exterrvar.h +++ b/sys/sys/exterrvar.h @@ -70,6 +70,7 @@ _SET_ERROR0)(__VA_ARGS__) void exterr_clear(struct kexterr *ke); +void exterr_db_print(struct kexterr *ke); int exterr_set_from(const struct kexterr *ke); int exterr_set(int eerror, int category, const char *mmsg, uintptr_t pp1, uintptr_t pp2, int line); From nobody Mon Dec 1 03:48:27 2025 X-Original-To: dev-commits-src-branches@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 4dKVHc0zJMz6Ht8F for ; Mon, 01 Dec 2025 03:48:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKVHb6y2Jz3mqH for ; Mon, 01 Dec 2025 03:48:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764560908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=scDaoLLD1AvFidasvXB7cSZUY9K2iGESgdRzTbPoTJE=; b=HihF5MDnb6KccQbFi+Up/9XJp+cKx8XiuDfTqZG00u5VFLrXJMfG63jRDW/6AnTAWseERB JGtDXFCCZqaC5XGhKsI+hjM1tDKU1LCZ/dpudAd0e/Is47mmsbuCesI9U7Qk+DFaHiyIDm i/YwIlCk5jRZVvJ/0lR/hmCkJMluBvHauUurU8apymYsuswPPD+uBu5UxJj6j1n7B+gBCK K9l4bLwEhfvnbLNDeAHMPBDMe4hAcyVFV82j8bedAvFNGSAYKGRLvLJC1+7rdaukRyC8eg 3m9zIVyCa2HKQvxCB1tgkp8FxrzB0tv8XpgrnNXvX0UjD/+Jx4Q6HH2cor4KNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764560908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=scDaoLLD1AvFidasvXB7cSZUY9K2iGESgdRzTbPoTJE=; b=ZRaOXRBdzafCN1T++KVVGcT/lCICavHEcnYLpu9O+ECht6isrOLhMkkBcF4sybUhTPRA7m XnVeGtFYoxDGTJlnu62qCe05JT8ve+/r+x6gj13xO6jgO91CxR/qchviZ5ghNgaHyUt2s6 zNh49tJ7fN8928G1ouI14sirQ6XLv2s1H6lBrisx3JjpEsJZXDLOJICSsWOml8k48qOW7+ 4pSOtwM5HOKjmPwNWCe85AlGTwfQGHh67/UmThXTB+fT19rwyvsxVfqYqpFtopMdwN83LN rZ0s23VmWdZw8coGbR7iZxEf2KF1PJGbI3//NXNaQNA0cCEdgzpmoyKBsE1KBA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764560908; a=rsa-sha256; cv=none; b=M23tVYCUzFsDl6NISvaWiO0kWzvSW5e41scXsERBTe52hybbeBKZqS8rzN4JJM67AuMiyd BTbiNmRne3JadyD87MYTQUtDgrU+X5k/YPJcV2I4GAgh97rvkZ0lGLWD4zV+3SVFOix0jO oN/d/icCKUJTZce+DfAQ0RAanBYyYhs/nzgf4WjhF4K79OwXZc+9+pXZFrY0lo2EQnEbdL PTOmlx4wXOs21ag3i+cdjU+Rzkja8ugBkxwV8fbb2+gtH0BkLDz8H3eSYP0fnPPyU2Y0Sz DtVzPpjbHfNM61ttPh528zeeTm5OpuMyX5NaX7umv1oIpCvy7rqy3JnEm3Fbmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKVHb6Knlz13sc for ; Mon, 01 Dec 2025 03:48:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2fc55 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 01 Dec 2025 03:48:27 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 35a54c876c4f - stable/15 - exterr: print exterr for struct buf and bio in ddb show commands List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 35a54c876c4f97a67ce4ee31c6e983b156504a5a Auto-Submitted: auto-generated Date: Mon, 01 Dec 2025 03:48:27 +0000 Message-Id: <692d100b.2fc55.1dc46274@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=35a54c876c4f97a67ce4ee31c6e983b156504a5a commit 35a54c876c4f97a67ce4ee31c6e983b156504a5a Author: Konstantin Belousov AuthorDate: 2025-11-04 20:53:14 +0000 Commit: Konstantin Belousov CommitDate: 2025-12-01 03:40:55 +0000 exterr: print exterr for struct buf and bio in ddb show commands (cherry picked from commit 7d495be8d4bd3a0e315233346b2f7267b8390612) --- sys/geom/geom_subr.c | 4 ++++ sys/kern/vfs_bio.c | 2 ++ sys/sys/exterr_cat.h | 1 + 3 files changed, 7 insertions(+) diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c index c002a5d9acfe..91c01a7de117 100644 --- a/sys/geom/geom_subr.c +++ b/sys/geom/geom_subr.c @@ -38,9 +38,11 @@ #include #include "opt_ddb.h" +#define EXTERR_CATEGORY EXTERR_CAT_GEOM #include #include #include +#include #include #include #include @@ -1663,6 +1665,8 @@ DB_SHOW_COMMAND(bio, db_show_bio) db_printf(" caller2: %p\n", bp->bio_caller2); db_printf(" bio_from: %p\n", bp->bio_from); db_printf(" bio_to: %p\n", bp->bio_to); + if ((bp->bio_flags & BIO_EXTERR) != 0) + exterr_db_print(&bp->bio_exterr); #if defined(BUF_TRACKING) || defined(FULL_BUF_TRACKING) db_printf(" bio_track_bp: %p\n", bp->bio_track_bp); diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 22b7fe8d059a..880cc6b99951 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -5529,6 +5529,8 @@ DB_SHOW_COMMAND(buffer, db_show_buffer) db_printf("\n"); } BUF_LOCKPRINTINFO(bp); + if ((bp->b_ioflags & BIO_EXTERR) != 0) + exterr_db_print(&bp->b_exterr); #if defined(FULL_BUF_TRACKING) db_printf("b_io_tracking: b_io_tcnt = %u\n", bp->b_io_tcnt); diff --git a/sys/sys/exterr_cat.h b/sys/sys/exterr_cat.h index 34a4b9f86694..318e774542ca 100644 --- a/sys/sys/exterr_cat.h +++ b/sys/sys/exterr_cat.h @@ -23,6 +23,7 @@ #define EXTERR_CAT_VFSSYSCALL 9 #define EXTERR_CAT_VFSBIO 10 #define EXTERR_CAT_GEOMVFS 11 +#define EXTERR_CAT_GEOM 12 #endif From nobody Mon Dec 1 03:48:28 2025 X-Original-To: dev-commits-src-branches@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 4dKVHd2D5qz6Ht3T for ; Mon, 01 Dec 2025 03:48:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKVHd0GLKz3mW6 for ; Mon, 01 Dec 2025 03:48:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764560909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qQZvdxC6wRzUkqyOXgrD9Mth4k570bJQUCjSffQzD9E=; b=nuFFwT6kihX5T9S3lBs7czcK4tBvEuuEgsYvrK+ZqFPkSc4KlwY8gzVG/oCPVrockTVjdU 42yaBsKr/EmT3fq6YodAjfhzHS95MsjWWP8gOnRrglOBPxeFublBUpwja22F9dgMDAelq7 4EyBP3B+AKy4x7a8uMPhtdPzHtqUSq0WiUQKQ7MW6f6/MF072a0q6jwWk9G0AG64x4r/1K 736kn73xJITK+vdLghiLrmkIAzjU0sjl+29sbWzTedWiWvYzE24rlH0O64ujje9ybTJ3Ml 7R2j2YyKJGouTnv03IUl9Msi81yyVMyfkJML7BHKLy4MH/1W+luO19OEcevN/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764560909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qQZvdxC6wRzUkqyOXgrD9Mth4k570bJQUCjSffQzD9E=; b=qB9XGYSmfIjGb1+KB22dAmjFBuqU3KfxzGM2qgYFohFe+IE+3zD+ZQV2S1SPonlhj+tH7v cyXwvETV8rode3i8avPiI5CjVQ3B0iB/LuqtEsBkio3rLl9c7Cva6VPs6sJr1qJQPfQ3q2 wZpJ978WRTAk6JV1ARj0fBbsYEiJ5QIiNFCVTIXAKSu/hta1CB/8FI8XZVHlpi+15vewoO P0E0kMWOjt0VKEkwjcVqQx48aciWA+MIHVx0ao/Bq9bNSMbIueuTQkZ449Y20ErLWU/wxV dBVZYZiRGby5f3FTqWWwU9PgTvXfP1s5ZcAg0kaI6n+keJh4dvHlcpj9ZSvpaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764560909; a=rsa-sha256; cv=none; b=B2wEy32UrE0Czirmo1FZOUMMVa0zAEl226tEjSWn5gdUnDXX2tFWU2Mhp+RWHGbtfpoeHY rinJjPF0VV6j31cbco4cDk9JKqXxe9UkTJsluz/yRXbtjktYDJDMtC6J1KT0NpGkyNXwRy 3+vROijL11jOTHgzBnU18gBVKsj4FQ5R8lSd7hqtPUcyU1OL1U/xst9lscwhTTv39uvgKv jMyjoZsse6zEyRfQLehwrhCXBiH8c5HTSVsd5/AAjETzMu6MPv794et0kOrvx5rU+KhlDx kASrYdI7kLlwEEBByw3J03P7ebtI2uhK4MTDwR5TGbPAbQ6dDc47FDbVha/Z7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKVHc6mjJz14Lb for ; Mon, 01 Dec 2025 03:48:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2fbc9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 01 Dec 2025 03:48:28 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 0083165a9d13 - stable/15 - sys/bio.h: print BIO_EXTERR flag List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 0083165a9d13a325801fcfc6ef05a55fe25d69ff Auto-Submitted: auto-generated Date: Mon, 01 Dec 2025 03:48:28 +0000 Message-Id: <692d100c.2fbc9.fa2a36f@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0083165a9d13a325801fcfc6ef05a55fe25d69ff commit 0083165a9d13a325801fcfc6ef05a55fe25d69ff Author: Konstantin Belousov AuthorDate: 2025-11-04 19:14:19 +0000 Commit: Konstantin Belousov CommitDate: 2025-12-01 03:40:55 +0000 sys/bio.h: print BIO_EXTERR flag (cherry picked from commit 8794e3718ec3b2a05a70e9c0afd6ab5cac503cdb) --- sys/sys/bio.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/sys/bio.h b/sys/sys/bio.h index fa7f19961ebd..5c12c858f3e5 100644 --- a/sys/sys/bio.h +++ b/sys/sys/bio.h @@ -70,7 +70,8 @@ #define BIO_SPEEDUP_WRITE 0x4000 /* Resource shortage at upper layers */ #define BIO_SPEEDUP_TRIM 0x8000 /* Resource shortage at upper layers */ -#define PRINT_BIO_FLAGS "\20\20speedup_trim\17speedup_write\12swap\7vlist\6transient_mapping\5unmapped" \ +#define PRINT_BIO_FLAGS "\20\20speedup_trim\17speedup_write\16exterr" \ + "\12swap\7vlist\6transient_mapping\5unmapped" \ "\4ordered\3onqueue\2done\1error" From nobody Mon Dec 1 03:48:30 2025 X-Original-To: dev-commits-src-branches@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 4dKVHf3zT7z6Ht8P for ; Mon, 01 Dec 2025 03:48:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKVHf0mKvz3mfQ for ; Mon, 01 Dec 2025 03:48:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764560910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7sEJWtFeBwrSYERgLHXlLPZuvhDqEzrHZNU8wqBY8Ic=; b=tnU+s3tQlIIC3+TFNHFpqbMN+JgUdVKYag9a/GGP78/yTIvcmuSjlTheJZzp8i9gJOWifE pKamQsAwvaydb1vz7Ggjz9vz8AYBTQd9lCbSxZzMMlf0VHp1JSSnrI5OUuRHZYOzoFV285 gkFv6dhcBnbzduirTJ5u8PA8cRcnNsFkYvrzX71j/XKW2Ob9xZWxsRRNbMk9Ety1WSMhHg 8abc0uzI3rJgNmY+dBDpOc19H26uDEQRj9gl2D6LTPE19h2WzlFdCQ3+XW84F3zh4vMA1G 8R5DyUg7mXM4cZ3UZMmdo1kzexBl/RHsGw/LjgVaxBjdZ7EMY9XFHHyYoUyYJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764560910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7sEJWtFeBwrSYERgLHXlLPZuvhDqEzrHZNU8wqBY8Ic=; b=fnYXwuC6HrMWp7gye4jYfBYfOl3Ya2mWN/mifQDv7QLY7uLyIOFM4TWlHnvc8S8pVYIgfa R7+Ayfn2P4PwMHESJ4kq0JKQsIQ/LuyqgYh9IJmZ2n6HWE14VLqrt8R1Qldoho1TJN2zGX DaJ5bH63Ju9sDQtG44L01OqqMlDN+3zozBwerjVNIICP7IsSJ14GETM9k57kM/zzpFaHCu j6G2XSS1jIFKr6M9TWVoilFG02CPcnPh/21FjpBDq3JFBBLSH5aC0IBi8CNJzeyxdU5hSC H4kkYlKCCGlVLSai+eA5xGZ/+s9DqLHHNGQlhz9DGLmATC1nOR3CEwVadN7Hxg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764560910; a=rsa-sha256; cv=none; b=aJrHCIHWD79hWP2+A5EyIQ2aWVptO2Z5uvhxVgPrakbbONbAZABZ8HWRr/Zpzl0tK4H2Ip qqfrX8nb6nKqrdbohDZNli9MSzDqavkv0qbczFNn/5fxaA2qPSvePJLde4r0Xxu89uIxXs kAL515XyI/uQxixL31Irqkq9JPnGvhxnM/sEjpguqP62N+4lhZMH+G81Yt2wEnynASDsgA k/iikaLi62hsC49Ag5i5kEMaze3b9hkQMsRN3wEz3JGNfy0g4Bz9h/DB1Sumfdxmwl//xM 5HGeKcREcfS0c33eIExM309+cEoSybi8sBj3N8NATX62hGwf9/WfqfUU2jj9Lg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKVHf0CtXz13qF for ; Mon, 01 Dec 2025 03:48:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 30c2e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 01 Dec 2025 03:48:30 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: a0e349258479 - stable/15 - exterror.9: explain buffers and bios usage of extended errors List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: a0e349258479583219d32e5c54a54db78db6e934 Auto-Submitted: auto-generated Date: Mon, 01 Dec 2025 03:48:30 +0000 Message-Id: <692d100e.30c2e.2b00216b@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a0e349258479583219d32e5c54a54db78db6e934 commit a0e349258479583219d32e5c54a54db78db6e934 Author: Konstantin Belousov AuthorDate: 2025-11-18 04:23:41 +0000 Commit: Konstantin Belousov CommitDate: 2025-12-01 03:40:55 +0000 exterror.9: explain buffers and bios usage of extended errors (cherry picked from commit c0a38339fec37a5b6367f138f059a12d6d716fd4) --- share/man/man9/exterror.9 | 82 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/share/man/man9/exterror.9 b/share/man/man9/exterror.9 index 79197e4a187d..fd4b732b8213 100644 --- a/share/man/man9/exterror.9 +++ b/share/man/man9/exterror.9 @@ -17,8 +17,15 @@ #define EXTERR_CATEGORY EXTERR_CAT_MYCATEGORY .Ed .In sys/exterrvar.h +.Vt struct kexterr; +.Ft void +.Fn exterr_clear "struct kexterr *ke" +.Ft int +.Fn exterr_set_from "const struct kexterr *ke" .Ft int .Fn EXTERROR "int error" "const char *msg" ... +.Ft void +.Fn EXTERROR_KE "struct kexterr *ke" "int error" "const char *msg" ... .Sh DESCRIPTION The .Nm @@ -102,6 +109,33 @@ Additionally, use of .Fn EXTERROR in kernel threads is not sensible as there is no userspace to retrieve the extended error data. +.Pp +The +.Fn EXTERROR_KE +macro is similar to +.Fn EXTERROR , +but it takes an explicit pointer +.Fa kep +to the +.Vt struct kexterr +to fill with the extended error information. +The macro expression value is +.Vt void . +See below for description of the asynchronous i/o error facilities. +.Pp +The +.Fn exterr_clear +function clears the content of the +.Vt struct kexterr +pointed to by the argument +.Fa ke . +.Pp +The +.Fn exterr_set_from +function sets the current thread extended error data from the +.Fa struct kexterr +pointed to by the argument +.Fa ke . .Sh USERSPACE ACCESS TO EXTENDED ERROR DATA There is no syscall overhead for using .Nm @@ -127,6 +161,54 @@ were modified to print the extended information if it is available in addition to the usual .Va errno decoding. +.Sh ASYNCHRONOUS INPUT/OUTPUT +Due to the nature of the +.Fx +i/o subsystem, most input/output requests, presented as buffers (as in +.Vt struct buf ) +and geom bio's ( +.Vt struct bio ) +are processed asynchronously in filesystem- and geom-private threads. +This makes it challenging to pass any extended error information +from the geom providers and drivers, where an error typically occurs, +back to the thread that initiated the request, and is the consumer of +the result. +.Pp +To alleviate the mismatch, both +.Vt struct buf +and +.Vt struct bio +have member of the +.Vt struct kexterr +type. +For buffers, the +.Va b_exterr +for +.Vt struct buf , +and +.Va bio_exterr +for +.Vt struct bio . +Asynchronous i/o code can use the +.Fn EXTERROR_KE +macro, passing the pointer to the current request's embedded +.Vt struct kexterr , +to record the extended error. +In both cases, the +.Va BIO_EXTERR +flag should be set to indicate that whole extended error is valid, +not only the +.Va b_error +or +.Va bio_error +values. +.Pp +Both VFS and geom generic layers, and several geom providers that generate +subordinate bio's from the original request, are aware of the extended +errors. +They pass +.Vt kexterr +from the failed request back to the thread that create the request. .Sh SEE ALSO .Xr errno 3 , .Xr err 3 From nobody Mon Dec 1 03:48:31 2025 X-Original-To: dev-commits-src-branches@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 4dKVHg413Lz6Ht8S for ; Mon, 01 Dec 2025 03:48:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKVHg15FPz3mWZ for ; Mon, 01 Dec 2025 03:48:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764560911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rKBR5r2kOPkjoM4O9+b1x7btM1laKJWapXW/UkvXegQ=; b=RQDJQKMwpmqS65JOE8Ciq0n+fVHFydUCrZHTuaHajxAtPl3ST71RAHq39UodgfRlM9TXq8 NFbkAJIzdYjkwhPyyMzfbliiwIrP2APaGwjGC2AL50IF0NZdjaoYipRcqCV4cR7dABeY6j Evtgap2kRscreRLQO+NFprHXiqBKjRXN2IuL0d0m8+OHRrNVyAZG6LNBZnCX7DJTvoc5XJ Rlxe+EPAmFm05e4JgA/NGjAGUwYAAk7qjNjwevmFVQfFjwH8GTR5kLilLnx+jFTDn+EiMs ph7KMQk3Ghy8pq4waR0Z1NSQAtKQoRrRSy6+0BYcyf+BidyyD+JDrOm+zxE7Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764560911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rKBR5r2kOPkjoM4O9+b1x7btM1laKJWapXW/UkvXegQ=; b=GujiEDyQbj8FpwpT9XNAsM5cyE6SIZE7wqwGid2jE6vd6W41wjWQeuOXycCV0PA7nIKnXt Ip7P42VbIGpm6lXZBs9qWV5oYjQYyw6Irg7pnPPOwoQLJ4Z2KpWUKtgb/57qBD2o6X3W78 dIffYmhjKb38NjVb5k9acYs+bPhLHOFrl40MFhXdoolRt52QpDVefmOK/3V2ZyXCaVE/3T 3OlN27NUaU4HMOoYLQyHbEWnwwxH7JUopMJP24yYvWVDQAgR2r8sr9/yTFUXEXy+O/UkqT kgX1mC9MkrhtLBPeq+1CAKACe4ZWqfyuT7akLVCAun7JftiS4LSWbgYJMhv1LA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764560911; a=rsa-sha256; cv=none; b=lNTin6EeVwblwpqqIUOSh7p9nVi8UGTUsKOp2wZRfBVuCizbn2w/53r3A1gtJLcz6T1fU9 vyUW9ZExpURpx75IAY/zziwnUH428L0va3YBKxvfOleJDbDj1Xa4673z9Kh5sNQaS0Wten lufALkzqRbxkh5edon6np4dojZ6ZSGI1CRQMBC5e+g0WsnuROcBpdQYhXaIUSLeZ/OjNfI ZoPYuyGs0v07ZlWfHzQNBdRL4b8b4IkubD1bTapuiCk86g4RrAUIG82J/kagfCnwc/nGpN LQKYCxOgor6Y3Ymijw4F96MnvzOszK+t6X+XwBuNtDTgatgeTEF0MLCBOeHt7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKVHg0fH1z13sd for ; Mon, 01 Dec 2025 03:48:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3115d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 01 Dec 2025 03:48:31 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 398dd921c382 - stable/15 - sys/param.h: bump __FreeBSD_version for struct bio and buf layout change List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 398dd921c382760236acefe8f893912a2efd1696 Auto-Submitted: auto-generated Date: Mon, 01 Dec 2025 03:48:31 +0000 Message-Id: <692d100f.3115d.1f64f14f@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=398dd921c382760236acefe8f893912a2efd1696 commit 398dd921c382760236acefe8f893912a2efd1696 Author: Konstantin Belousov AuthorDate: 2025-12-01 03:41:31 +0000 Commit: Konstantin Belousov CommitDate: 2025-12-01 03:46:17 +0000 sys/param.h: bump __FreeBSD_version for struct bio and buf layout change on stable/15. This is direct commit to the branch. Sponsored by: The FreeBSD Foundation --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index cb75e316c39e..fe7ceeb90e9d 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -74,7 +74,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1500502 +#define __FreeBSD_version 1500503 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Mon Dec 1 11:57:46 2025 X-Original-To: dev-commits-src-branches@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 4dKj8C0GFcz6HqHg for ; Mon, 01 Dec 2025 11:57:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKj8B5Q9tz3q7H for ; Mon, 01 Dec 2025 11:57:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764590266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WBSWUCD+mplEjfKwT1BuMt4gH9rpXT54nYqKBU26tLc=; b=cFEMrNfYuqHTtKbdEv/f17MfITW7qSUSjH7BWezv1DNiX8ACXAfCHnVruSE9yYb8oVmZxo 9xXZzWoar1W/ApP99HVBl8qzYGevGkpOplI+Y+JM8Bm1JEahAh1tDRTJfkA8kJM/6troBr WSKvB0a593FzKMaEzuREfBuGOE6cqQFGnCBlAjEHXSmFWxMTs3GZ09KRoj09ogQABDasp2 oOji/F9EuBypsKxD0BsMLlKMSYZ26FBsKlP4T8Pm9Wcr4E7VpbBjRZsm+CVPEapeJoE7Gf JzNH3IZboA3rcQSA1ECOztXF+S+12ximWbR9TzOGuakrp9FLy7WmtHlwH3TcBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764590266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WBSWUCD+mplEjfKwT1BuMt4gH9rpXT54nYqKBU26tLc=; b=ocjzuMqCRg+UU3YnXFdKbU4Kcg5l50QZTIncOBsfec8Rr6qyGQiKpqLw68II/BQgXuf19q 9egj6UkKLH1HMVxPXOtGrY0TwlsHHF5tMA+RhkqAWQL3VSQxuY7pTt/XaL+a4vPKkhD43j B1kHtH62WGDj90Sgayjmp88uSRSdv7YuLmul1oSRG4esF3lHbWv8I3iSsYuQUMQ/Mx1w4p 12EUHYXzE0aeRrMM1DpJfCU0/jWG+agSUXKFlKjkdv+JZTIoin1yH0I7R9FmP8rkyzamcm hnAX+01w0wIvLeHUoC6tMJVbhrJgkQPMFuL/0Fbvx3CPuJb+y/WzVyQk0bV/JA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764590266; a=rsa-sha256; cv=none; b=q75a8R+70WZAl0/2SbapFQhKYfRUHJ9wvFIGh6Fm1DhGnm3PIzj3246VEjTUzMtqFI+vDj OyQr/DOh6tiT/woOpzBHqrc5TIWl2VkuPslsiG9Rt0+IB7IkmfIkmDiHOLry3pn9LCLgOJ iccjsXPg48RYRe4+mUGzC9mCA7fIMhw3zHM1wMe8o99joM2DqPZBsYZ9U7ud4WfRJSGPYY 9EW4ODcf9+v3nmX3bpHlE3jEhEpIe5bcfc8fLJeayX3nJDnKHsT4Rl9jjXu1+tEXnk1MyH ftkndTF7iMzBwKf6DS3Lt7Ibq7NKlEksNkArzePVkVitP8UqMHcGx00xyk44iw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKj8B4Clhz4cP for ; Mon, 01 Dec 2025 11:57:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id b00c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 01 Dec 2025 11:57:46 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 9636482dd8af - stable/15 - Remove TableGen objects from libllvm, fixing bad option registrations List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 9636482dd8afcb426a658a98760bccf882196b4e Auto-Submitted: auto-generated Date: Mon, 01 Dec 2025 11:57:46 +0000 Message-Id: <692d82ba.b00c.39ea58b5@gitrepo.freebsd.org> The branch stable/15 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=9636482dd8afcb426a658a98760bccf882196b4e commit 9636482dd8afcb426a658a98760bccf882196b4e Author: Dimitry Andric AuthorDate: 2025-11-28 18:12:01 +0000 Commit: Dimitry Andric CommitDate: 2025-12-01 11:57:06 +0000 Remove TableGen objects from libllvm, fixing bad option registrations In 986e05bc2a18 I revamped the build for all the llvm subprojects. Among others I added objects under contrib/llvm-project/llvm/lib/TableGen, but I missed that upstream explicitly removes these when building the shared llvm library: https://github.com/llvm/llvm-project/blob/llvmorg-19.1.7/llvm/tools/llvm-shlib/CMakeLists.txt#L23 In 2e47f35be5dc I converted libllvm to a shared library. From that point onwards, some of the global command line option objects registered in llvm/lib/TableGen/Main.cpp conflict with similar objects in tools like llvm-cov, llvm-as, etc. This results in an error when running these tools: "CommandLine Error: Option 'o' registered more than once!", followed by a fatal exit. Fix this by removing the TableGen objects from libllvm. Note that we no longer install any of the tblgen binaries, these are only used during buildworld, and then in a statically linked form. PR: 291233 MFC after: 3 days (cherry picked from commit 9978553d0199e7ec0bdd1c44fc7f6c7b0c11e43b) --- lib/clang/libllvm/Makefile | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lib/clang/libllvm/Makefile b/lib/clang/libllvm/Makefile index e634a72b4f90..810eac08d8d5 100644 --- a/lib/clang/libllvm/Makefile +++ b/lib/clang/libllvm/Makefile @@ -1245,16 +1245,6 @@ SRCS_MIN+= Support/regexec.c SRCS_MIN+= Support/regfree.c SRCS_MIN+= Support/regstrlcpy.c SRCS_MIN+= Support/xxhash.cpp -SRCS_MIN+= TableGen/DetailedRecordsBackend.cpp -SRCS_MIN+= TableGen/Error.cpp -SRCS_MIN+= TableGen/JSONBackend.cpp -SRCS_MIN+= TableGen/Main.cpp -SRCS_MIN+= TableGen/Record.cpp -SRCS_MIN+= TableGen/SetTheory.cpp -SRCS_MIN+= TableGen/StringMatcher.cpp -SRCS_MIN+= TableGen/TGLexer.cpp -SRCS_MIN+= TableGen/TGParser.cpp -SRCS_MIN+= TableGen/TableGenBackend.cpp .if ${MK_LLVM_TARGET_AARCH64} != "no" SRCS_MIN+= Target/AArch64/AArch64A53Fix835769.cpp SRCS_MIN+= Target/AArch64/AArch64A57FPLoadBalancing.cpp From nobody Mon Dec 1 11:58:00 2025 X-Original-To: dev-commits-src-branches@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 4dKj8S570hz6HqNL for ; Mon, 01 Dec 2025 11:58:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKj8S2mWWz3qMl for ; Mon, 01 Dec 2025 11:58:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764590280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ie0r8KYdOGU6Pw9Mk4ROXK/KoDsvIyHQBVODy740oG0=; b=Gn9ttlH3zu/81PqvO6MmRvpub8FI3vr2K72hkHS59tAZxmeM8fcOBirs5caXvG8UT4YHuW h/Lln76p4LQLPAKLLdaVRmS3kUj0geGJ6g6qHIIQn9EIZSYLnQvtEthUgXcEaFgbxvwsOL p7x62YaQIak2anbZM8pMVCKMtOHmdT4G8FFoAI1N5bkJd2yX6VPBXDmoYG+prXQR356C1Y HzZ+3urB7sQ5lZ8srjq+1S7QFxDpbB3hOCbTk/g4ZSQRWxV9vhEVqaTSiIDWYBs+0lbuR+ R5G7n/ibcRdq+Vkar1aCnQ7v1gF14ghl80RiQKscAc6xzaREjaFKSo0nBeVz7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764590280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ie0r8KYdOGU6Pw9Mk4ROXK/KoDsvIyHQBVODy740oG0=; b=V7HnCMjPcD4xH0Q/R8E+sPxyKYsKus4VKPbhLx0ARDpIjTE4qzLMPlQolQbBT61DYxobRq +tIE7g1NnAq3MLYm+NN7EsTgL5fGVsRdZVl4ad3Fu86f7vnbIFwAWZQfBEq6iAhGq4EGG2 0ap1/gghGvJFWJ2K0es56IffDBr1Dr1Tpt69FB9OWJDiG1MH4bq3P/98x0oXSn724U7ZDT /avn+i8G0Eyn/0Hnvev/W3475NLhVQk8edqMO3yw0zoh5bXGsnbQ9UsYb+yaW9e5lNiaxb 4D6TlUIusgwexywWddCyoo28a5rxNQ3xlqwYSRvtxF66BqFr/4JDAipUt/4ytQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764590280; a=rsa-sha256; cv=none; b=wlunq6O/s5Lwg5SIK4fxqmSE2aD6VnZK/5PReHkr9u7m744/5Zg7PbqgTXh1de7Iqm946z uWmlHmqKcrz3AbJE865Nvrfk28wR9tf1S+D2mOGGj+9w8lr3Cio+zc/8+7T08QWm6wcBAT 10FKBTo4hqedwOAT+nmkEAyrTWjq2O0ROrNHODmMnX3K+MSOvzHGpSm1g1yG+QmgeMdYhU f6ByXUeYTEbwOpjLKtzXtzvQvZTzHco3LI7LavOBA5lBaJghImy81VNpEMu+I2fzymQUh4 y9a+uofgoH3lC5S/xNA9iIZk787uEKJtgmNXwwy+Q/x5d2ZUEokyP55RXA18+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKj8S1fJrz4ZP for ; Mon, 01 Dec 2025 11:58:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 92bb by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 01 Dec 2025 11:58:00 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 1fbba4fbf0f8 - stable/14 - Remove TableGen objects from libllvm, fixing bad option registrations List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1fbba4fbf0f88e551ca8d3bf759d29b0867ce03e Auto-Submitted: auto-generated Date: Mon, 01 Dec 2025 11:58:00 +0000 Message-Id: <692d82c8.92bb.292bd159@gitrepo.freebsd.org> The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=1fbba4fbf0f88e551ca8d3bf759d29b0867ce03e commit 1fbba4fbf0f88e551ca8d3bf759d29b0867ce03e Author: Dimitry Andric AuthorDate: 2025-11-28 18:12:01 +0000 Commit: Dimitry Andric CommitDate: 2025-12-01 11:57:11 +0000 Remove TableGen objects from libllvm, fixing bad option registrations In 986e05bc2a18 I revamped the build for all the llvm subprojects. Among others I added objects under contrib/llvm-project/llvm/lib/TableGen, but I missed that upstream explicitly removes these when building the shared llvm library: https://github.com/llvm/llvm-project/blob/llvmorg-19.1.7/llvm/tools/llvm-shlib/CMakeLists.txt#L23 In 2e47f35be5dc I converted libllvm to a shared library. From that point onwards, some of the global command line option objects registered in llvm/lib/TableGen/Main.cpp conflict with similar objects in tools like llvm-cov, llvm-as, etc. This results in an error when running these tools: "CommandLine Error: Option 'o' registered more than once!", followed by a fatal exit. Fix this by removing the TableGen objects from libllvm. Note that we no longer install any of the tblgen binaries, these are only used during buildworld, and then in a statically linked form. PR: 291233 MFC after: 3 days (cherry picked from commit 9978553d0199e7ec0bdd1c44fc7f6c7b0c11e43b) --- lib/clang/libllvm/Makefile | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lib/clang/libllvm/Makefile b/lib/clang/libllvm/Makefile index cb16d39961ae..2060f5f52c91 100644 --- a/lib/clang/libllvm/Makefile +++ b/lib/clang/libllvm/Makefile @@ -1246,16 +1246,6 @@ SRCS_MIN+= Support/regexec.c SRCS_MIN+= Support/regfree.c SRCS_MIN+= Support/regstrlcpy.c SRCS_MIN+= Support/xxhash.cpp -SRCS_MIN+= TableGen/DetailedRecordsBackend.cpp -SRCS_MIN+= TableGen/Error.cpp -SRCS_MIN+= TableGen/JSONBackend.cpp -SRCS_MIN+= TableGen/Main.cpp -SRCS_MIN+= TableGen/Record.cpp -SRCS_MIN+= TableGen/SetTheory.cpp -SRCS_MIN+= TableGen/StringMatcher.cpp -SRCS_MIN+= TableGen/TGLexer.cpp -SRCS_MIN+= TableGen/TGParser.cpp -SRCS_MIN+= TableGen/TableGenBackend.cpp .if ${MK_LLVM_TARGET_AARCH64} != "no" SRCS_MIN+= Target/AArch64/AArch64A53Fix835769.cpp SRCS_MIN+= Target/AArch64/AArch64A57FPLoadBalancing.cpp From nobody Mon Dec 1 11:58:11 2025 X-Original-To: dev-commits-src-branches@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 4dKj8g4xSgz6HqY8 for ; Mon, 01 Dec 2025 11:58:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKj8g1kMhz3qqF for ; Mon, 01 Dec 2025 11:58:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764590291; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6rl2E4jiStLgBreRX9VlEkFQhs0FEABnXFkgYopN2g4=; b=K/XQaoqM6n41RFxGxnTiBrpWQTOyPYCukhmGTCzYG0jCfmASG2Pl+g8x0UC2MqAwUDEPFo t6jnGpDl1ovRgm9EJ1w93D2iIEFOeisvP+NZ15FJtWYOcTLSBkug+MJl45lBMjmEyT7Nic j0LQUXOBPz3Vpmlo+ve1IWr8c/Xz5UTO/lqc88QBTx8NMahpadSIiYgiHPW3iJgBBdymkJ vfQVgA0yRscqu/JSTEyY1XRIzgbLQZnbj8mY2FXcYVi5/0sj10Vj6VYbOvP7XjZVv9MNkn j5ZHBH252j0p4AfSBnluc0L64RvsS7RK1HRGu/jOLh+b3UeQvYCtD9mSYAv6nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764590291; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6rl2E4jiStLgBreRX9VlEkFQhs0FEABnXFkgYopN2g4=; b=Q/xsCAX7TT6FiqIo+xinaCCKJ4VgQlut892hzNzT536rRao/+pCIp9vtX7lMn6VrVzVqPS Lf6ffTAYy79GVTGwD1X5KoZxYZyG8IK9LGJzGJjOpevkySlFc17msXMsgTwcKF3I+S3Lle hFb57Hw1UszxcgHhUJKbnI8DnJibz8y9Ozmjm/1dgMdJ3vmxHlK+8HOINV6yL4CfZIDPGa s6nA1Yzt57te5ynwGTYx3AZPdKFko1IJiYP+hLZVQfRp/4+9/t+SHJ2RmudhijJWrxZ0RF QLT3b/t41RsoEWeB9ww1IiW/HWuO/hsmxfUXPqxeXwqOfaxGi4cNwbrOmubeUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764590291; a=rsa-sha256; cv=none; b=sGxztFf0qgLs35xSSA7fCeOjPKaHt5GC95o0xvHLgGV0XnRDAylwSqusXlkRzHbBYRJvtx t7H+yhiItFdEhIPBl2VBn0yCTuMJt1bg0F6YVy7zopswPNhBbMfla0RTZ1eGIh5AiPAZV/ mxDVKaN/BW7wW7TZHVeCHZrLtMMT9+VG8MD/j729p/w/JeBFZ9iDZXFfzjpBJBrZ2VA3V+ H3bzGbXNbvKYjlAhGLozcoj8Hnf90wnRKiBdFlt3HtdeFki1Hof5BbcTDtv8JqRUGJ80zj mbc6wWuaGWuEoMk4PlKMka/uyCMcmPsQlDnX+RSl3ApQzvF/Jk88DJz8GlWC5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKj8g1GzDz4cQ for ; Mon, 01 Dec 2025 11:58:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id b010 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 01 Dec 2025 11:58:11 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: f4ff747cb709 - stable/13 - Remove TableGen objects from libllvm, fixing bad option registrations List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f4ff747cb709efeed3c1867060a81ae3ee72d474 Auto-Submitted: auto-generated Date: Mon, 01 Dec 2025 11:58:11 +0000 Message-Id: <692d82d3.b010.4963715a@gitrepo.freebsd.org> The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=f4ff747cb709efeed3c1867060a81ae3ee72d474 commit f4ff747cb709efeed3c1867060a81ae3ee72d474 Author: Dimitry Andric AuthorDate: 2025-11-28 18:12:01 +0000 Commit: Dimitry Andric CommitDate: 2025-12-01 11:57:17 +0000 Remove TableGen objects from libllvm, fixing bad option registrations In 986e05bc2a18 I revamped the build for all the llvm subprojects. Among others I added objects under contrib/llvm-project/llvm/lib/TableGen, but I missed that upstream explicitly removes these when building the shared llvm library: https://github.com/llvm/llvm-project/blob/llvmorg-19.1.7/llvm/tools/llvm-shlib/CMakeLists.txt#L23 In 2e47f35be5dc I converted libllvm to a shared library. From that point onwards, some of the global command line option objects registered in llvm/lib/TableGen/Main.cpp conflict with similar objects in tools like llvm-cov, llvm-as, etc. This results in an error when running these tools: "CommandLine Error: Option 'o' registered more than once!", followed by a fatal exit. Fix this by removing the TableGen objects from libllvm. Note that we no longer install any of the tblgen binaries, these are only used during buildworld, and then in a statically linked form. PR: 291233 MFC after: 3 days (cherry picked from commit 9978553d0199e7ec0bdd1c44fc7f6c7b0c11e43b) --- lib/clang/libllvm/Makefile | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lib/clang/libllvm/Makefile b/lib/clang/libllvm/Makefile index cb16d39961ae..2060f5f52c91 100644 --- a/lib/clang/libllvm/Makefile +++ b/lib/clang/libllvm/Makefile @@ -1246,16 +1246,6 @@ SRCS_MIN+= Support/regexec.c SRCS_MIN+= Support/regfree.c SRCS_MIN+= Support/regstrlcpy.c SRCS_MIN+= Support/xxhash.cpp -SRCS_MIN+= TableGen/DetailedRecordsBackend.cpp -SRCS_MIN+= TableGen/Error.cpp -SRCS_MIN+= TableGen/JSONBackend.cpp -SRCS_MIN+= TableGen/Main.cpp -SRCS_MIN+= TableGen/Record.cpp -SRCS_MIN+= TableGen/SetTheory.cpp -SRCS_MIN+= TableGen/StringMatcher.cpp -SRCS_MIN+= TableGen/TGLexer.cpp -SRCS_MIN+= TableGen/TGParser.cpp -SRCS_MIN+= TableGen/TableGenBackend.cpp .if ${MK_LLVM_TARGET_AARCH64} != "no" SRCS_MIN+= Target/AArch64/AArch64A53Fix835769.cpp SRCS_MIN+= Target/AArch64/AArch64A57FPLoadBalancing.cpp From nobody Mon Dec 1 16:38:04 2025 X-Original-To: dev-commits-src-branches@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 4dKqMc6nSTz6Js93 for ; Mon, 01 Dec 2025 16:38:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKqMc5y1hz3dFk for ; Mon, 01 Dec 2025 16:38:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764607084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WaO8opeLr8crTl+7YB4o4BUVJfyOPbd3S6N9hUqNNwY=; b=r5REoWbpQ7MwxXHNw5Jc2ibH6LPFnOb454qIFu3zz9L1vWfPqWbQREogpUdesXhiQWHwcL JlU8Ebnfr/x+tENH1BJCPxsToON/QaomZCjSEZorUoM0nQNearrzfZrpDF/xQQ/7tdizNH wQdjZRZb2XuGKg1mgDWVaSToVOYOgiu2/ysrGkrUmPr/B3oASd5qTCrr15ZxSqtItfpdJQ QPTrv6upsIfg3PqtnJdfgQufwDrynw9DfSDFL1fECV4kJR1o9WBlfQctrd5zvpG7uPdwUK v+WWjoz0kbLO2uHlWuyOFMD8z6u1d19SZLphbraXGFdvw2vN40bvHS6U9V221g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764607084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WaO8opeLr8crTl+7YB4o4BUVJfyOPbd3S6N9hUqNNwY=; b=U7CDqjF/eqV8yuo5ednQ7qXsGhi90rDFXdzDSsIt+3D90FksXqsl4SaYi0Ch6mowfmDNy/ 8NDYRa9AFO9BB2M4RFDfFemx0ukzCLSBv/R97RYy+iJWyGgAuzCwrGxoVUx2tLn+SDporB Sv1G5njA0FMaa310C/q+Bx2K5x1wR6B/nXD4Q6x4XfOnfRydaCe5nIzce4oDQkpr3ac2bt E68Nh8nKhr9GZfXoFb8JCfRlc51gGpqnCFyR4dGCHSgByH5UIQefel/p3CmZrHm/or8VwL GFHzVERD40FlAbQek4NL1+6F+1mz6/YwGh4l5RirULkbbxt33ID36Uuwnq0TGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764607084; a=rsa-sha256; cv=none; b=L6u2+RBmsXzcZpw+28LMKk7aNlIfrajL3BxHvewQf2+wcObtEM1Up/mQOoNfb+8sR8b9XO EhopKbJe9guO35q0yEEoOQ6hV4oyILTvcteEZHU1j10EKilD/xUpLA9jwxQXMcZsTmgMRF zdSNBLFM6HCUQF7aN9wNKd0RTon8v0DEmEt59cXEoq+w9s+9tRNuXRdBKpsJ0cUyh2qnfc Qz6ayB7SlunFoKVhScAPyo0M8QzHeo0BnzPDg/ZRRNx/WlDYHB6fj3nCq2npMhXln7Hw9n vrqgUMU6Yi3T39ZxTviB+V9pXB20M/oLhfnMSU8vxnQmi5eB9aG0X4AwIl1ItA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKqMc5Cz5zD7R for ; Mon, 01 Dec 2025 16:38:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 35a6a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 01 Dec 2025 16:38:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 3bba28c262f8 - stable/15 - gdb: Fix some PEP 8 violations List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 3bba28c262f88b6c7fc98d789693e611a1b60463 Auto-Submitted: auto-generated Date: Mon, 01 Dec 2025 16:38:04 +0000 Message-Id: <692dc46c.35a6a.5846a7a8@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3bba28c262f88b6c7fc98d789693e611a1b60463 commit 3bba28c262f88b6c7fc98d789693e611a1b60463 Author: Mark Johnston AuthorDate: 2025-11-19 13:58:11 +0000 Commit: Mark Johnston CommitDate: 2025-12-01 16:37:56 +0000 gdb: Fix some PEP 8 violations Silence some warnings in my editor. No functional change intended. MFC after: 1 week (cherry picked from commit 32605b159f3fea3a5d4710055681650f3de9ea68) --- sys/tools/gdb/acttrace.py | 2 ++ sys/tools/gdb/freebsd.py | 3 +++ sys/tools/gdb/pcpu.py | 3 +++ sys/tools/gdb/vnet.py | 3 ++- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/tools/gdb/acttrace.py b/sys/tools/gdb/acttrace.py index fdd18a4833cd..da79fda59da1 100644 --- a/sys/tools/gdb/acttrace.py +++ b/sys/tools/gdb/acttrace.py @@ -11,11 +11,13 @@ import gdb from freebsd import * from pcpu import * + class acttrace(gdb.Command): """ Print the stack trace of all threads that were on-CPU at the time of the panic. """ + def __init__(self): super(acttrace, self).__init__("acttrace", gdb.COMMAND_USER) diff --git a/sys/tools/gdb/freebsd.py b/sys/tools/gdb/freebsd.py index 81ea60373348..f88eef876c7f 100644 --- a/sys/tools/gdb/freebsd.py +++ b/sys/tools/gdb/freebsd.py @@ -6,6 +6,7 @@ import gdb + def symval(name): sym = gdb.lookup_global_symbol(name) if sym is None: @@ -72,4 +73,6 @@ def tdfind(tid, pid=-1): tdfind.cached_threads[int(ntid)] = td if ntid == tid: return td + + tdfind.cached_threads = dict() diff --git a/sys/tools/gdb/pcpu.py b/sys/tools/gdb/pcpu.py index 94c451e6eca5..08ae81e5121e 100644 --- a/sys/tools/gdb/pcpu.py +++ b/sys/tools/gdb/pcpu.py @@ -7,6 +7,7 @@ import gdb from freebsd import * + class pcpu(gdb.Function): """ A function to look up PCPU and DPCPU fields by name. @@ -16,6 +17,7 @@ class pcpu(gdb.Function): omitted, and the currently selected thread is on-CPU, that CPU is used, otherwise an error is raised. """ + def __init__(self): super(pcpu, self).__init__("PCPU") @@ -73,5 +75,6 @@ class pcpu(gdb.Function): obj = gdb.Value(pcpu_base + pcpu_entry_addr - start + base) return obj.cast(pcpu_entry.type.pointer()).dereference() + # Register with gdb. pcpu() diff --git a/sys/tools/gdb/vnet.py b/sys/tools/gdb/vnet.py index 5f416b2a515a..6175a5d6f551 100644 --- a/sys/tools/gdb/vnet.py +++ b/sys/tools/gdb/vnet.py @@ -5,9 +5,9 @@ # import gdb -import traceback from freebsd import * + class vnet(gdb.Function): """ A function to look up VNET variables by name. @@ -18,6 +18,7 @@ class vnet(gdb.Function): pointer to a struct vnet (e.g., vnet0 or allprison.tqh_first->pr_vnet) or a string naming a jail. """ + def __init__(self): super(vnet, self).__init__("V") From nobody Mon Dec 1 16:38:05 2025 X-Original-To: dev-commits-src-branches@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 4dKqMd6jv0z6JrwY for ; Mon, 01 Dec 2025 16:38:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKqMd5QWwz3dCQ for ; Mon, 01 Dec 2025 16:38:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764607085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gzv5Yz8n5fjyStb2Rju7ZJBhWWUJ+11Ax1m3qgh4GF0=; b=UF1QFBg8hWAmR6cQP69M/x5HGApEW8U4ClZ0TDSrvGsiQRGrxEtzHsYxViRRl0BPJbFtcV 017bhM5vqKhuIfhX7gCHfi95EFDp52MbIoBnDoEMNtiID50b4Gy0gD/8Kv5V+kpWNciWCq /rNqKUofCTIVPTmI3wGUBlX+kgT5xh5ib03e6K7eWWj0AFiBeU6DpPDKaO3zsyjdiVDisC E/L1QgO7j3aU2XUID4XfPteZo4Wubv9kNOFzRrPng5EAuS9LSfQxj4ovH/C5qKyIwDv3Gf F04K/q6rxTc5Um6TRdkE8TmbdceQK1dOuHKiWwoufrt5ZFDPZxUsiSwssJBa6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764607085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gzv5Yz8n5fjyStb2Rju7ZJBhWWUJ+11Ax1m3qgh4GF0=; b=fvYZ8q3ZblFH14O0bc1H2L3ixUafBrjfn1Y1pxatybG8yF49eZlYqr1yWhqkreqLl7BizV YFypfR4llOlzpeTFUvgIs9imilPLzvIfiY/sZ7L5uVMJVl22TvEQXdd0Y71izb4Q1VKOA5 yxHzkcaw0Lr+I2UcF7UM+VRBGfqhsI6i2km8XhBRWC5AffwAPvLn4La14rNXcL5Ox4l1xw 7obFwCaQF9Ob3ZX3ew3+tjAhgHes5HZBfEv5m/kXee9PY1gBAtM8dpveZXhz+6H/AvwqFj cu8RRAEjgL17XPXg/MnenOqKHnSPDh9AQaz6VZgdycmDsp1MVy+lTY2Ok2tP5Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764607085; a=rsa-sha256; cv=none; b=J/4Kb/27vPfIvrN9nTqNOWEk4z1WDmU3ui5VSHs5yHajBNR9+ISoPpgY6mUUZGU1c0/F+L SMvdpAz8/Wn4ZUmz1n541rCtyp8LkaffUS1NfhxwmCUkU/YN731/3vqShnUjzHU2njytBh ZEtc1PLPKDqio+blsWqrP0e1j0VI8oBFUjcyAq+oySas3chK6jqxgxnHxXovxabLLn8YaS U3aamkWi21oZXbRBWS+8isdn15Z2Q9IlJhJmawfe1VGKcEJBPsuxVvo+aQnQCasClxzbtM h+2bIdrRqZsXlzfOsAEZwtinH3lKokG+P8NPfPlcd8nKEZZx4TLjIu4eQiXOyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKqMd4yv4zCmf for ; Mon, 01 Dec 2025 16:38:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 37291 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 01 Dec 2025 16:38:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: c782957a4dd2 - stable/15 - jail: Make jaildesc_ops const List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: c782957a4dd29f2f7d61e83512bf994e8ec66e8d Auto-Submitted: auto-generated Date: Mon, 01 Dec 2025 16:38:05 +0000 Message-Id: <692dc46d.37291.29587d17@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c782957a4dd29f2f7d61e83512bf994e8ec66e8d commit c782957a4dd29f2f7d61e83512bf994e8ec66e8d Author: Mark Johnston AuthorDate: 2025-11-19 16:02:08 +0000 Commit: Mark Johnston CommitDate: 2025-12-01 16:37:56 +0000 jail: Make jaildesc_ops const No functional change intended. MFC after: 1 week (cherry picked from commit e22cc773f1a926fed3558c51bf0dd7890af26a2b) --- sys/kern/kern_jaildesc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_jaildesc.c b/sys/kern/kern_jaildesc.c index a564393d3366..f4e31801201f 100644 --- a/sys/kern/kern_jaildesc.c +++ b/sys/kern/kern_jaildesc.c @@ -54,7 +54,7 @@ static fo_close_t jaildesc_close; static fo_fill_kinfo_t jaildesc_fill_kinfo; static fo_cmp_t jaildesc_cmp; -static struct fileops jaildesc_ops = { +static const struct fileops jaildesc_ops = { .fo_read = invfo_rdwr, .fo_write = invfo_rdwr, .fo_truncate = invfo_truncate, From nobody Mon Dec 1 16:38:06 2025 X-Original-To: dev-commits-src-branches@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 4dKqMf73TYz6JrtB for ; Mon, 01 Dec 2025 16:38:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKqMf63klz3d0f for ; Mon, 01 Dec 2025 16:38:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764607086; 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; bh=zUnQjJOa2AHW3MN637NZUxAclwBqdVau3QF4A7qzikI=; b=vBBxt+GVDvyJMJIMBNd/oW4wCcF1PXkN8C2Jq8Oeub0kyQFcSuaLCYwlLFNI6N3TjRQvgo PWxRHHKiEAJXhmLfRgBl6Uzgoqsi/w7wyrqmPOWWpQZc2TXEr4X6xm/hD69Yp/NP2FOIdc 2B2OVt85z4pNlgopjxOVs693Gb1MsYoX//QkI396r8ayPhrIZVo7HwGodRaPEju1PhMCtG PXFJhuSvDHe3E5PmXV7JfwO75VK/a7xyPjOSBlQGEl71CQ1Hr7CKic7SVb6rB72u1qXBpT ZLxEkUTbV4IuVizFfBHtQ7KAAU4qMUJPKTj42cFAkE5xjFsBgtoe8DGIYKdxiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764607086; 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; bh=zUnQjJOa2AHW3MN637NZUxAclwBqdVau3QF4A7qzikI=; b=NlsRRTCdNSWLtCIbBr3spNAxkGKls7fTt1o6zXXNwrVOSezscLRA8mMfThd8o/yubDpGVC TPdiQ6CoSFClyW9EL1YxIbrThl/RirpXu/zqe4wW8qv3RY2mPyAAM3WCy1bp+kF3KrlMAC LNKcQNGJK789n4LmG5Fv17kQ7GQV+h9wkoOUCS8uGES8446cx9PzVLE8nuwdCgHl+tnWgm xYBtJsxzl1/xNNATa5s9TnDevRcj8aQR7BP52oL/U2n2UQFupE7K8PIJKvrKygv+wlXoHC 4kiPmGCpXC2D+K0ExQT8xWWqH+JcZ1YsmW0jLQioQ5RpcbwpckkdABFvUY016w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764607086; a=rsa-sha256; cv=none; b=Z8mg6X++AFSaMyFeSRc/VYAEFLld8FQALJDApsOGA9ocgn+4Dmh//dDX2iIRxyfEnzhIcR 2wet5ru+sFh8ygSfPhUrjzJHA7W17l8X4a1VR9IGBOHjUYE/hNWLoZgwpxnc/GTspTnxus oIXeUcG2zQoviCEU6C+w61Ycw4AUHoQJo1q4WuQAfyl92wt8Rfyowu4hcNIuhJA2e9zNbo 7fMBqdw08qAUjFRaH/rFCwdxWVKBV774vO95KNrxjvVVMcpqVP/sxBHwQWkHFvGkykeOY9 E3nf5+tN8bvjj7lxRbNdgmxhd+TEEb7jmNxvF0n5ONEJNO2GxtFU+aYz2+NFPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKqMf5PyrzCpb for ; Mon, 01 Dec 2025 16:38:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 355e5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 01 Dec 2025 16:38:06 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Quent=?utf-8?Q?in Th=C3=A9?=bault From: Mark Johnston Subject: git: 10a15419c460 - stable/15 - ng_device: replace dependency on vnode.h with fcntl.h List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 10a15419c460dc59ab346f352ca66f5b7f8fcf06 Auto-Submitted: auto-generated Date: Mon, 01 Dec 2025 16:38:06 +0000 Message-Id: <692dc46e.355e5.35b96da1@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=10a15419c460dc59ab346f352ca66f5b7f8fcf06 commit 10a15419c460dc59ab346f352ca66f5b7f8fcf06 Author: Quentin Thébault AuthorDate: 2025-08-28 06:27:03 +0000 Commit: Mark Johnston CommitDate: 2025-12-01 16:37:56 +0000 ng_device: replace dependency on vnode.h with fcntl.h Update to current convention of using fcntl.h O_* flags instead of vnode.h IO_* ones, as explained in sys/fs/devfs/devfs_vnops.c. Signed-off-by: Quentin Thébault Reviewed by: imp, jhb Pull Request: https://github.com/freebsd/freebsd-src/pull/1827 (cherry picked from commit 593d432e5852a254eeef83a8b1762492bb08668e) --- sys/netgraph/ng_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netgraph/ng_device.c b/sys/netgraph/ng_device.c index e4fcdfc635cb..79cae9933a5a 100644 --- a/sys/netgraph/ng_device.c +++ b/sys/netgraph/ng_device.c @@ -51,7 +51,7 @@ #include #include #include -#include +#include #include #include @@ -457,7 +457,7 @@ ngdread(struct cdev *dev, struct uio *uio, int flag) do { IF_DEQUEUE(&priv->readq, m); if (m == NULL) { - if (flag & IO_NDELAY) + if (flag & O_NONBLOCK) return (EWOULDBLOCK); mtx_lock(&priv->ngd_mtx); priv->flags |= NGDF_RWAIT; From nobody Mon Dec 1 16:38:07 2025 X-Original-To: dev-commits-src-branches@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 4dKqMh19t7z6Jryq for ; Mon, 01 Dec 2025 16:38:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKqMg6VVZz3d3G for ; Mon, 01 Dec 2025 16:38:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764607087; 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; bh=rjCnJpUPIYnOhQCnW+5oJe2FZl7l1sZs6ZoiyDlo2qI=; b=cXNOOQHBsmG+0pFGT7+5wFuH6qkFzkq1/dbvA/9hf5yV2+S0g4Dd+URnPtRXjfyL4+VSKZ J0paBfu+is/5ZXuM8cLooSG1VjsvuoD43aFfyd53zl6hIWZQn8nbhsBxgL3nK7zJKkRnSy yrs8JyN5e7su4INZBcz2WWh4LOrbgv19wiEVnxEPUV2e6+Il7MAHPZuTDqs12xn8GLg+7c XPtjsfLqjh/Mi8Vc9aWxP+iCgX5Dk22EZLxgwUm4hj8jT92C4OgraKEuKaSRHoAb0QutL4 4YqJ3a8fN8f7a+tn1bp8w/s98FAI/RA/CGQOYspBNcOrM2aVcsseDPfEtiPuLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764607087; 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; bh=rjCnJpUPIYnOhQCnW+5oJe2FZl7l1sZs6ZoiyDlo2qI=; b=MO8Fr77q/IBvmh/SFHJ/JpMqdt8ZspC29Cf0ewUaCb+ahGuUrcEvpaNGGW+FzGMaO6EF0D /4CeN2FrqRXGhCbR9dATofdvVXBELoxzBtFk3ZmmkM8LLrqjnjJWOS6aFS+hTg3AVMo2Kd zEmKg7ZVpES1F6OWvLWxa32FCZxu3wzoYhVAgzkYiz7DgLQ1O2pSRULDDCmw8AsOz177eK HwkKOjCtl+aKZk7D7ttQUoaJJSmxw1tSxC+mCCYt1uLgynwo/ixmGnoQ/4B/nsm01YOqmb 8REq+myNBmHMCyF+bsu0ud1dpl6qIdmgFS24xQ++cgmA8IFoMdE2LmpwuJL3aw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764607087; a=rsa-sha256; cv=none; b=X4PIy/t5gLpj+LA/ECsHAoMgt4hC/FCs88DYmcJkjTKNiuBLItC03+BTmjvhrjEt7Ua7Yp wu1T1xumv1oeKXxNF46GLx/iWUaTSZtS0fZUyoVgw+qXaGPQOGARkLp10t0A26tXxpQecb +I2R2x6OeWWtdfrVphxz4Q+IKqi5VVanBOODrawvFjUZB2D7UIccsv5jxpGQB1Z9PFuCN7 0awNfHumQAeJm7U+tIfESL1UWUwzKQNnd7onsynqS/M4ZbvJiHAOHGTZ4yhxxONq/OwP/G nv4X4ND/j4iJIyaiZEYvDKP9uZzX7ZJe2SsS3A8K4SisWcoqCCUMqoyF+mRSug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKqMg613MzCpd for ; Mon, 01 Dec 2025 16:38:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 37ac8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 01 Dec 2025 16:38:07 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Quent=?utf-8?Q?in Th=C3=A9?=bault From: Mark Johnston Subject: git: 57e4e7d12598 - stable/15 - ng_device: enable setting the device to non-blocking mode List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 57e4e7d125983779d96e3a4fddcad1b5495349f8 Auto-Submitted: auto-generated Date: Mon, 01 Dec 2025 16:38:07 +0000 Message-Id: <692dc46f.37ac8.72b106dd@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=57e4e7d125983779d96e3a4fddcad1b5495349f8 commit 57e4e7d125983779d96e3a4fddcad1b5495349f8 Author: Quentin Thébault AuthorDate: 2025-08-28 08:19:41 +0000 Commit: Mark Johnston CommitDate: 2025-12-01 16:37:57 +0000 ng_device: enable setting the device to non-blocking mode Return success when FIONBIO or FIOASYNC ioctl are received in order to support being set to non-blocking through fcntl(2). We return an error on FIOASYNC with non-zero data argument since we do not support O_ASYNC. Signed-off-by: Quentin Thébault Reviewed by: imp, jhb Pull Request: https://github.com/freebsd/freebsd-src/pull/1827 (cherry picked from commit 9fadaee7ecce02ab11cfbb18ea63b9bf1fb11bfc) --- sys/netgraph/ng_device.c | 41 ++++++++++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/sys/netgraph/ng_device.c b/sys/netgraph/ng_device.c index 79cae9933a5a..eca3a916a59f 100644 --- a/sys/netgraph/ng_device.c +++ b/sys/netgraph/ng_device.c @@ -38,20 +38,21 @@ #endif #include +#include #include +#include +#include +#include #include #include #include #include #include #include -#include #include #include #include -#include #include -#include #include #include @@ -135,9 +136,7 @@ static d_close_t ngdclose; static d_open_t ngdopen; static d_read_t ngdread; static d_write_t ngdwrite; -#if 0 static d_ioctl_t ngdioctl; -#endif static d_poll_t ngdpoll; static struct cdevsw ngd_cdevsw = { @@ -146,9 +145,7 @@ static struct cdevsw ngd_cdevsw = { .d_close = ngdclose, .d_read = ngdread, .d_write = ngdwrite, -#if 0 .d_ioctl = ngdioctl, -#endif .d_poll = ngdpoll, .d_name = NG_DEVICE_DEVNAME, }; @@ -397,6 +394,36 @@ ngdclose(struct cdev *dev, int flag, int mode, struct thread *td) return(0); } +/* + * Process IOCTLs + * + * At this stage we only return success on FIONBIO to allow setting the device + * as non-blocking. + * + */ +static int +ngdioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, + struct thread *td) +{ + int error; + + switch (cmd) { + case FIONBIO: + error = 0; + break; + case FIOASYNC: + if (*(int *)data != 0) + error = EINVAL; + else + error = 0; + break; + default: + error = ENOTTY; + } + + return (error); +} + #if 0 /* * The ioctl is transformed into netgraph control message. * We do not process them, yet. From nobody Mon Dec 1 16:38:08 2025 X-Original-To: dev-commits-src-branches@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 4dKqMj3rc3z6Js4L for ; Mon, 01 Dec 2025 16:38:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKqMj1VLmz3dP8 for ; Mon, 01 Dec 2025 16:38:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764607089; 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; bh=aogYQzdFLksKp1JGIFG0BBG7z4c3HDG7JjRUMP6bjH4=; b=tQF5rvgADlyF7LSkbsAFPhVGtpup/wnC7OFol7kWWSA3Ag3fPF6/89veCFZOY3KN68QKJS gkzHwWh0Iap153NXTOIP1womcecqPKgXTFrkQipA/pvdgk9A1RzwnWZ2NpFV9oDJYcAKIf 4HJrNolDI61t0XVMjkXU8rXt9+Ss7p+Rsskd7m2tnRM7aYo4IAdDia2WItLvaGpYx+LI/I 4tTosq3lBsPk1Jkvq6hzPz+NtzqgtxYagbby4r7nwIF+h2bucRm7M7L5p6YdNnsJJw28zk 9fMkywYeiGgyyEc5UySb2Q9NCpsZdDLIqqsXyYlV06D3pi4p29dO/2FiHDFE/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764607089; 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; bh=aogYQzdFLksKp1JGIFG0BBG7z4c3HDG7JjRUMP6bjH4=; b=NFJLBdko1vRVi2CBZadh+DQ0Nk0wSHjYvLKVOxU3WKpEU9UWB3wYDxKSa1qEDZnYu/9oo3 4APvFtaDZ/vIj3ebFahuuRPnN0ieoVD2I0bpdXMv3Mk4UAAdAaboCASdmU5bdMhxaLHo7m S56apo54X0szkelDeLmoW9ng6/Y+Nr7RsJnmOfmwwgfwyeLT8BxEhDSXjv+RYaaoB7vy+Z xTOa9NjVhC4ShWvP6LsbDQSatGKKiDn4oucoUir6x4HowddQnakH0JT5tMUbvFo4vf63Wp Bvj9J65e9hFXl2dKGtP9EnRINSMJpgdJd9DxaBs2D57jVfSsMsS6ruJ0jtvLZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764607089; a=rsa-sha256; cv=none; b=EbzWZRwC3oiAeVz+UfPWdF7BEHvX2uIgjJ4TrVMFFmqbs1K5bDCez0lKpnjgdzGtfJpWfR AYsSa67QvqlYtk6L8wVwX8luuDVnIlkM+gtmYC6a7CTFzZymxKBOekWGywjHHefHbP1jPS 9rkF254dBlITkwyDziEAewaLAcapYD9DC3sBTNfgvaClkJrEROsEpAh90i+3m7xhnuH58i sDnzjL13Gnm0ADh2++SAvnuLwW/4SXs13MAi0swSSsAPxpSsz43ieyYVFiaxfWyhbhmQsx 58v2nJv06Fne30sMMiuXg75We85QrKEtc1RNc4XPhS3xlyth2ovaooenuvZqdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKqMh6t3GzD7Y for ; Mon, 01 Dec 2025 16:38:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 36c61 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 01 Dec 2025 16:38:08 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Quent=?utf-8?Q?in Th=C3=A9?=bault From: Mark Johnston Subject: git: f817011fae28 - stable/15 - ng_device.c: improve compliance with style(9) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: f817011fae2838d80bf248f4411a1014cbbdb11a Auto-Submitted: auto-generated Date: Mon, 01 Dec 2025 16:38:08 +0000 Message-Id: <692dc470.36c61.36164bbe@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f817011fae2838d80bf248f4411a1014cbbdb11a commit f817011fae2838d80bf248f4411a1014cbbdb11a Author: Quentin Thébault AuthorDate: 2025-09-08 13:33:03 +0000 Commit: Mark Johnston CommitDate: 2025-12-01 16:37:57 +0000 ng_device.c: improve compliance with style(9) Signed-off-by: Quentin Thébault Reviewed by: imp, jhb Pull Request: https://github.com/freebsd/freebsd-src/pull/1827 (cherry picked from commit bcdbeaeffccb65574ac06001888840d9a15f4edf) --- sys/netgraph/ng_device.c | 63 ++++++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 29 deletions(-) diff --git a/sys/netgraph/ng_device.c b/sys/netgraph/ng_device.c index eca3a916a59f..582f877ff3ed 100644 --- a/sys/netgraph/ng_device.c +++ b/sys/netgraph/ng_device.c @@ -32,7 +32,7 @@ */ #if 0 -#define DBG do { printf("ng_device: %s\n", __func__ ); } while (0) +#define DBG do { printf("ng_device: %s\n", __func__); } while (0) #else #define DBG do {} while (0) #endif @@ -150,9 +150,11 @@ static struct cdevsw ngd_cdevsw = { .d_name = NG_DEVICE_DEVNAME, }; -/****************************************************************************** +/* + ***************************************************************************** * Netgraph methods - ******************************************************************************/ + ***************************************************************************** + */ /* * Handle loading and unloading for this node type. @@ -202,13 +204,13 @@ ng_device_constructor(node_p node) priv->ngddev = make_dev(&ngd_cdevsw, priv->unit, UID_ROOT, GID_WHEEL, 0600, NG_DEVICE_DEVNAME "%d", priv->unit); - if(priv->ngddev == NULL) { - printf("%s(): make_dev() failed\n",__func__); + if (priv->ngddev == NULL) { + printf("%s(): make_dev() failed\n", __func__); mtx_destroy(&priv->ngd_mtx); mtx_destroy(&priv->readq.ifq_mtx); free_unr(ngd_unit, priv->unit); free(priv, M_NETGRAPH); - return(EINVAL); + return (EINVAL); } /* XXX: race here? */ priv->ngddev->si_drv1 = priv; @@ -218,7 +220,7 @@ ng_device_constructor(node_p node) log(LOG_WARNING, "%s: can't acquire netgraph name\n", devtoname(priv->ngddev)); - return(0); + return (0); } /* @@ -286,7 +288,7 @@ ng_device_newhook(node_p node, hook_p hook, const char *name) priv->hook = hook; - return(0); + return (0); } /* @@ -319,7 +321,7 @@ ng_device_rcvdata(hook_p hook, item_p item) } mtx_unlock(&priv->ngd_mtx); - return(0); + return (0); } /* @@ -344,7 +346,7 @@ ng_device_disconnect(hook_p hook) ng_rmnode_self(NG_HOOK_NODE(hook)); - return(0); + return (0); } /* @@ -357,9 +359,11 @@ ng_device_shutdown(node_p node) return (0); } -/****************************************************************************** +/* + ***************************************************************************** * Device methods - ******************************************************************************/ + ***************************************************************************** + */ /* * the device is opened @@ -367,7 +371,7 @@ ng_device_shutdown(node_p node) static int ngdopen(struct cdev *dev, int flag, int mode, struct thread *td) { - priv_p priv = (priv_p )dev->si_drv1; + priv_p priv = (priv_p)dev->si_drv1; DBG; @@ -375,7 +379,7 @@ ngdopen(struct cdev *dev, int flag, int mode, struct thread *td) priv->flags |= NGDF_OPEN; mtx_unlock(&priv->ngd_mtx); - return(0); + return (0); } /* @@ -384,14 +388,14 @@ ngdopen(struct cdev *dev, int flag, int mode, struct thread *td) static int ngdclose(struct cdev *dev, int flag, int mode, struct thread *td) { - priv_p priv = (priv_p )dev->si_drv1; + priv_p priv = (priv_p)dev->si_drv1; DBG; mtx_lock(&priv->ngd_mtx); priv->flags &= ~NGDF_OPEN; mtx_unlock(&priv->ngd_mtx); - return(0); + return (0); } /* @@ -435,21 +439,22 @@ ngdioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, * */ static int -ngdioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td) +ngdioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, + struct thread *td) { struct ngd_softc *sc = &ngd_softc; - struct ngd_connection * connection = NULL; - struct ngd_connection * tmp; + struct ngd_connection *connection = NULL; + struct ngd_connection *tmp; int error = 0; struct ng_mesg *msg; - struct ngd_param_s * datap; + struct ngd_param_s *datap; DBG; NG_MKMESSAGE(msg, NGM_DEVICE_COOKIE, cmd, sizeof(struct ngd_param_s), M_NOWAIT); if (msg == NULL) { - printf("%s(): msg == NULL\n",__func__); + printf("%s(): msg == NULL\n", __func__); goto nomsg; } @@ -458,12 +463,12 @@ ngdioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td datap->p = addr; NG_SEND_MSG_HOOK(error, sc->node, msg, connection->active_hook, 0); - if(error) - printf("%s(): NG_SEND_MSG_HOOK error: %d\n",__func__,error); + if (error) + printf("%s(): NG_SEND_MSG_HOOK error: %d\n", __func__, error); nomsg: - return(0); + return (0); } #endif /* if 0 */ @@ -474,7 +479,7 @@ nomsg: static int ngdread(struct cdev *dev, struct uio *uio, int flag) { - priv_p priv = (priv_p )dev->si_drv1; + priv_p priv = (priv_p)dev->si_drv1; struct mbuf *m; int len, error = 0; @@ -510,14 +515,14 @@ ngdread(struct cdev *dev, struct uio *uio, int flag) /* * This function is called when our device is written to. - * We read the data from userland into mbuf chain and pass it to the remote hook. - * + * We read the data from userland into mbuf chain and pass it to the remote + * hook. */ static int ngdwrite(struct cdev *dev, struct uio *uio, int flag) { struct epoch_tracker et; - priv_p priv = (priv_p )dev->si_drv1; + priv_p priv = (priv_p)dev->si_drv1; struct mbuf *m; int error = 0; @@ -547,7 +552,7 @@ ngdwrite(struct cdev *dev, struct uio *uio, int flag) static int ngdpoll(struct cdev *dev, int events, struct thread *td) { - priv_p priv = (priv_p )dev->si_drv1; + priv_p priv = (priv_p)dev->si_drv1; int revents = 0; if (events & (POLLIN | POLLRDNORM) && From nobody Mon Dec 1 16:38:10 2025 X-Original-To: dev-commits-src-branches@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 4dKqMk35CFz6Js4P for ; Mon, 01 Dec 2025 16:38:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKqMk1Fcdz3dJZ for ; Mon, 01 Dec 2025 16:38:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764607090; 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; bh=LmeCURUPxeH70aOEIGWOFSIBAk2A8FFONJagPRmUmaY=; b=mgVbZkJJ4gMiL8q3h7315N887jT//rxiXg6aHZTTCAcAH8pOTf3UOOPvxbOCq47yRcoOF5 T2dm5VqaBFBu/ENmpY4yW/78C6jA5NozSpubWrQZ2ii3MOsHgkauI3xN06V51E+Nl654JW nq3Gtbl0QIqRzQjQi6I+lp+G5F5Mbncw2B8bAeZSpSgJV2g8fKr66OjWvlRGAjVfIg86Si GJ7Xuvsf5IFqeBlNvInkFEppQCW2CzQtqZDXBp7/cbfxS+zGhJsNEuuNCll5e8JFPgnrg6 zO0lmxbSmWMJORGaRZ/hUVSbRfcJDTWju9r9OFVrYkBeuOuO6AofPwRNmXkBBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764607090; 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; bh=LmeCURUPxeH70aOEIGWOFSIBAk2A8FFONJagPRmUmaY=; b=YWWbKWOqChRyUmSqa9D9MxO86AKt1roIBNqHfRgwzbPbwqAOReAxWig0R02d8M6xlgGxs6 MHdp1rR/Xc3n6akL7FKxeTkITsA7gWMKgISQWtxIujZyW83cmlKo8EgFDhD6miPkxDlgA0 Y6qt4jPN18bgF7ZsrL5Hhaw/VGTHZT/ukHNKn509YTSiUMOOoaXXoy2Cn+g7kWUff6VML1 KDNSXGGQtjyhOur2IjPqKdPoEwPr/DQ3DcR0AVWLTp4rATN7EmDbITAm7qHvqsjsW85DuY jDome46XZ99Fm0ESamd2pklsrO2SYvOMOIHnmjelZSRtLSKzFpxEsDOygMHh+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764607090; a=rsa-sha256; cv=none; b=xEkULQZTFe51jbi9GXJBk1dJTqq8bEpBBZZMSj4f36io1VEyiKXPbUBu2t4gmKyhQyx2cJ Zx2o+tl060UwxDq06uyZVqsWB/K6HmhtXCHq6VP/Uvn2bRgjJa0sdisos5ct3HoRJMt1Vw +OZ9zAuNnQtKouAWJdU5764+AdMntZZSkJ5G33p/5Jt5uZX7Q+njZoY8qq4Javz3RQw4cK 2yflXjyoyA0PYo0Fc8vXzGgKYDUA4izrSTB5CFpczy3gUZkIjta48PLSB/ewf/BWZiYy4j Pom2GDfoS7MQwHIm92skX/oE2hvpNm8RS3Xsslu4iMF7Y6y3OEKPwKCqu5/JUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKqMk0RDszCmh for ; Mon, 01 Dec 2025 16:38:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 36dbe by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 01 Dec 2025 16:38:10 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Quent=?utf-8?Q?in Th=C3=A9?=bault From: Mark Johnston Subject: git: e1834bc89e64 - stable/15 - ng_device: add kqueue support List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: e1834bc89e640a313ead585fdf2e3f1a944acdde Auto-Submitted: auto-generated Date: Mon, 01 Dec 2025 16:38:10 +0000 Message-Id: <692dc472.36dbe.77c3a43d@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e1834bc89e640a313ead585fdf2e3f1a944acdde commit e1834bc89e640a313ead585fdf2e3f1a944acdde Author: Quentin Thébault AuthorDate: 2025-09-09 03:48:46 +0000 Commit: Mark Johnston CommitDate: 2025-12-01 16:37:57 +0000 ng_device: add kqueue support Signed-off-by: Quentin Thébault Sponsored by: Defenso Reviewed by: markj MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D52541 Pull Request: https://github.com/freebsd/freebsd-src/pull/1880 (cherry picked from commit a505b80b2f038409300cd05e2ea95822942404e2) --- sys/netgraph/ng_device.c | 126 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 123 insertions(+), 3 deletions(-) diff --git a/sys/netgraph/ng_device.c b/sys/netgraph/ng_device.c index 582f877ff3ed..066e3be29694 100644 --- a/sys/netgraph/ng_device.c +++ b/sys/netgraph/ng_device.c @@ -3,6 +3,7 @@ * * Copyright (c) 2002 Mark Santcroos * Copyright (c) 2004-2005 Gleb Smirnoff + * Copyright (c) 2025 Quentin Thébault * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -50,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -117,12 +119,15 @@ struct ngd_private { struct ng_node *node; struct ng_hook *hook; struct cdev *ngddev; + struct selinfo rsel; + struct selinfo wsel; struct mtx ngd_mtx; int unit; int ether_align; uint16_t flags; #define NGDF_OPEN 0x0001 #define NGDF_RWAIT 0x0002 +#define NGDF_DYING 0x0004 }; typedef struct ngd_private *priv_p; @@ -138,6 +143,24 @@ static d_read_t ngdread; static d_write_t ngdwrite; static d_ioctl_t ngdioctl; static d_poll_t ngdpoll; +static d_kqfilter_t ngdkqfilter; + +static int ngd_kqread_event(struct knote *, long); +static int ngd_kqwrite_event(struct knote *, long); +static void ngd_kqread_detach(struct knote *); +static void ngd_kqwrite_detach(struct knote *); + +static const struct filterops ngd_read_filterops = { + .f_isfd = 1, + .f_detach = ngd_kqread_detach, + .f_event = ngd_kqread_event +}; + +static const struct filterops ngd_write_filterops = { + .f_isfd = 1, + .f_detach = ngd_kqwrite_detach, + .f_event = ngd_kqwrite_event +}; static struct cdevsw ngd_cdevsw = { .d_version = D_VERSION, @@ -146,6 +169,7 @@ static struct cdevsw ngd_cdevsw = { .d_read = ngdread, .d_write = ngdwrite, .d_ioctl = ngdioctl, + .d_kqfilter = ngdkqfilter, .d_poll = ngdpoll, .d_name = NG_DEVICE_DEVNAME, }; @@ -198,6 +222,9 @@ ng_device_constructor(node_p node) mtx_init(&priv->readq.ifq_mtx, "ng_device queue", NULL, MTX_DEF); IFQ_SET_MAXLEN(&priv->readq, ifqmaxlen); + knlist_init_mtx(&priv->rsel.si_note, &priv->ngd_mtx); + knlist_init_mtx(&priv->wsel.si_note, &priv->ngd_mtx); + /* Link everything together */ NG_NODE_SET_PRIVATE(node, priv); priv->node = node; @@ -206,6 +233,8 @@ ng_device_constructor(node_p node) GID_WHEEL, 0600, NG_DEVICE_DEVNAME "%d", priv->unit); if (priv->ngddev == NULL) { printf("%s(): make_dev() failed\n", __func__); + knlist_destroy(&priv->rsel.si_note); + knlist_destroy(&priv->wsel.si_note); mtx_destroy(&priv->ngd_mtx); mtx_destroy(&priv->readq.ifq_mtx); free_unr(ngd_unit, priv->unit); @@ -319,6 +348,8 @@ ng_device_rcvdata(hook_p hook, item_p item) priv->flags &= ~NGDF_RWAIT; wakeup(priv); } + selwakeup(&priv->rsel); + KNOTE_LOCKED(&priv->rsel.si_note, 0); mtx_unlock(&priv->ngd_mtx); return (0); @@ -334,9 +365,22 @@ ng_device_disconnect(hook_p hook) DBG; + mtx_lock(&priv->ngd_mtx); + priv->flags |= NGDF_DYING; + wakeup(priv); + mtx_unlock(&priv->ngd_mtx); + destroy_dev(priv->ngddev); + + knlist_clear(&priv->rsel.si_note, 0); + knlist_clear(&priv->wsel.si_note, 0); + knlist_destroy(&priv->rsel.si_note); + knlist_destroy(&priv->wsel.si_note); mtx_destroy(&priv->ngd_mtx); + seldrain(&priv->rsel); + seldrain(&priv->wsel); + IF_DRAIN(&priv->readq); mtx_destroy(&(priv)->readq.ifq_mtx); @@ -493,9 +537,13 @@ ngdread(struct cdev *dev, struct uio *uio, int flag) return (EWOULDBLOCK); mtx_lock(&priv->ngd_mtx); priv->flags |= NGDF_RWAIT; - if ((error = msleep(priv, &priv->ngd_mtx, - PDROP | PCATCH | PZERO, - "ngdread", 0)) != 0) + if (priv->flags & NGDF_DYING) { + mtx_unlock(&priv->ngd_mtx); + error = ENXIO; + } else + error = mtx_sleep(priv, &priv->ngd_mtx, + PDROP | PCATCH, "ngdread", 0); + if (error != 0) return (error); } } while (m == NULL); @@ -538,9 +586,12 @@ ngdwrite(struct cdev *dev, struct uio *uio, int flag) if (m == NULL) return (ENOBUFS); + /* Setting VNET is required if connecting to a ng_bridge. */ + CURVNET_SET(priv->node->nd_vnet); NET_EPOCH_ENTER(et); NG_SEND_DATA_ONLY(error, priv->hook, m); NET_EPOCH_EXIT(et); + CURVNET_RESTORE(); return (error); } @@ -561,3 +612,72 @@ ngdpoll(struct cdev *dev, int events, struct thread *td) return (revents); } + +static void +ngd_kqread_detach(struct knote *kn) +{ + priv_p priv = (priv_p)kn->kn_hook; + + knlist_remove(&priv->rsel.si_note, kn, 0); +} + +static int +ngd_kqread_event(struct knote *kn, long hint) +{ + priv_p priv = (priv_p)kn->kn_hook; + struct mbuf *m; + + IFQ_LOCK(&priv->readq); + if (IFQ_IS_EMPTY(&priv->readq)) { + kn->kn_data = 0; + } else { + /* + * Since the queue does not store the total number of bytes that + * could be read across all packets and we do not want to + * traverse the whole queue, we only report the number of bytes + * for the first packet in the queue. + */ + IF_POLL(&priv->readq, m); + kn->kn_data = m->m_len; + } + IFQ_UNLOCK(&priv->readq); + + return (kn->kn_data > 0); +} + +static void +ngd_kqwrite_detach(struct knote *kn) +{ + priv_p priv = (priv_p)kn->kn_hook; + + knlist_remove(&priv->wsel.si_note, kn, 0); +} + +static int +ngd_kqwrite_event(struct knote *kn, long hint) +{ + kn->kn_data = IP_MAXPACKET; + + return (1); +} + +static int +ngdkqfilter(struct cdev *dev, struct knote *kn) +{ + priv_p priv = (priv_p)dev->si_drv1; + + switch (kn->kn_filter) { + case EVFILT_READ: + kn->kn_fop = &ngd_read_filterops; + kn->kn_hook = priv; + knlist_add(&priv->rsel.si_note, kn, 0); + return (0); + case EVFILT_WRITE: + kn->kn_fop = &ngd_write_filterops; + kn->kn_hook = priv; + knlist_add(&priv->wsel.si_note, kn, 0); + return (0); + default: + return (EINVAL); + } +} From nobody Mon Dec 1 16:38:11 2025 X-Original-To: dev-commits-src-branches@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 4dKqMl3wGQz6Js7B for ; Mon, 01 Dec 2025 16:38:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKqMl1xBgz3dJq for ; Mon, 01 Dec 2025 16:38:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764607091; 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; bh=KlrzMYEPkPIyo8u3A5MRjgUWhPYBrtvowo1TM5FcMp4=; b=THH9sxNIGbU8bsn59C7/Uh41C2K/CYjwb+vt3UPRHhDzvVFQt5qDJVNcsi9AHURYb1rVIh fvhdRPi5TNFzapFYBUzLCaw/b22yPdAZP5YVpRr30B7WSp1xuL/4VqCZMMOuxvWczsCzOy aIVC0643zhRTqw+7q9KcZyIMRSgwPUnFHzHbIiKxR0TFNPPgJJqmY0BER/KLb2R0R1X/st SXgUNcmSM2NBnI9Kg53AKWFGXJHOjwq1V72k2wOizaoZo8nRe6B6tMrW/XSGMCepaaQNYJ pIWPRKQNbqbCez/+SVRDuMjNsMbZ+myU2e7J5cUmLFYRsC73ywILhjSS2DM8Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764607091; 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; bh=KlrzMYEPkPIyo8u3A5MRjgUWhPYBrtvowo1TM5FcMp4=; b=feYE4sbSJfibJn1qSY0Ve/WQyeAI63n5/fYbLBM38R1TiJ5nrqxB9EZQyQKxW4fRembP7y vQNhD5q5/kH2PLN3Unsf9fZxTi2VFQV+j5/krbXD1+TbnyssKAskyjAAaheqWTjKbLGHPl aOE/ZOMoP+GA8V4MsuTZCLTnlcBU+sjMmltdh7gMNcuXgfeokyDsSoKYsmPXyAlDpzzuro kO1COqVFyBhJ2jESknCEVbxcMR7m4BdVBvwrDL/60etHfvFXI9+62uD3CfDmZSnbn5TaPn TICt+Y9v+x3lGC6GLGBez8aS+E2ejNI/ycra0WzQie7UlZoD8ovaOp6zQ8he/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764607091; a=rsa-sha256; cv=none; b=HW4y1H5r+MNdK37cHOCkaBlvb43FCUKlIm7gCrhZhtaZZS92XbIKdoMUpKBldsu1V81wMu JXUrC5YzMINajTLRuuGKKHoeQHfWZGMz7aq5jgdNaamskh28+rImeyId5gXpoYKSjKZcLB 0/02v7yurSBtfl3JeRiuwsMR2ZcDOl04kU1pn4A2wobSvx5GZq4Qx1EcmPKgBS2NntSrh7 VPuUHvBa/RKpEoB2tcFac7sNkehGQpqG4ckV56gXZA179zTWXLK/fCqlZBoNHKYia20Od+ Vq5nZi2Z4fAB6Y35+90G4Q1A3mGd2SJay8pACQcE1frdUS5VkQBVy73mFGsGPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKqMl1H2jzCpg for ; Mon, 01 Dec 2025 16:38:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 8103 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 01 Dec 2025 16:38:11 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Quent=?utf-8?Q?in Th=C3=A9?=bault From: Mark Johnston Subject: git: 626cf6c8fcff - stable/15 - bhyve: add support for ng_device network backend List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 626cf6c8fcff7acf10da4894d6f876026cb173db Auto-Submitted: auto-generated Date: Mon, 01 Dec 2025 16:38:11 +0000 Message-Id: <692dc473.8103.7e43c99a@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=626cf6c8fcff7acf10da4894d6f876026cb173db commit 626cf6c8fcff7acf10da4894d6f876026cb173db Author: Quentin Thébault AuthorDate: 2025-09-12 08:39:55 +0000 Commit: Mark Johnston CommitDate: 2025-12-01 16:37:57 +0000 bhyve: add support for ng_device network backend Signed-off-by: Quentin Thébault Reviewed by: markj MFC after: 1 month Sponsored by: Defenso Differential Revision: https://reviews.freebsd.org/D52542 Pull Request: https://github.com/freebsd/freebsd-src/pull/1880 (cherry picked from commit 1aad95345237424918e5f6b18464df4dbc2aa1d8) --- usr.sbin/bhyve/bhyve.8 | 19 ++++++++++++++++++- usr.sbin/bhyve/net_backends.c | 19 ++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 13f0d239ef40..27e067f50394 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -521,6 +521,8 @@ considered unconnected. .Op Cm \&,mtu= Ar N .Xc .It +.Cm ngd Ar N +.It .Xo .Cm netgraph,path= Ar ADDRESS Cm \&,peerhook= Ar HOOK .Op Cm \&,socket= Ar NAME @@ -545,6 +547,19 @@ The MAC address is an ASCII string in .Xr ethers 5 format. .Pp +A +.Cm ngd +device can be used to connect a guest to a +.Xr netgraph 4 +through a +.Xr ng_device 4 +node. +This can be used to run bhyve in a +.Xr VNET 9 +jail, and give it access to the host's netgraph, that cannot be reached +directly, by exposing the ng_device through +.Xr devfs 8 . +.Pp With .Cm virtio-net devices, the @@ -575,7 +590,9 @@ must comply with .Xr netgraph 4 addressing rules. .Pp -The slirp backend can be used to provide a NATed network to the guest. +The +.Cm slirp +backend can be used to provide a NATed network to the guest. This backend has poor performance but does not require any network configuration on the host system. It depends on the diff --git a/usr.sbin/bhyve/net_backends.c b/usr.sbin/bhyve/net_backends.c index 2d11c45f217a..95909d1f8ea2 100644 --- a/usr.sbin/bhyve/net_backends.c +++ b/usr.sbin/bhyve/net_backends.c @@ -119,7 +119,8 @@ tap_init(struct net_backend *be, const char *devname, goto error; } - if (ioctl(be->fd, VMIO_SIOCSIFFLAGS, up)) { + if (strncmp("ngd", be->prefix, 3) && + ioctl(be->fd, VMIO_SIOCSIFFLAGS, up)) { EPRINTLN("tap device link up failed"); goto error; } @@ -273,8 +274,24 @@ static struct net_backend vmnet_backend = { .set_cap = tap_set_cap, }; +/* A clone of the tap backend, with a different prefix. */ +static struct net_backend ngd_backend = { + .prefix = "ngd", + .priv_size = sizeof(struct tap_priv), + .init = tap_init, + .cleanup = tap_cleanup, + .send = tap_send, + .peek_recvlen = tap_peek_recvlen, + .recv = tap_recv, + .recv_enable = tap_recv_enable, + .recv_disable = tap_recv_disable, + .get_cap = tap_get_cap, + .set_cap = tap_set_cap, +}; + DATA_SET(net_backend_set, tap_backend); DATA_SET(net_backend_set, vmnet_backend); +DATA_SET(net_backend_set, ngd_backend); int netbe_legacy_config(nvlist_t *nvl, const char *opts) From nobody Mon Dec 1 16:38:12 2025 X-Original-To: dev-commits-src-branches@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 4dKqMm4CVpz6Jryt for ; Mon, 01 Dec 2025 16:38:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKqMm2tcGz3dDF for ; Mon, 01 Dec 2025 16:38:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764607092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rj0Fcm1ZVCVffX5Tvh2m4Sl3uHulYOGvfFGm0nDvhUc=; b=KE9pu/JIv10I0hcw0nxZi9mIH4PAZSGvtzh6K7K4sGIFj5DwgJf8UYHo6LgYHmOJYXg6lf tzD/GLrLlNsQi9+uczTMZWTMosNsH7CaoO/e2nywAnRmulNl33zll/n1pLwZslvtsNPSmJ UoFWyquIA8JOfFr8x4JjLOjuEcJC/v8igIH8cgffqDwYF0/l/GgsGntMBpMuUkydIaj/KZ KqiZyQougRNjKo8x7BlN9746+aNtmzhWf0Twv9AYPf4V8BKFQmoERhRSInvEZsn9JnpBcE z6RQ+TlCA8swmB3/xuk9UIobLxuVJReLHZ7DN/brEtr5GuDxSiPQUFLKJZAPLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764607092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rj0Fcm1ZVCVffX5Tvh2m4Sl3uHulYOGvfFGm0nDvhUc=; b=k3W+hoEoyTiZz4ffdFJCAOpyJZ4TskIEgilZyQtXiCbPK1I58fhSPKZbsannT6W2rgnD4E gH2VBWmAW7Id8lZJivj835CtblOp9Ee9rGePtZ+hWuwU7vKzcxzPkI3a6PgwGseju8EyCl aMVaJzAvCWY8rlLpEJ1DdR7YLTxwkp1ptVP0FYeWyWZtnr4jjIOMC+BOagtvkFeunsum6c EqhrTWgP33r3liSmYJ6IYsp8r77BH8qnt5R8ECxO+vWevzTzZtgGAg5Usoi/vP9VA1wDFj TQNtMovc0t/xyNbZ//LBVJBjLC6tY3uroU/pkKGeqTstxwPTomtudoA/LyQJaw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764607092; a=rsa-sha256; cv=none; b=ZBpWStCmeppDxw6ycnn0/IhiBjWUuAKqDFKPlv28IrWL7FV6PsDtMADXNGlNrX72LEh1GD SmxKoANGFggXK+xSmOtTxjLMwiNyNvQxNqhT6X2PjLuzdv5yead1CRgWXmzEpVzJh1fgui pjRoj6hMvoJ2DAFc9bYrQ651sfIRxovrRPb5GKrxxVV31XQwZhkPgcXw4f2ozN8zKYiwHm dFHwXt7RSYy9+hEzO3imgGRGbZyqboqg6m5WtTSqUshu9VxgoQaPbxceTZQgHqSirI1c+e KwOMYq6rgnDPw0d+J0iznhDH7o+Uke+vzd3w9s4FYGWqaEC9xxZk0/Eag5eQYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKqMm27fRzD3K for ; Mon, 01 Dec 2025 16:38:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3750c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 01 Dec 2025 16:38:12 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: f15e54924ccb - stable/15 - file: Add a fdclose method List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: f15e54924ccbf405972eeacd3c2ad65df29c4a8d Auto-Submitted: auto-generated Date: Mon, 01 Dec 2025 16:38:12 +0000 Message-Id: <692dc474.3750c.791912b3@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f15e54924ccbf405972eeacd3c2ad65df29c4a8d commit f15e54924ccbf405972eeacd3c2ad65df29c4a8d Author: Mark Johnston AuthorDate: 2025-11-16 15:49:39 +0000 Commit: Mark Johnston CommitDate: 2025-12-01 16:37:57 +0000 file: Add a fdclose method Consider a program that creates a unix socket pair, transmits both sockets from one to the other using an SCM_RIGHTS message, and then closes both sockets without externalizing the message. unp_gc() is supposed to handle cleanup, but it is only triggered by uipc_detach(), which runs when a unix socket is destroyed. Because the two sockets are internalized, their refcounts are positive, so uipc_detach() isn't called. As a result, a userspace program can create an unbounded amount of garbage without triggering reclaim. Let's trigger garbage collection whenever a unix socket is close()d. To implement this, add new a fdclose file op and protocol op, and implement them accordingly. Since mqueuefs has a hack to hook into the file close path, convert it to use the new op as well. Now, userspace can't create garbage without triggering reclamation. Reviewed by: glebius, kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D53744 (cherry picked from commit 1390bba42caf53a00fa370f3844cd7b3725ed4ec) --- sys/kern/kern_descrip.c | 8 ++----- sys/kern/sys_socket.c | 12 ++++++++++ sys/kern/uipc_mqueue.c | 59 +++++++++++++++++++++++-------------------------- sys/kern/uipc_socket.c | 3 ++- sys/kern/uipc_usrreq.c | 27 ++++++++++++++++++---- sys/sys/file.h | 2 ++ sys/sys/mqueue.h | 5 ----- sys/sys/protosw.h | 7 ++++-- 8 files changed, 74 insertions(+), 49 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 58b048d780f1..ebc82b8dc427 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -194,7 +194,6 @@ struct filedesc0 { */ static int __exclusive_cache_line openfiles; /* actual number of open files */ struct mtx sigio_lock; /* mtx to protect pointers to sigio */ -void __read_mostly (*mq_fdclose)(struct thread *td, int fd, struct file *fp); /* * If low >= size, just return low. Otherwise find the first zero bit in the @@ -1404,11 +1403,8 @@ closefp_impl(struct filedesc *fdp, int fd, struct file *fp, struct thread *td, if (__predict_false(!TAILQ_EMPTY(&fdp->fd_kqlist))) knote_fdclose(td, fd); - /* - * We need to notify mqueue if the object is of type mqueue. - */ - if (__predict_false(fp->f_type == DTYPE_MQUEUE)) - mq_fdclose(td, fd, fp); + if (fp->f_ops->fo_fdclose != NULL) + fp->f_ops->fo_fdclose(fp, fd, td); FILEDESC_XUNLOCK(fdp); #ifdef AUDIT diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index c221106ae067..a326b9935290 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -90,6 +90,7 @@ static fo_poll_t soo_poll; static fo_kqfilter_t soo_kqfilter; static fo_stat_t soo_stat; static fo_close_t soo_close; +static fo_fdclose_t soo_fdclose; static fo_chmod_t soo_chmod; static fo_fill_kinfo_t soo_fill_kinfo; static fo_aio_queue_t soo_aio_queue; @@ -105,6 +106,7 @@ const struct fileops socketops = { .fo_kqfilter = soo_kqfilter, .fo_stat = soo_stat, .fo_close = soo_close, + .fo_fdclose = soo_fdclose, .fo_chmod = soo_chmod, .fo_chown = invfo_chown, .fo_sendfile = invfo_sendfile, @@ -362,6 +364,16 @@ soo_close(struct file *fp, struct thread *td) return (error); } +static void +soo_fdclose(struct file *fp, int fd __unused, struct thread *td) +{ + struct socket *so; + + so = fp->f_data; + if (so->so_proto->pr_fdclose != NULL) + so->so_proto->pr_fdclose(so); +} + static int soo_chmod(struct file *fp, mode_t mode, struct ucred *cred, struct thread *td) { diff --git a/sys/kern/uipc_mqueue.c b/sys/kern/uipc_mqueue.c index b808da088ffd..e26a21a6efe0 100644 --- a/sys/kern/uipc_mqueue.c +++ b/sys/kern/uipc_mqueue.c @@ -267,7 +267,6 @@ static int _mqueue_send(struct mqueue *mq, struct mqueue_msg *msg, static int _mqueue_recv(struct mqueue *mq, struct mqueue_msg **msg, int timo); static void mqueue_send_notification(struct mqueue *mq); -static void mqueue_fdclose(struct thread *td, int fd, struct file *fp); static void mq_proc_exit(void *arg, struct proc *p); /* @@ -688,7 +687,6 @@ mqfs_init(struct vfsconf *vfc) mqfs_fixup_dir(root); exit_tag = EVENTHANDLER_REGISTER(process_exit, mq_proc_exit, NULL, EVENTHANDLER_PRI_ANY); - mq_fdclose = mqueue_fdclose; p31b_setcfg(CTL_P1003_1B_MESSAGE_PASSING, _POSIX_MESSAGE_PASSING); mqfs_osd_jail_slot = osd_jail_register(NULL, methods); return (0); @@ -2472,35 +2470,6 @@ sys_kmq_notify(struct thread *td, struct kmq_notify_args *uap) return (kern_kmq_notify(td, uap->mqd, evp)); } -static void -mqueue_fdclose(struct thread *td, int fd, struct file *fp) -{ - struct mqueue *mq; -#ifdef INVARIANTS - struct filedesc *fdp; - - fdp = td->td_proc->p_fd; - FILEDESC_LOCK_ASSERT(fdp); -#endif - - if (fp->f_ops == &mqueueops) { - mq = FPTOMQ(fp); - mtx_lock(&mq->mq_mutex); - notifier_remove(td->td_proc, mq, fd); - - /* have to wakeup thread in same process */ - if (mq->mq_flags & MQ_RSEL) { - mq->mq_flags &= ~MQ_RSEL; - selwakeup(&mq->mq_rsel); - } - if (mq->mq_flags & MQ_WSEL) { - mq->mq_flags &= ~MQ_WSEL; - selwakeup(&mq->mq_wsel); - } - mtx_unlock(&mq->mq_mutex); - } -} - static void mq_proc_exit(void *arg __unused, struct proc *p) { @@ -2566,6 +2535,33 @@ mqf_close(struct file *fp, struct thread *td) return (0); } +static void +mqf_fdclose(struct file *fp, int fd, struct thread *td) +{ + struct mqueue *mq; +#ifdef INVARIANTS + struct filedesc *fdp; + + fdp = td->td_proc->p_fd; + FILEDESC_LOCK_ASSERT(fdp); +#endif + + mq = FPTOMQ(fp); + mtx_lock(&mq->mq_mutex); + notifier_remove(td->td_proc, mq, fd); + + /* have to wakeup thread in same process */ + if (mq->mq_flags & MQ_RSEL) { + mq->mq_flags &= ~MQ_RSEL; + selwakeup(&mq->mq_rsel); + } + if (mq->mq_flags & MQ_WSEL) { + mq->mq_flags &= ~MQ_WSEL; + selwakeup(&mq->mq_wsel); + } + mtx_unlock(&mq->mq_mutex); +} + static int mqf_stat(struct file *fp, struct stat *st, struct ucred *active_cred) { @@ -2694,6 +2690,7 @@ static const struct fileops mqueueops = { .fo_kqfilter = mqf_kqfilter, .fo_stat = mqf_stat, .fo_close = mqf_close, + .fo_fdclose = mqf_fdclose, .fo_chmod = mqf_chmod, .fo_chown = mqf_chown, .fo_sendfile = invfo_sendfile, diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index eb9544628137..00aa5f9309b2 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -54,7 +54,8 @@ * consumer of a socket is starting to tear down the socket, and that the * protocol should terminate the connection. Historically, pr_abort() also * detached protocol state from the socket state, but this is no longer the - * case. + * case. pr_fdclose() is called when userspace invokes close(2) on a socket + * file descriptor. * * socreate() creates a socket and attaches protocol state. This is a public * interface that may be used by socket layer consumers to create new diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 05e267b8ae2b..6569422a3710 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -792,13 +792,19 @@ uipc_connect2(struct socket *so1, struct socket *so2) return (0); } +static void +maybe_schedule_gc(void) +{ + if (atomic_load_int(&unp_rights) != 0) + taskqueue_enqueue_timeout(taskqueue_thread, &unp_gc_task, -1); +} + static void uipc_detach(struct socket *so) { struct unpcb *unp, *unp2; struct mtx *vplock; struct vnode *vp; - int local_unp_rights; unp = sotounpcb(so); KASSERT(unp != NULL, ("uipc_detach: unp == NULL")); @@ -854,7 +860,6 @@ uipc_detach(struct socket *so) UNP_REF_LIST_UNLOCK(); UNP_PCB_LOCK(unp); - local_unp_rights = unp_rights; unp->unp_socket->so_pcb = NULL; unp->unp_socket = NULL; free(unp->unp_addr, M_SONAME); @@ -865,8 +870,7 @@ uipc_detach(struct socket *so) mtx_unlock(vplock); vrele(vp); } - if (local_unp_rights) - taskqueue_enqueue_timeout(taskqueue_thread, &unp_gc_task, -1); + maybe_schedule_gc(); switch (so->so_type) { case SOCK_STREAM: @@ -902,6 +906,18 @@ uipc_disconnect(struct socket *so) return (0); } +static void +uipc_fdclose(struct socket *so __unused) +{ + /* + * Ensure that userspace can't create orphaned file descriptors without + * triggering garbage collection. Triggering GC from uipc_detach() is + * not sufficient, since that's only closed once a socket reference + * count drops to zero. + */ + maybe_schedule_gc(); +} + static int uipc_listen(struct socket *so, int backlog, struct thread *td) { @@ -4374,6 +4390,7 @@ static struct protosw streamproto = { .pr_connect2 = uipc_connect2, .pr_detach = uipc_detach, .pr_disconnect = uipc_disconnect, + .pr_fdclose = uipc_fdclose, .pr_listen = uipc_listen, .pr_peeraddr = uipc_peeraddr, .pr_send = uipc_sendfile, @@ -4404,6 +4421,7 @@ static struct protosw dgramproto = { .pr_connect2 = uipc_connect2, .pr_detach = uipc_detach, .pr_disconnect = uipc_disconnect, + .pr_fdclose = uipc_fdclose, .pr_peeraddr = uipc_peeraddr, .pr_sosend = uipc_sosend_dgram, .pr_sense = uipc_sense, @@ -4428,6 +4446,7 @@ static struct protosw seqpacketproto = { .pr_connect2 = uipc_connect2, .pr_detach = uipc_detach, .pr_disconnect = uipc_disconnect, + .pr_fdclose = uipc_fdclose, .pr_listen = uipc_listen, .pr_peeraddr = uipc_peeraddr, .pr_sense = uipc_sense, diff --git a/sys/sys/file.h b/sys/sys/file.h index b2bd62f244da..b537daa27ff5 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -114,6 +114,7 @@ typedef int fo_kqfilter_t(struct file *fp, struct knote *kn); typedef int fo_stat_t(struct file *fp, struct stat *sb, struct ucred *active_cred); typedef int fo_close_t(struct file *fp, struct thread *td); +typedef void fo_fdclose_t(struct file *fp, int fd, struct thread *td); typedef int fo_chmod_t(struct file *fp, mode_t mode, struct ucred *active_cred, struct thread *td); typedef int fo_chown_t(struct file *fp, uid_t uid, gid_t gid, @@ -151,6 +152,7 @@ struct fileops { fo_kqfilter_t *fo_kqfilter; fo_stat_t *fo_stat; fo_close_t *fo_close; + fo_fdclose_t *fo_fdclose; fo_chmod_t *fo_chmod; fo_chown_t *fo_chown; fo_sendfile_t *fo_sendfile; diff --git a/sys/sys/mqueue.h b/sys/sys/mqueue.h index 50f6681ce218..211f09d57427 100644 --- a/sys/sys/mqueue.h +++ b/sys/sys/mqueue.h @@ -37,9 +37,4 @@ struct mq_attr { long __reserved[4]; /* Ignored for input, zeroed for output */ }; -#ifdef _KERNEL -struct thread; -struct file; -extern void (*mq_fdclose)(struct thread *td, int fd, struct file *fp); -#endif #endif diff --git a/sys/sys/protosw.h b/sys/sys/protosw.h index 7fb8dfdc7208..392ff7cf678e 100644 --- a/sys/sys/protosw.h +++ b/sys/sys/protosw.h @@ -94,6 +94,7 @@ typedef int pr_sopoll_t(struct socket *, int, struct thread *); typedef int pr_kqfilter_t(struct socket *, struct knote *); typedef void pr_sosetlabel_t(struct socket *); typedef void pr_close_t(struct socket *); +typedef void pr_fdclose_t(struct socket *); typedef int pr_bindat_t(int, struct socket *, struct sockaddr *, struct thread *); typedef int pr_connectat_t(int, struct socket *, struct sockaddr *, @@ -120,8 +121,8 @@ struct protosw { pr_detach_t *pr_detach; /* destruction: sofree() */ pr_connect_t *pr_connect; /* connect(2) */ pr_disconnect_t *pr_disconnect; /* sodisconnect() */ - pr_close_t *pr_close; /* close(2) */ - pr_shutdown_t *pr_shutdown; /* shutdown(2) */ + pr_close_t *pr_close; /* soclose(), socket refcount is 0 */ + pr_fdclose_t *pr_fdclose; /* close(2) */ pr_rcvd_t *pr_rcvd; /* soreceive_generic() if PR_WANTRCVD */ pr_aio_queue_t *pr_aio_queue; /* aio(9) */ /* Cache line #3 */ @@ -142,7 +143,9 @@ struct protosw { pr_sosetlabel_t *pr_sosetlabel; /* MAC, XXXGL: remove */ pr_setsbopt_t *pr_setsbopt; /* Socket buffer ioctls */ pr_chmod_t *pr_chmod; /* fchmod(2) */ +/* Cache line #5 */ pr_kqfilter_t *pr_kqfilter; /* kevent(2) */ + pr_shutdown_t *pr_shutdown; /* shutdown(2) */ }; #endif /* defined(_KERNEL) || defined(_WANT_PROTOSW) */ #ifdef _KERNEL From nobody Mon Dec 1 16:38:13 2025 X-Original-To: dev-commits-src-branches@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 4dKqMn5g8nz6Jryy for ; Mon, 01 Dec 2025 16:38:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKqMn3WRjz3dGx for ; Mon, 01 Dec 2025 16:38:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764607093; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A4FatD2RMXTtFhkzCvnDRMvaJf5znPuYRhHyhFJO488=; b=TJJVuzzsH4bv3tN/E/jDcmlPdsYYEhs3pQEdFVX2I69lzD8SUghz3nUl5kb4uTNZsJOzlN L5fvlWMe2RpH94AwXnuKMW61XSLXy8mq1lLJtj5pCZ/YBNxILf7eUaVWCOG4fICjm8aHoU o6oV9iI82vXoUlHwRPeE/+U6wShskQECDWuCwSuU5ocTPxU8hlENZgG4tXC/OtCdVqaCoM 1QIbgN7toVx/suYgufSxT5juwW73Um6lt5JWT3FeB0bRDXn9RAaOkUKn7ddFL1umsMYMFx 4GsNpd5yrJ7wHSNXv8rKArucYsjVNUuRy/O3GdnxcWfKMYxnOHAGLyOkm7JfFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764607093; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A4FatD2RMXTtFhkzCvnDRMvaJf5znPuYRhHyhFJO488=; b=wcDVKnuQYQAV63rwAxYOBiqa9P1kNRM0hNp3l2AZtCml/Kp1vzYBtSkwqb9/iBfLRvsLGP aMcH+XVKIARK3ggjw94lhn9igpMOSLGMaw/zsiOf6t5ChDVogdlHsYgq6PS9ES4dIxJlK2 iuFreqPlwfNva+fEK5ArpoR1SGEP6ql1cmfuuu/1ULRsHvZdY7qIUQHa6Ik7Yko/GCSqNv dr7eXvjoOtf/ZP4BpFkEEhmNZmv6KbMWdo57XziTYKWgbfab0iSwmeE4FCIgt2SSuFgdxM 8F+haJLQX77uuAOWnid8k6KnCkhvM/2rXcRAXzt7RmxItCHu7L9kIJsb3mT9VQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764607093; a=rsa-sha256; cv=none; b=GNx9AoUpjBO6Xzz3SQG/VNA0j0YG5n6SEjFVRpZhwqPQaMZt2hOswsmxPjd8QjdlZmca/Z 4WMt/TnF/DzGRIWeTW8fCMUcl0XYT+27E8Wqk04U/HHhxvrMeezZ3X65oSENAFShLb/ytq 5XAnMzTP4Rbo8tabQBfVEhLl3FP7pvaO9zvVsAsiRxD3XPhnamn7ee0yXa2crtAMR6DGZX wzINtVKqKUlaHRsAJiTKSgfRtg0Z72lyXlRTNr6+c09U7E5ZPrwTTYdPzivhBrKLj5grt8 ZShdOcXx3gOBZYYg2O3Vv6lFxAg2p7LF3Z7R3Rkt3ySNy7M8T5A0nkRR+M3k9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKqMn2ttWzCpj for ; Mon, 01 Dec 2025 16:38:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 37295 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 01 Dec 2025 16:38:13 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 0db8e36b2baa - stable/15 - krb5: Use sh to run mk_cmds List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 0db8e36b2baa1979bb503ada3483bf9b0b1d5d3b Auto-Submitted: auto-generated Date: Mon, 01 Dec 2025 16:38:13 +0000 Message-Id: <692dc475.37295.3e00c739@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0db8e36b2baa1979bb503ada3483bf9b0b1d5d3b commit 0db8e36b2baa1979bb503ada3483bf9b0b1d5d3b Author: Mark Johnston AuthorDate: 2025-11-21 17:54:38 +0000 Commit: Mark Johnston CommitDate: 2025-12-01 16:37:57 +0000 krb5: Use sh to run mk_cmds Otherwise etcupdate apparently can fail if its private object directory under /var/db is in a filesystem mounted noexec. We shouldn't be building this target at all, but for now, just apply this workaround. PR: 291043 Reviewed by: ivy, cy, des MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53861 (cherry picked from commit 673924122470463dfb9089e12b1b4496783a77b8) --- krb5/util/ss/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/krb5/util/ss/Makefile b/krb5/util/ss/Makefile index 2c48ccf56573..30e1bf7b025e 100644 --- a/krb5/util/ss/Makefile +++ b/krb5/util/ss/Makefile @@ -85,7 +85,7 @@ ${GEN_SS_ERR_C}: ${GEN_SS_ERR} rm -f et-c-${.PREFIX}.et et-c-${.PREFIX}.c std_rqs.c: mk_cmds std_rqs.ct ss_err.h - ./mk_cmds ${KRB5_DIR}/util/ss/std_rqs.ct + sh mk_cmds ${KRB5_DIR}/util/ss/std_rqs.ct .include From nobody Tue Dec 2 01:59:52 2025 X-Original-To: dev-commits-src-branches@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 4dL3qr688Kz6JGHH for ; Tue, 02 Dec 2025 01:59:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dL3qr5Wqdz3sXT for ; Tue, 02 Dec 2025 01:59:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764640792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aeQ9Gyn3Ryw9cAQ1uNnZm6AkTaUbgnXa0Tpbeql89o4=; b=YJiIwKB8BQhNjObSscW9LoWWwNzTJDPNQU4d2wBQWuG8ZDY5E0bele7L05gfXZFUE99eNZ PsS7CRwfs7zD8K4/uct+eWN48EFAqju1rAbuJo0LXDtmvfw7RDUyNagjlif5aR/PX19bfz SDCE5LftGwZL9Anpc+jlHMIUASWD2DkrtCJnyHAy8gtJmp+2sC/JCjxSMIvXXjtZX5FeG6 i4KhbV8wIDFmbaFwyHq+/hHJgJTQRU0Q3iDu+3YgS9Nota6fA3clELP4qaw+C8trwvozxU mdZ64I5P/unUXf18+IurMbOHHGxGssOWC6fLk/b+jiGj6kPUfLX9Fgpf3Zw3xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764640792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aeQ9Gyn3Ryw9cAQ1uNnZm6AkTaUbgnXa0Tpbeql89o4=; b=v5LQ0YtZ4GwZhcejAsOakdau9eWEh8i3IJ7LU1l4na4hTC+bXiyVUHxakwX1h7XfksVWP5 /RE8s8hHdP90EclrViSuqwLoISQeyE4cMdAk1jHLOzU6hfan291m4yrywhCOBhMqJaDX9w an4qx5tqSgI2KskTi+Ea20wi04NddnBkEU9p/5rdqPgUKvWRNI5LkPqN34fCV4wb8Q8o4R zrQJS+R3PDIPHQcTZABbDOI6RF7x0Jnn0M1GPFVoiWvvNI+qRd9af79uqxC3MXffhPpeds MxD3wfyJCBBGnsf77+yJi8HwPyGXImbpUE7+byXJN3Q7++kWSqb4BnubXfH4DQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764640792; a=rsa-sha256; cv=none; b=c8Joq4iRpIk5o/66jdPGw+Y9oezFR2jB73z/2noxunEFq577wLU0Yzs23rukqJGEvWVBCu ifFUopH0B6JMzkCg1WLWzzXJJ65eHPGKP4vf+QFXnChZFGXGJWf3Fa97bWSh2s2rGTPBLP IQ2Xi9PoRvLZoWeUA34ShAQOojxRdGx/DtPv1R/bh0h6vFFyAExElNiyhXWTplIeISYg7F zUG03mOkeRcigOJO9rQ80OjWox2FZ3XS2J8FUSU9LYODMJgxeiJjMTqTc9z24E8uBHVSe5 5ycSlDGp+6Cth7AUJd3hOwRXuOZv+UfDVXAP1Tw3DnoZRek7NuNNO+HORoBLmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dL3qr50n7zmpQ for ; Tue, 02 Dec 2025 01:59:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 294b0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 02 Dec 2025 01:59:52 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: c6fe17a0d467 - stable/15 - mtree: Keep mtree files indented with spaces List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: c6fe17a0d467e8a56638bfbb89647e2e9b26f698 Auto-Submitted: auto-generated Date: Tue, 02 Dec 2025 01:59:52 +0000 Message-Id: <692e4818.294b0.1e11b018@gitrepo.freebsd.org> The branch stable/15 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=c6fe17a0d467e8a56638bfbb89647e2e9b26f698 commit c6fe17a0d467e8a56638bfbb89647e2e9b26f698 Author: Jose Luis Duran AuthorDate: 2025-11-29 00:12:39 +0000 Commit: Jose Luis Duran CommitDate: 2025-12-02 01:59:06 +0000 mtree: Keep mtree files indented with spaces The mtree tool indents directory entries with 4 spaces. Reviewed by: imp Fixes: 9cab9fde5eda ("virtual_oss: Port to base") MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D53979 (cherry picked from commit 3d91a746380e81c2089d8beaae28438867ae6dbf) --- etc/mtree/BSD.lib32.dist | 4 ++-- etc/mtree/BSD.usr.dist | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/etc/mtree/BSD.lib32.dist b/etc/mtree/BSD.lib32.dist index 6520b7b95116..8a3fe9a34714 100644 --- a/etc/mtree/BSD.lib32.dist +++ b/etc/mtree/BSD.lib32.dist @@ -21,7 +21,7 @@ .. pkgconfig .. - virtual_oss - .. + virtual_oss + .. .. .. diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index d6f451825928..ad2d8c5b39a4 100644 --- a/etc/mtree/BSD.usr.dist +++ b/etc/mtree/BSD.usr.dist @@ -103,8 +103,8 @@ .. ossl-modules .. - virtual_oss - .. + virtual_oss + .. .. libdata ldscripts From nobody Tue Dec 2 14:45:59 2025 X-Original-To: dev-commits-src-branches@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 4dLNqq75Z9z6KXvC for ; Tue, 02 Dec 2025 14:45:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dLNqq6W6rz42Yq for ; Tue, 02 Dec 2025 14:45:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764686759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oxoaiwkeotGMKIiqHXyKZT4RVAt0VGNvT7rpnluqFiE=; b=KBOjgaZ7GrBmL28mbEKpjkFirtSOv22nbNjfZwDFPksKxc8V8yXvP2hc+tDVWCJl+lp7cC dGjcEp4LUHkltigBBzLkVWGN6Je61AgQ2KnN+0REP3ACxaRIptIlNa4HgOzGc3l00B6zKU k35ezNsQ/Z3B6Xx8YyMYWx7WucXUqzDQD2otfq8THSME49iWP3kL0ldgDHkUw1Dc/jTu7X ygrktOpclHPLbeSWIeLpY5t28ju/Kc441qGtpXPSx0Uz9/wrtOn+R9F1+bboogXGA6TVq4 NYYTxuhNO6RAN6vW5s4HLoSALgyJxl2hUXm/ckDF4usf73PAUFnnOAldlyJ+2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764686759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oxoaiwkeotGMKIiqHXyKZT4RVAt0VGNvT7rpnluqFiE=; b=ULGtkZovhvk64hS2QZ5yK2fSh33GX0WLcdHhUxPoJUkyVpI1kLviDc5dm3VgxU4+GnD8qy GMWiNX9gdhGC1MieUWp8KJWCUYuM6UX/Wq2fQ01awcoLNfDzVFGA+cp1Gj7kY25m5B9qLT 4Tle/03je1yrnP+degBhoYpN7rBWNSFio8w3nf0NWfdll0nwzOhUaXkpdLh6KOIXmy7UZL TLc84m3KdRPW3qYKUmUKcWfutKkax1S+SKvOQav5F4RMm0fD0XQEZ0wCUF+tqO5nCY5KtD vUUp3B6TxO4XIjnJgX3mFGUaGDCgLHq8mCIaxZXN8fl90gZnhkXj5QHPEAVf6Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764686759; a=rsa-sha256; cv=none; b=eT1ZS6eCpsu6Vcu0bmW7a20PdZrqSRpJADvNpKfQwF38GHL+5ZQHgXvKknbVw0qs/zFS2v FQye7X8DK0Ce795J54Y/vBmnIxO7G9nj6mmWZRcm0zKTa5xPHOLBSSbgZx6+7sh6S3kyD4 dg26BcnsfqcLwrBXxicHy/32jXKOBG2Nz5IQuUE8Z6SM0QxvCRbEuScj+7EsYCnH4dUZUK iyY/AmU4QfMgZlFg7Wv4T6dmoJj1TopjwLIuU+vChKBlkG0N/Y0xAz3qC1utmAbX2ZCdhF F1IKfG5t+FHoD74F5qZ6m2CY60fKEvpe5NnstQXxWv3e8G3HKanV4vGcnPfkTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dLNqq63D8z19hb for ; Tue, 02 Dec 2025 14:45:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2f02f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 02 Dec 2025 14:45:59 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 1630af436a61 - stable/14 - vmm: Fix a deadlock between vm_smp_rendezvous() and vcpu_lock_all() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1630af436a6145e90f7b1aac1a91fbbfe9b22f57 Auto-Submitted: auto-generated Date: Tue, 02 Dec 2025 14:45:59 +0000 Message-Id: <692efba7.2f02f.33327be2@gitrepo.freebsd.org> The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1630af436a6145e90f7b1aac1a91fbbfe9b22f57 commit 1630af436a6145e90f7b1aac1a91fbbfe9b22f57 Author: Mark Johnston AuthorDate: 2025-10-17 13:09:38 +0000 Commit: Mark Johnston CommitDate: 2025-12-02 14:44:36 +0000 vmm: Fix a deadlock between vm_smp_rendezvous() and vcpu_lock_all() vm_smp_rendezvous() invokes a callback on all vCPUs, blocking the initiator until all vCPUs have responded. vcpu_lock_all() blocks each vCPU by waiting for it to go idle and setting the vCPU state to frozen. These two operations can deadlock on each other, particularly when booting a Windows guest, when vcpu_lock_all() blocks waiting for a rendezvous initiator, and the initiator is blocked waiting for the vCPU thread which called vcpu_lock_all() to invoke the rendezvous callback. Implement vcpu_lock_all() in a way that avoids deadlocks with vm_smp_rendezvous(). In particular, when traversing vCPUs, invoke the rendezvous callback on the vCPU's behalf to help the initiator finish. We can only safely do so when the vCPU is IDLE or we have already locked it, otherwise we may be racing with the target vCPU thread. Thus: - Use an exclusive lock to serialize vcpu_lock_all() callers, which lets us lock vCPUs out of order without fear of deadlock with parallel vcpu_lock_all() callers. - If a rendezvous is pending, lock all idle vCPUs and invoke the callback on their behalf. If the vcpu_lock_all() caller is itself a vCPU thread, this will handle that thread. - Block waiting for all non-idle vCPUs to idle, or until one of them initiates a rendezvous, in which case we go back and invoke callbacks on behalf of already-locked vCPUs. Note that on !amd64 no changes are needed since there is no rendezvous mechanism, so there is a separate vcpu_set_state_all() for them based on the previous vcpu_lock_all(). These will be merged together once vcpu state handling is consolidated into sys/dev/vmm. Reviewed by: corvink (previous version) MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D52968 (cherry picked from commit f39768e52e513264da60add0ca2412bddda271ff) --- sys/amd64/include/vmm.h | 3 +- sys/amd64/vmm/vmm.c | 177 ++++++++++++++++++++++++++++++++++++++++-------- sys/amd64/vmm/vmm_dev.c | 30 ++------ 3 files changed, 157 insertions(+), 53 deletions(-) diff --git a/sys/amd64/include/vmm.h b/sys/amd64/include/vmm.h index 368c3a6cb95b..09f2ea7cb0e5 100644 --- a/sys/amd64/include/vmm.h +++ b/sys/amd64/include/vmm.h @@ -225,7 +225,7 @@ extern u_int vm_maxcpu; /* maximum virtual cpus */ int vm_create(const char *name, struct vm **retvm); struct vcpu *vm_alloc_vcpu(struct vm *vm, int vcpuid); void vm_disable_vcpu_creation(struct vm *vm); -void vm_slock_vcpus(struct vm *vm); +void vm_lock_vcpus(struct vm *vm); void vm_unlock_vcpus(struct vm *vm); void vm_destroy(struct vm *vm); int vm_reinit(struct vm *vm); @@ -378,6 +378,7 @@ enum vcpu_state { }; int vcpu_set_state(struct vcpu *vcpu, enum vcpu_state state, bool from_idle); +int vcpu_set_state_all(struct vm *vm, enum vcpu_state state); enum vcpu_state vcpu_get_state(struct vcpu *vcpu, int *hostcpu); static int __inline diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index 677dcd05b9b2..787599bcfc97 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -557,9 +557,9 @@ vm_alloc_vcpu(struct vm *vm, int vcpuid) } void -vm_slock_vcpus(struct vm *vm) +vm_lock_vcpus(struct vm *vm) { - sx_slock(&vm->vcpus_init_lock); + sx_xlock(&vm->vcpus_init_lock); } void @@ -1342,6 +1342,54 @@ save_guest_fpustate(struct vcpu *vcpu) static VMM_STAT(VCPU_IDLE_TICKS, "number of ticks vcpu was idle"); +/* + * Invoke the rendezvous function on the specified vcpu if applicable. Return + * true if the rendezvous is finished, false otherwise. + */ +static bool +vm_rendezvous(struct vcpu *vcpu) +{ + struct vm *vm = vcpu->vm; + int vcpuid; + + mtx_assert(&vcpu->vm->rendezvous_mtx, MA_OWNED); + KASSERT(vcpu->vm->rendezvous_func != NULL, + ("vm_rendezvous: no rendezvous pending")); + + /* 'rendezvous_req_cpus' must be a subset of 'active_cpus' */ + CPU_AND(&vm->rendezvous_req_cpus, &vm->rendezvous_req_cpus, + &vm->active_cpus); + + vcpuid = vcpu->vcpuid; + if (CPU_ISSET(vcpuid, &vm->rendezvous_req_cpus) && + !CPU_ISSET(vcpuid, &vm->rendezvous_done_cpus)) { + VMM_CTR0(vcpu, "Calling rendezvous func"); + (*vm->rendezvous_func)(vcpu, vm->rendezvous_arg); + CPU_SET(vcpuid, &vm->rendezvous_done_cpus); + } + if (CPU_CMP(&vm->rendezvous_req_cpus, + &vm->rendezvous_done_cpus) == 0) { + VMM_CTR0(vcpu, "Rendezvous completed"); + CPU_ZERO(&vm->rendezvous_req_cpus); + vm->rendezvous_func = NULL; + wakeup(&vm->rendezvous_func); + return (true); + } + return (false); +} + +static void +vcpu_wait_idle(struct vcpu *vcpu) +{ + KASSERT(vcpu->state != VCPU_IDLE, ("vcpu already idle")); + + vcpu->reqidle = 1; + vcpu_notify_event_locked(vcpu, false); + VMM_CTR1(vcpu, "vcpu state change from %s to " + "idle requested", vcpu_state2str(vcpu->state)); + msleep_spin(&vcpu->state, &vcpu->mtx, "vmstat", hz); +} + static int vcpu_set_state_locked(struct vcpu *vcpu, enum vcpu_state newstate, bool from_idle) @@ -1356,13 +1404,8 @@ vcpu_set_state_locked(struct vcpu *vcpu, enum vcpu_state newstate, * ioctl() operating on a vcpu at any point. */ if (from_idle) { - while (vcpu->state != VCPU_IDLE) { - vcpu->reqidle = 1; - vcpu_notify_event_locked(vcpu, false); - VMM_CTR1(vcpu, "vcpu state change from %s to " - "idle requested", vcpu_state2str(vcpu->state)); - msleep_spin(&vcpu->state, &vcpu->mtx, "vmstat", hz); - } + while (vcpu->state != VCPU_IDLE) + vcpu_wait_idle(vcpu); } else { KASSERT(vcpu->state != VCPU_IDLE, ("invalid transition from " "vcpu idle state")); @@ -1414,6 +1457,95 @@ vcpu_set_state_locked(struct vcpu *vcpu, enum vcpu_state newstate, return (0); } +/* + * Try to lock all of the vCPUs in the VM while taking care to avoid deadlocks + * with vm_smp_rendezvous(). + * + * The complexity here suggests that the rendezvous mechanism needs a rethink. + */ +int +vcpu_set_state_all(struct vm *vm, enum vcpu_state newstate) +{ + cpuset_t locked; + struct vcpu *vcpu; + int error, i; + uint16_t maxcpus; + + KASSERT(newstate != VCPU_IDLE, + ("vcpu_set_state_all: invalid target state %d", newstate)); + + error = 0; + CPU_ZERO(&locked); + maxcpus = vm->maxcpus; + + mtx_lock(&vm->rendezvous_mtx); +restart: + if (vm->rendezvous_func != NULL) { + /* + * If we have a pending rendezvous, then the initiator may be + * blocked waiting for other vCPUs to execute the callback. The + * current thread may be a vCPU thread so we must not block + * waiting for the initiator, otherwise we get a deadlock. + * Thus, execute the callback on behalf of any idle vCPUs. + */ + for (i = 0; i < maxcpus; i++) { + vcpu = vm_vcpu(vm, i); + if (vcpu == NULL) + continue; + vcpu_lock(vcpu); + if (vcpu->state == VCPU_IDLE) { + (void)vcpu_set_state_locked(vcpu, VCPU_FROZEN, + true); + CPU_SET(i, &locked); + } + if (CPU_ISSET(i, &locked)) { + /* + * We can safely execute the callback on this + * vCPU's behalf. + */ + vcpu_unlock(vcpu); + (void)vm_rendezvous(vcpu); + vcpu_lock(vcpu); + } + vcpu_unlock(vcpu); + } + } + + /* + * Now wait for remaining vCPUs to become idle. This may include the + * initiator of a rendezvous that is currently blocked on the rendezvous + * mutex. + */ + CPU_FOREACH_ISCLR(i, &locked) { + if (i >= maxcpus) + break; + vcpu = vm_vcpu(vm, i); + if (vcpu == NULL) + continue; + vcpu_lock(vcpu); + while (vcpu->state != VCPU_IDLE) { + mtx_unlock(&vm->rendezvous_mtx); + vcpu_wait_idle(vcpu); + vcpu_unlock(vcpu); + mtx_lock(&vm->rendezvous_mtx); + if (vm->rendezvous_func != NULL) + goto restart; + vcpu_lock(vcpu); + } + error = vcpu_set_state_locked(vcpu, newstate, true); + vcpu_unlock(vcpu); + if (error != 0) { + /* Roll back state changes. */ + CPU_FOREACH_ISSET(i, &locked) + (void)vcpu_set_state(vcpu, VCPU_IDLE, false); + break; + } + CPU_SET(i, &locked); + } + mtx_unlock(&vm->rendezvous_mtx); + return (error); +} + static void vcpu_require_state(struct vcpu *vcpu, enum vcpu_state newstate) { @@ -1435,36 +1567,23 @@ vcpu_require_state_locked(struct vcpu *vcpu, enum vcpu_state newstate) static int vm_handle_rendezvous(struct vcpu *vcpu) { - struct vm *vm = vcpu->vm; + struct vm *vm; struct thread *td; - int error, vcpuid; - error = 0; - vcpuid = vcpu->vcpuid; td = curthread; + vm = vcpu->vm; + mtx_lock(&vm->rendezvous_mtx); while (vm->rendezvous_func != NULL) { - /* 'rendezvous_req_cpus' must be a subset of 'active_cpus' */ - CPU_AND(&vm->rendezvous_req_cpus, &vm->rendezvous_req_cpus, &vm->active_cpus); - - if (CPU_ISSET(vcpuid, &vm->rendezvous_req_cpus) && - !CPU_ISSET(vcpuid, &vm->rendezvous_done_cpus)) { - VMM_CTR0(vcpu, "Calling rendezvous func"); - (*vm->rendezvous_func)(vcpu, vm->rendezvous_arg); - CPU_SET(vcpuid, &vm->rendezvous_done_cpus); - } - if (CPU_CMP(&vm->rendezvous_req_cpus, - &vm->rendezvous_done_cpus) == 0) { - VMM_CTR0(vcpu, "Rendezvous completed"); - CPU_ZERO(&vm->rendezvous_req_cpus); - vm->rendezvous_func = NULL; - wakeup(&vm->rendezvous_func); + if (vm_rendezvous(vcpu)) break; - } + VMM_CTR0(vcpu, "Wait for rendezvous completion"); mtx_sleep(&vm->rendezvous_func, &vm->rendezvous_mtx, 0, "vmrndv", hz); if (td_ast_pending(td, TDA_SUSPEND)) { + int error; + mtx_unlock(&vm->rendezvous_mtx); error = thread_check_susp(td, true); if (error != 0) diff --git a/sys/amd64/vmm/vmm_dev.c b/sys/amd64/vmm/vmm_dev.c index 5214cd3f1447..032b7471664e 100644 --- a/sys/amd64/vmm/vmm_dev.c +++ b/sys/amd64/vmm/vmm_dev.c @@ -179,32 +179,16 @@ vcpu_unlock_one(struct vmmdev_softc *sc, int vcpuid, struct vcpu *vcpu) static int vcpu_lock_all(struct vmmdev_softc *sc) { - struct vcpu *vcpu; int error; - uint16_t i, j, maxcpus; - - error = 0; - vm_slock_vcpus(sc->vm); - maxcpus = vm_get_maxcpus(sc->vm); - for (i = 0; i < maxcpus; i++) { - vcpu = vm_vcpu(sc->vm, i); - if (vcpu == NULL) - continue; - error = vcpu_lock_one(vcpu); - if (error) - break; - } - if (error) { - for (j = 0; j < i; j++) { - vcpu = vm_vcpu(sc->vm, j); - if (vcpu == NULL) - continue; - vcpu_unlock_one(sc, j, vcpu); - } + /* + * Serialize vcpu_lock_all() callers. Individual vCPUs are not locked + * in a consistent order so we need to serialize to avoid deadlocks. + */ + vm_lock_vcpus(sc->vm); + error = vcpu_set_state_all(sc->vm, VCPU_FROZEN); + if (error != 0) vm_unlock_vcpus(sc->vm); - } - return (error); } From nobody Tue Dec 2 15:28:20 2025 X-Original-To: dev-commits-src-branches@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 4dLPmh3kYFz6HcwH for ; Tue, 02 Dec 2025 15:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dLPmh2HM8z4FWc for ; Tue, 02 Dec 2025 15:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764689300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J3+B5r3BvMoj9urHn2FaBYPWxBE8P8EDaIxaZ+d2Tcc=; b=mI/4Swb0SvuCE48cQ29YYMg6TsMC0P0kb6ChNXEymUcS6LCTe6uqjOwlekiBhZDtXVg3f4 F6z6P9n3epGKsLzLHB2OJukGmxjWq7R6kH/+6PFMTzaKf449B1h+GK7uC73istEhEhzQrK 9gQjh/DWEpHmCGRFOZNYePD+pEABjWo++gr6qDORtIJq0rVYEg0Qy4bEdIv7yzqEaxMbEd o0x6tgVhD9ghT2dCyymfsfZznt81YtiyswAcDSUQJj9uEE83DX9fZadgZlFMjFAdD6rlc0 Q1AeQjx+KTX1Ptk0wpZ885ADrehEft1RATs8KzeHsYS7kagQfl3xcUrR6u9abg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764689300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J3+B5r3BvMoj9urHn2FaBYPWxBE8P8EDaIxaZ+d2Tcc=; b=T8WvOVsVc7fWwtiGtbm9KerC+O9un6e/hcRU1HTveMfRX1jCWqpK1P4mahmMikW640OMZA m7Nv7PxZmhw/HZQ/UqihSFQkV5ZnGcrqM3+KglBC3NDNju1zn5uLEHxziDJnsMV8PbXdl8 utdEg0qrdv8vdmMxjGFXWuTltzE93GrxC4vWOYCiNgRe80OcR9IzsYdT0JsEMUYFq3/JrQ Vp6Edxg9xl9+oli3P26EdbE2PfTSEGapxTqfcT4bSFI/he7fOp+5RVmgwjgmNQVuMvecOg LbY1l6rZknrds3mq4xeLm19iQojkc6vBT6Fkir3/qwqxV4HtVURo2iLTX7fcmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764689300; a=rsa-sha256; cv=none; b=QvGvB8Z/7erTo/Oofziqodr+Mn56yRifE1Cn6WOwz4wEY+oKEpZcbVmg+yhsvxHOQBlEW9 AwCIlRmGee3zRqHDQTXGJT9mOgliib4+5Z1SSafWYx4SPlYPPGo3BSRDG+RRlJv2Uu0mnF lErB2xMYawzmzznKJxM6zaT8txCKuy9AFk3/BisPywJQpK9q7fPdGBiRbFEtNHVvfYrpmC iIkpVkzebIFuOb0EDYbMQqZHrVyCBoZECiCZUavNQo3+12Ge1azpiYp/LXkZjD3SzNgDHV vvr7R94/ITQSkg+1eSgNi/kjyFtIErntgBdrSjU9wuWRnJMDUZJ3dukdeRzgBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dLPmh1d5Mz1Bn6 for ; Tue, 02 Dec 2025 15:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33d16 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 02 Dec 2025 15:28:20 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: d7129761f5fc - stable/15 - ipfilter: Load optionlist prior to ippool invocation List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: d7129761f5fc8828d5701cfe14adffee58659648 Auto-Submitted: auto-generated Date: Tue, 02 Dec 2025 15:28:20 +0000 Message-Id: <692f0594.33d16.1108862@gitrepo.freebsd.org> The branch stable/15 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=d7129761f5fc8828d5701cfe14adffee58659648 commit d7129761f5fc8828d5701cfe14adffee58659648 Author: Cy Schubert AuthorDate: 2025-11-26 19:40:36 +0000 Commit: Cy Schubert CommitDate: 2025-12-02 15:28:15 +0000 ipfilter: Load optionlist prior to ippool invocation As a safety precaution df381bec2d2b limits ippool hash table size to 1K. This causes any legitimely large hash table to fail to load. The htable_size_max ipf tuneable adjusts this but the adjustment is made in the ipfilter rc script, invoked after the ippool script (because it depends on ippool). Let's load the ipfilter_optionlist in ippool as well. ipfilter_optionlist load will also occur in the ipfilter rc script in case the user uses ipfilter without ippool. Fixes: df381bec2d2b (cherry picked from commit d5d005e9bf4933d5680dd0bb5d42bdf440122aa4) --- libexec/rc/rc.d/ippool | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libexec/rc/rc.d/ippool b/libexec/rc/rc.d/ippool index 0db8bbe98f61..5ef0d0522621 100755 --- a/libexec/rc/rc.d/ippool +++ b/libexec/rc/rc.d/ippool @@ -27,6 +27,9 @@ required_modules="ipl:ipfilter" ippool_start_precmd() { rc_flags="-f ${ippool_rules} ${rc_flags}" + if [ -n "${ifilter_optionlist}" ]; then + ${ipfilter_program:-/sbin/ipf} -T "${ipfilter_optionlist}" + fi } ippool_reload() From nobody Tue Dec 2 15:29:04 2025 X-Original-To: dev-commits-src-branches@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 4dLPnX5XDkz6Hcqp for ; Tue, 02 Dec 2025 15:29:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dLPnX48Jnz4FvM for ; Tue, 02 Dec 2025 15:29:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764689344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/J9KRZluuEmUKGHFiDc8caLkbUCi/ViIS6PWxsTcvTA=; b=rVxRhqzd52HfiOyAgJSSLbq0VqgkpdfmwcevssVem8Zi3Lx5YgpV+l2vgH812cDa9F2UtG yaLKzjSBy3wbspmFB9utCdiDHwWxJ04IpNltOzOfkE7dZ4F3UYWUz2Hmp0w+ffhQvTmcSC 2ZjnlavO1GDdHQk9eTAXi31u6NbQeFIkEn3Jb2sUAfHJhTVtsxMIw00qaGBY/F5OdbIqZV gGPAghfGWn3pOkDV/Qil7dhEa7u99cDv4LMOu+ULXQDh7uY54Mony3s83XuKzyeaHpK/Qa DKVLc0KVBr4EtNel3Nq8objrhfBv0SSn80iUaFmfcZp3B+iRPdsgKXe8abiQ3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764689344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/J9KRZluuEmUKGHFiDc8caLkbUCi/ViIS6PWxsTcvTA=; b=B66z+F+03MNEkFaSEalKVu4YVK3/0oKkzVZxyCaQqNV5skBFuRI594Run8p3r0xrZq3Tei c7AQ6lOjewy/Bpu1OQANqJ3mufYr0J/3ZFcVbvuCeaYGssdD6pCzkj2CsUgl/6QFw07Xqq brGTka+DzNLMQ0j7C7BBcimtua/6cmxEDXCON2McpnMZmMXSuiMYg4xkSx+VbwTfk+iz2q MiNzuVfIivPELpsdrj4mvuldDPrYgecinNaLsCWYt45Qrd0Dy4COvFjqGhbTcehTagLikb d7hkNTqldhhAtEycbcEEMNmszbyRUPD8PP+tG3FNPQsJ+GWO7o57b7CM/bcsXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764689344; a=rsa-sha256; cv=none; b=fE1tC5Qqsut05zzC9bGCQOQaHPBtp8aTs3YVLbNJs89Cd+Vy+PovNSEF5dCmdlD5A6N7Eq NjWV6PBO5+bLOklPhaFEsxJsiMx0GqKI5nLmVEJaSllyJMmrpNGC1lNOT0CDfsGJLQ8VT+ f4TTKJq2jFAT9VTbNki0QYOqEEb9fRlAthe0EuKQjZHiVxDpNzM1bZrOVuPdRpI2P6Qoxk ubazDYYcxErEVLlbjlU0qrhhxXinAmrhAkmOqSnmXHWXCWkgfJu1WQzxya9uH149rR0xWp NBgfdv0L+q1aysjSq8MHFqbTeCKG5zOP4u1Ge/Vqx4c3wN/czLFUhnHsnickxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dLPnX3h2Lz1C8v for ; Tue, 02 Dec 2025 15:29:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 34a80 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 02 Dec 2025 15:29:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: c7cfc16f7ce0 - stable/13 - ipfilter: Load optionlist prior to ippool invocation List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c7cfc16f7ce08ae91b9ec6544348d750d08e65c1 Auto-Submitted: auto-generated Date: Tue, 02 Dec 2025 15:29:04 +0000 Message-Id: <692f05c0.34a80.76077ad6@gitrepo.freebsd.org> The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=c7cfc16f7ce08ae91b9ec6544348d750d08e65c1 commit c7cfc16f7ce08ae91b9ec6544348d750d08e65c1 Author: Cy Schubert AuthorDate: 2025-11-26 19:40:36 +0000 Commit: Cy Schubert CommitDate: 2025-12-02 15:28:55 +0000 ipfilter: Load optionlist prior to ippool invocation As a safety precaution df381bec2d2b limits ippool hash table size to 1K. This causes any legitimely large hash table to fail to load. The htable_size_max ipf tuneable adjusts this but the adjustment is made in the ipfilter rc script, invoked after the ippool script (because it depends on ippool). Let's load the ipfilter_optionlist in ippool as well. ipfilter_optionlist load will also occur in the ipfilter rc script in case the user uses ipfilter without ippool. Fixes: df381bec2d2b (cherry picked from commit d5d005e9bf4933d5680dd0bb5d42bdf440122aa4) --- libexec/rc/rc.d/ippool | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libexec/rc/rc.d/ippool b/libexec/rc/rc.d/ippool index 42cef3faf7eb..527e1fc780b2 100755 --- a/libexec/rc/rc.d/ippool +++ b/libexec/rc/rc.d/ippool @@ -23,6 +23,9 @@ required_modules="ipl:ipfilter" ippool_start_precmd() { rc_flags="-f ${ippool_rules} ${rc_flags}" + if [ -n "${ifilter_optionlist}" ]; then + ${ipfilter_program:-/sbin/ipf} -T "${ipfilter_optionlist}" + fi } ippool_reload() From nobody Tue Dec 2 15:58:31 2025 X-Original-To: dev-commits-src-branches@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 4dLQRW6vXVz6HgXc for ; Tue, 02 Dec 2025 15:58:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dLQRW6BJBz4NMd for ; Tue, 02 Dec 2025 15:58:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764691111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RBv/LU0FYocX8eXm07AZIxrwwQ4iQAht/lWH1JPgnzk=; b=Pdb2FQ3/zYWkcZd9c26oVk4kjjB6NzixXbDRod31vKcDQmwmiqhnF/g+BaaeN1nzoPbqVc 4P2/8Jz7adLZ/H3KgqVTYkPObZD2iQGbNmNtg2/S/8Q2wkgkCeRcJbvrMJhXPsSU0Fr6iD vgx3GfDEBo/KWraOdhRrbQX2gIJWxoEEp3Wor12KBLOZ1mjW9W9ElNm4pWHH9RQGKK9L/z C2bpAHhkD2Zf91fWA9PFD0dXZuyrddrg8VQjSa3zCC9x6ueiz9+2MYw34YPG+XDu29TRW1 OpogLnzj10BbvoMxASB4JJMHPNAmSzo2+M6DEEN3ly0QuStjATOnQoTqcpxDxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764691111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RBv/LU0FYocX8eXm07AZIxrwwQ4iQAht/lWH1JPgnzk=; b=TWTBIzNJ7VisS9aK3Qqu1Wdc4f8K02OlDfecDLCEGZ0X1wX+PUNYB5j42sZyotA4qef1EL MVMyMZ704o+MJKkRAPHr6SqV2ONNrsW0d99T7ikOUC2W3DRGK28AkA6jMFd+k4UAF0E5sC BHmRUSM1yZVIWOXzpZGIlzD4//SXyCPJDFUXUcVAcJMpS33d42TYFSd7FkvuZxggX5AUWH YA7ZB8J/Bw8lIGdkorVxocVwnYbQ7DEvarZsi6hIdc66vJhANK5E4On80JGwmoEjNPMreS eQClYmZ0gn5mISm//alwSx0uF55kxICTIZYKb++iqAhHAlRXGkHhEgsWoU4lqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764691111; a=rsa-sha256; cv=none; b=F4plu526iVEfOvvFBodPXuuYrIGx6fycAATMqgZJhk07GLV/GCyM+ePZwl9nT2zvl5Fbwz aglLbqflG1/5XepX7AcDE69whhu4eCSguECO8jvPRppgAE/LX4UBIZxnz2ysv6rYaNFsHD vWaMwDmyScDWwAFQRqaKHSdBG+yKfisJ+FyE40AgqPaGKH+iByPENDr6rtrtWHxg8KCE6I avthZ7P/ubbJytZi9uxqizwk9/GEkWyqOG5dG/cv7l9Wx/1P1vKLA985bpAcqgo0/lhBPl XUv7OHAMGRT69fhCFhIYCAazYSFZneY4zZ4+Dh/ouyCAmRX9ERx6htSsk6NXMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dLQRW5X9cz1CT7 for ; Tue, 02 Dec 2025 15:58:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 36b11 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 02 Dec 2025 15:58:31 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: ef55f6b86626 - stable/14 - sqlite3: Update to 3.50.4 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ef55f6b8662640ef611e78e09dbda56ec5a1532f Auto-Submitted: auto-generated Date: Tue, 02 Dec 2025 15:58:31 +0000 Message-Id: <692f0ca7.36b11.7aa216ad@gitrepo.freebsd.org> The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=ef55f6b8662640ef611e78e09dbda56ec5a1532f commit ef55f6b8662640ef611e78e09dbda56ec5a1532f Author: Cy Schubert AuthorDate: 2025-12-02 15:22:26 +0000 Commit: Cy Schubert CommitDate: 2025-12-02 15:29:40 +0000 sqlite3: Update to 3.50.4 Release notes at https://www.sqlite.org/releaselog/3_50_4.html. Obtained from: https://www.sqlite.org/2025/sqlite-autoconf-3500400.tar.gz Merge commit 'e7e917ee3cf2b3010b1c511c6ebaf8b65b983ad7' (cherry picked from commit 07d5a9b1b2dd95d95137c6c2afcb84ad40c05b75) --- contrib/sqlite3/VERSION | 2 +- contrib/sqlite3/sqlite3.c | 203 +++++++++++++++++++++++++----------------- contrib/sqlite3/sqlite3.h | 90 +++++++++---------- contrib/sqlite3/sqlite3.pc.in | 2 +- contrib/sqlite3/sqlite3rc.h | 2 +- 5 files changed, 170 insertions(+), 129 deletions(-) diff --git a/contrib/sqlite3/VERSION b/contrib/sqlite3/VERSION index 18d0478a0414..acecb4fcb7aa 100644 --- a/contrib/sqlite3/VERSION +++ b/contrib/sqlite3/VERSION @@ -1 +1 @@ -3.50.2 +3.50.4 diff --git a/contrib/sqlite3/sqlite3.c b/contrib/sqlite3/sqlite3.c index 0b071b2b6cc2..26a7a43d8658 100644 --- a/contrib/sqlite3/sqlite3.c +++ b/contrib/sqlite3/sqlite3.c @@ -1,6 +1,6 @@ /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.50.2. By combining all the individual C code files into this +** version 3.50.4. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -18,7 +18,7 @@ ** separate file. This file contains only code for the core SQLite library. ** ** The content in this amalgamation comes from Fossil check-in -** 2af157d77fb1304a74176eaee7fbc7c7e932 with changes in files: +** 4d8adfb30e03f9cf27f800a2c1ba3c48fb4c with changes in files: ** ** */ @@ -465,9 +465,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.50.2" -#define SQLITE_VERSION_NUMBER 3050002 -#define SQLITE_SOURCE_ID "2025-06-28 14:00:48 2af157d77fb1304a74176eaee7fbc7c7e932d946bf25325e9c26c91db19e3079" +#define SQLITE_VERSION "3.50.4" +#define SQLITE_VERSION_NUMBER 3050004 +#define SQLITE_SOURCE_ID "2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -9377,13 +9377,13 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** [[SQLITE_STMTSTATUS_SORT]]
SQLITE_STMTSTATUS_SORT
**
^This is the number of sort operations that have occurred. ** A non-zero value in this counter may indicate an opportunity to -** improvement performance through careful use of indices.
+** improve performance through careful use of indices. ** ** [[SQLITE_STMTSTATUS_AUTOINDEX]]
SQLITE_STMTSTATUS_AUTOINDEX
**
^This is the number of rows inserted into transient indices that ** were created automatically in order to help joins run faster. ** A non-zero value in this counter may indicate an opportunity to -** improvement performance by adding permanent indices that do not +** improve performance by adding permanent indices that do not ** need to be reinitialized each time the statement is run.
** ** [[SQLITE_STMTSTATUS_VM_STEP]]
SQLITE_STMTSTATUS_VM_STEP
@@ -9392,19 +9392,19 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** to 2147483647. The number of virtual machine operations can be ** used as a proxy for the total work done by the prepared statement. ** If the number of virtual machine operations exceeds 2147483647 -** then the value returned by this statement status code is undefined. +** then the value returned by this statement status code is undefined. ** ** [[SQLITE_STMTSTATUS_REPREPARE]]
SQLITE_STMTSTATUS_REPREPARE
**
^This is the number of times that the prepare statement has been ** automatically regenerated due to schema changes or changes to -** [bound parameters] that might affect the query plan. +** [bound parameters] that might affect the query plan.
** ** [[SQLITE_STMTSTATUS_RUN]]
SQLITE_STMTSTATUS_RUN
**
^This is the number of times that the prepared statement has ** been run. A single "run" for the purposes of this counter is one ** or more calls to [sqlite3_step()] followed by a call to [sqlite3_reset()]. ** The counter is incremented on the first [sqlite3_step()] call of each -** cycle. +** cycle.
** ** [[SQLITE_STMTSTATUS_FILTER_MISS]] ** [[SQLITE_STMTSTATUS_FILTER HIT]] @@ -9414,7 +9414,7 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** step was bypassed because a Bloom filter returned not-found. The ** corresponding SQLITE_STMTSTATUS_FILTER_MISS value is the number of ** times that the Bloom filter returned a find, and thus the join step -** had to be processed as normal. +** had to be processed as normal. ** ** [[SQLITE_STMTSTATUS_MEMUSED]]
SQLITE_STMTSTATUS_MEMUSED
**
^This is the approximate number of bytes of heap memory @@ -9519,9 +9519,9 @@ struct sqlite3_pcache_page { ** SQLite will typically create one cache instance for each open database file, ** though this is not guaranteed. ^The ** first parameter, szPage, is the size in bytes of the pages that must -** be allocated by the cache. ^szPage will always a power of two. ^The +** be allocated by the cache. ^szPage will always be a power of two. ^The ** second parameter szExtra is a number of bytes of extra storage -** associated with each page cache entry. ^The szExtra parameter will +** associated with each page cache entry. ^The szExtra parameter will be ** a number less than 250. SQLite will use the ** extra szExtra bytes on each page to store metadata about the underlying ** database page on disk. The value passed into szExtra depends @@ -9529,17 +9529,17 @@ struct sqlite3_pcache_page { ** ^The third argument to xCreate(), bPurgeable, is true if the cache being ** created will be used to cache database pages of a file stored on disk, or ** false if it is used for an in-memory database. The cache implementation -** does not have to do anything special based with the value of bPurgeable; +** does not have to do anything special based upon the value of bPurgeable; ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will ** never invoke xUnpin() except to deliberately delete a page. ** ^In other words, calls to xUnpin() on a cache with bPurgeable set to ** false will always have the "discard" flag set to true. -** ^Hence, a cache created with bPurgeable false will +** ^Hence, a cache created with bPurgeable set to false will ** never contain any unpinned pages. ** ** [[the xCachesize() page cache method]] ** ^(The xCachesize() method may be called at any time by SQLite to set the -** suggested maximum cache-size (number of pages stored by) the cache +** suggested maximum cache-size (number of pages stored) for the cache ** instance passed as the first argument. This is the value configured using ** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable ** parameter, the implementation is not required to do anything with this @@ -9566,12 +9566,12 @@ struct sqlite3_pcache_page { ** implementation must return a pointer to the page buffer with its content ** intact. If the requested page is not already in the cache, then the ** cache implementation should use the value of the createFlag -** parameter to help it determined what action to take: +** parameter to help it determine what action to take: ** ** **
createFlag Behavior when page is not already in cache **
0 Do not allocate a new page. Return NULL. -**
1 Allocate a new page if it easy and convenient to do so. +**
1 Allocate a new page if it is easy and convenient to do so. ** Otherwise return NULL. **
2 Make every effort to allocate a new page. Only return ** NULL if allocating a new page is effectively impossible. @@ -9588,7 +9588,7 @@ struct sqlite3_pcache_page { ** as its second argument. If the third parameter, discard, is non-zero, ** then the page must be evicted from the cache. ** ^If the discard parameter is -** zero, then the page may be discarded or retained at the discretion of +** zero, then the page may be discarded or retained at the discretion of the ** page cache implementation. ^The page cache implementation ** may choose to evict unpinned pages at any time. ** @@ -9606,7 +9606,7 @@ struct sqlite3_pcache_page { ** When SQLite calls the xTruncate() method, the cache must discard all ** existing cache entries with page numbers (keys) greater than or equal ** to the value of the iLimit parameter passed to xTruncate(). If any -** of these pages are pinned, they are implicitly unpinned, meaning that +** of these pages are pinned, they become implicitly unpinned, meaning that ** they can be safely discarded. ** ** [[the xDestroy() page cache method]] @@ -9905,7 +9905,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** application receives an SQLITE_LOCKED error, it may call the ** sqlite3_unlock_notify() method with the blocked connection handle as ** the first argument to register for a callback that will be invoked -** when the blocking connections current transaction is concluded. ^The +** when the blocking connection's current transaction is concluded. ^The ** callback is invoked from within the [sqlite3_step] or [sqlite3_close] ** call that concludes the blocking connection's transaction. ** @@ -9925,7 +9925,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** blocked connection already has a registered unlock-notify callback, ** then the new callback replaces the old.)^ ^If sqlite3_unlock_notify() is ** called with a NULL pointer as its second argument, then any existing -** unlock-notify callback is canceled. ^The blocked connections +** unlock-notify callback is canceled. ^The blocked connection's ** unlock-notify callback may also be canceled by closing the blocked ** connection using [sqlite3_close()]. ** @@ -10323,7 +10323,7 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...); ** support constraints. In this configuration (which is the default) if ** a call to the [xUpdate] method returns [SQLITE_CONSTRAINT], then the entire ** statement is rolled back as if [ON CONFLICT | OR ABORT] had been -** specified as part of the users SQL statement, regardless of the actual +** specified as part of the user's SQL statement, regardless of the actual ** ON CONFLICT mode specified. ** ** If X is non-zero, then the virtual table implementation guarantees @@ -10357,7 +10357,7 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...); ** [[SQLITE_VTAB_INNOCUOUS]]
SQLITE_VTAB_INNOCUOUS
**
Calls of the form ** [sqlite3_vtab_config](db,SQLITE_VTAB_INNOCUOUS) from within the -** the [xConnect] or [xCreate] methods of a [virtual table] implementation +** [xConnect] or [xCreate] methods of a [virtual table] implementation ** identify that virtual table as being safe to use from within triggers ** and views. Conceptually, the SQLITE_VTAB_INNOCUOUS tag means that the ** virtual table can do no serious harm even if it is controlled by a @@ -10525,7 +10525,7 @@ SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info*,int); **
** ** ^For the purposes of comparing virtual table output values to see if the -** values are same value for sorting purposes, two NULL values are considered +** values are the same value for sorting purposes, two NULL values are considered ** to be the same. In other words, the comparison operator is "IS" ** (or "IS NOT DISTINCT FROM") and not "==". ** @@ -10535,7 +10535,7 @@ SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info*,int); ** ** ^A virtual table implementation is always free to return rows in any order ** it wants, as long as the "orderByConsumed" flag is not set. ^When the -** the "orderByConsumed" flag is unset, the query planner will add extra +** "orderByConsumed" flag is unset, the query planner will add extra ** [bytecode] to ensure that the final results returned by the SQL query are ** ordered correctly. The use of the "orderByConsumed" flag and the ** sqlite3_vtab_distinct() interface is merely an optimization. ^Careful @@ -10632,7 +10632,7 @@ SQLITE_API int sqlite3_vtab_in(sqlite3_index_info*, int iCons, int bHandle); ** sqlite3_vtab_in_next(X,P) should be one of the parameters to the ** xFilter method which invokes these routines, and specifically ** a parameter that was previously selected for all-at-once IN constraint -** processing use the [sqlite3_vtab_in()] interface in the +** processing using the [sqlite3_vtab_in()] interface in the ** [xBestIndex|xBestIndex method]. ^(If the X parameter is not ** an xFilter argument that was selected for all-at-once IN constraint ** processing, then these routines return [SQLITE_ERROR].)^ @@ -10687,7 +10687,7 @@ SQLITE_API int sqlite3_vtab_in_next(sqlite3_value *pVal, sqlite3_value **ppOut); ** and only if *V is set to a value. ^The sqlite3_vtab_rhs_value(P,J,V) ** inteface returns SQLITE_NOTFOUND if the right-hand side of the J-th ** constraint is not available. ^The sqlite3_vtab_rhs_value() interface -** can return an result code other than SQLITE_OK or SQLITE_NOTFOUND if +** can return a result code other than SQLITE_OK or SQLITE_NOTFOUND if ** something goes wrong. ** ** The sqlite3_vtab_rhs_value() interface is usually only successful if @@ -10715,8 +10715,8 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** ** KEYWORDS: {conflict resolution mode} ** ** These constants are returned by [sqlite3_vtab_on_conflict()] to -** inform a [virtual table] implementation what the [ON CONFLICT] mode -** is for the SQL statement being evaluated. +** inform a [virtual table] implementation of the [ON CONFLICT] mode +** for the SQL statement being evaluated. ** ** Note that the [SQLITE_IGNORE] constant is also used as a potential ** return value from the [sqlite3_set_authorizer()] callback and that @@ -10756,39 +10756,39 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** ** [[SQLITE_SCANSTAT_EST]]
SQLITE_SCANSTAT_EST
**
^The "double" variable pointed to by the V parameter will be set to the ** query planner's estimate for the average number of rows output from each -** iteration of the X-th loop. If the query planner's estimates was accurate, +** iteration of the X-th loop. If the query planner's estimate was accurate, ** then this value will approximate the quotient NVISIT/NLOOP and the ** product of this value for all prior loops with the same SELECTID will -** be the NLOOP value for the current loop. +** be the NLOOP value for the current loop.
** ** [[SQLITE_SCANSTAT_NAME]]
SQLITE_SCANSTAT_NAME
**
^The "const char *" variable pointed to by the V parameter will be set ** to a zero-terminated UTF-8 string containing the name of the index or table -** used for the X-th loop. +** used for the X-th loop.
** ** [[SQLITE_SCANSTAT_EXPLAIN]]
SQLITE_SCANSTAT_EXPLAIN
**
^The "const char *" variable pointed to by the V parameter will be set ** to a zero-terminated UTF-8 string containing the [EXPLAIN QUERY PLAN] -** description for the X-th loop. +** description for the X-th loop.
** ** [[SQLITE_SCANSTAT_SELECTID]]
SQLITE_SCANSTAT_SELECTID
**
^The "int" variable pointed to by the V parameter will be set to the ** id for the X-th query plan element. The id value is unique within the ** statement. The select-id is the same value as is output in the first -** column of an [EXPLAIN QUERY PLAN] query. +** column of an [EXPLAIN QUERY PLAN] query.
** ** [[SQLITE_SCANSTAT_PARENTID]]
SQLITE_SCANSTAT_PARENTID
**
The "int" variable pointed to by the V parameter will be set to the -** the id of the parent of the current query element, if applicable, or +** id of the parent of the current query element, if applicable, or ** to zero if the query element has no parent. This is the same value as -** returned in the second column of an [EXPLAIN QUERY PLAN] query. +** returned in the second column of an [EXPLAIN QUERY PLAN] query.
** ** [[SQLITE_SCANSTAT_NCYCLE]]
SQLITE_SCANSTAT_NCYCLE
**
The sqlite3_int64 output value is set to the number of cycles, ** according to the processor time-stamp counter, that elapsed while the ** query element was being processed. This value is not available for ** all query elements - if it is unavailable the output variable is -** set to -1. +** set to -1.
** */ #define SQLITE_SCANSTAT_NLOOP 0 @@ -10829,8 +10829,8 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** ** sqlite3_stmt_scanstatus_v2() with a zeroed flags parameter. ** ** Parameter "idx" identifies the specific query element to retrieve statistics -** for. Query elements are numbered starting from zero. A value of -1 may be -** to query for statistics regarding the entire query. ^If idx is out of range +** for. Query elements are numbered starting from zero. A value of -1 may +** retrieve statistics for the entire query. ^If idx is out of range ** - less than -1 or greater than or equal to the total number of query ** elements used to implement the statement - a non-zero value is returned and ** the variable that pOut points to is unchanged. @@ -10987,8 +10987,8 @@ SQLITE_API int sqlite3_db_cacheflush(sqlite3*); ** triggers; and so forth. ** ** When the [sqlite3_blob_write()] API is used to update a blob column, -** the pre-update hook is invoked with SQLITE_DELETE. This is because the -** in this case the new values are not available. In this case, when a +** the pre-update hook is invoked with SQLITE_DELETE, because +** the new values are not yet available. In this case, when a ** callback made with op==SQLITE_DELETE is actually a write using the ** sqlite3_blob_write() API, the [sqlite3_preupdate_blobwrite()] returns ** the index of the column being written. In other cases, where the @@ -11241,7 +11241,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const c ** For an ordinary on-disk database file, the serialization is just a ** copy of the disk file. For an in-memory database or a "TEMP" database, ** the serialization is the same sequence of bytes which would be written -** to disk if that database where backed up to disk. +** to disk if that database were backed up to disk. ** ** The usual case is that sqlite3_serialize() copies the serialization of ** the database into memory obtained from [sqlite3_malloc64()] and returns @@ -11250,7 +11250,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const c ** contains the SQLITE_SERIALIZE_NOCOPY bit, then no memory allocations ** are made, and the sqlite3_serialize() function will return a pointer ** to the contiguous memory representation of the database that SQLite -** is currently using for that database, or NULL if the no such contiguous +** is currently using for that database, or NULL if no such contiguous ** memory representation of the database exists. A contiguous memory ** representation of the database will usually only exist if there has ** been a prior call to [sqlite3_deserialize(D,S,...)] with the same @@ -11321,7 +11321,7 @@ SQLITE_API unsigned char *sqlite3_serialize( ** database is currently in a read transaction or is involved in a backup ** operation. ** -** It is not possible to deserialized into the TEMP database. If the +** It is not possible to deserialize into the TEMP database. If the ** S argument to sqlite3_deserialize(D,S,P,N,M,F) is "temp" then the ** function returns SQLITE_ERROR. ** @@ -11343,7 +11343,7 @@ SQLITE_API int sqlite3_deserialize( sqlite3 *db, /* The database connection */ const char *zSchema, /* Which DB to reopen with the deserialization */ unsigned char *pData, /* The serialized database content */ - sqlite3_int64 szDb, /* Number bytes in the deserialization */ + sqlite3_int64 szDb, /* Number of bytes in the deserialization */ sqlite3_int64 szBuf, /* Total size of buffer pData[] */ unsigned mFlags /* Zero or more SQLITE_DESERIALIZE_* flags */ ); @@ -11351,7 +11351,7 @@ SQLITE_API int sqlite3_deserialize( /* ** CAPI3REF: Flags for sqlite3_deserialize() ** -** The following are allowed values for 6th argument (the F argument) to +** The following are allowed values for the 6th argument (the F argument) to ** the [sqlite3_deserialize(D,S,P,N,M,F)] interface. ** ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization @@ -19168,7 +19168,6 @@ struct Index { unsigned hasStat1:1; /* aiRowLogEst values come from sqlite_stat1 */ unsigned bNoQuery:1; /* Do not use this index to optimize queries */ unsigned bAscKeyBug:1; /* True if the bba7b69f9849b5bf bug applies */ - unsigned bIdxRowid:1; /* One or more of the index keys is the ROWID */ unsigned bHasVCol:1; /* Index references one or more VIRTUAL columns */ unsigned bHasExpr:1; /* Index contains an expression, either a literal ** expression, or a reference to a VIRTUAL column */ @@ -19441,6 +19440,7 @@ struct Expr { Table *pTab; /* TK_COLUMN: Table containing column. Can be NULL ** for a column of an index on an expression */ Window *pWin; /* EP_WinFunc: Window/Filter defn for a function */ + int nReg; /* TK_NULLS: Number of registers to NULL out */ struct { /* TK_IN, TK_SELECT, and TK_EXISTS */ int iAddr; /* Subroutine entry address */ int regReturn; /* Register used to hold return address */ @@ -21475,6 +21475,7 @@ SQLITE_PRIVATE void sqlite3ExprCodeGeneratedColumn(Parse*, Table*, Column*, int) SQLITE_PRIVATE void sqlite3ExprCodeCopy(Parse*, Expr*, int); SQLITE_PRIVATE void sqlite3ExprCodeFactorable(Parse*, Expr*, int); SQLITE_PRIVATE int sqlite3ExprCodeRunJustOnce(Parse*, Expr*, int); +SQLITE_PRIVATE void sqlite3ExprNullRegisterRange(Parse*, int, int); SQLITE_PRIVATE int sqlite3ExprCodeTemp(Parse*, Expr*, int*); SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse*, Expr*, int); SQLITE_PRIVATE int sqlite3ExprCodeExprList(Parse*, ExprList*, int, int, u8); @@ -111488,7 +111489,7 @@ SQLITE_PRIVATE Expr *sqlite3ExprAnd(Parse *pParse, Expr *pLeft, Expr *pRight){ return pLeft; }else{ u32 f = pLeft->flags | pRight->flags; - if( (f&(EP_OuterON|EP_InnerON|EP_IsFalse))==EP_IsFalse + if( (f&(EP_OuterON|EP_InnerON|EP_IsFalse|EP_HasFunc))==EP_IsFalse && !IN_RENAME_OBJECT ){ sqlite3ExprDeferredDelete(pParse, pLeft); @@ -115242,6 +115243,12 @@ expr_code_doover: sqlite3VdbeLoadString(v, target, pExpr->u.zToken); return target; } + case TK_NULLS: { + /* Set a range of registers to NULL. pExpr->y.nReg registers starting + ** with target */ + sqlite3VdbeAddOp3(v, OP_Null, 0, target, target + pExpr->y.nReg - 1); + return target; + } default: { /* Make NULL the default case so that if a bug causes an illegal ** Expr node to be passed into this function, it will be handled @@ -115926,6 +115933,25 @@ SQLITE_PRIVATE int sqlite3ExprCodeRunJustOnce( return regDest; } +/* +** Make arrangements to invoke OP_Null on a range of registers +** during initialization. +*/ +SQLITE_PRIVATE SQLITE_NOINLINE void sqlite3ExprNullRegisterRange( + Parse *pParse, /* Parsing context */ + int iReg, /* First register to set to NULL */ + int nReg /* Number of sequential registers to NULL out */ +){ + u8 okConstFactor = pParse->okConstFactor; + Expr t; + memset(&t, 0, sizeof(t)); + t.op = TK_NULLS; + t.y.nReg = nReg; + pParse->okConstFactor = 1; + sqlite3ExprCodeRunJustOnce(pParse, &t, iReg); + pParse->okConstFactor = okConstFactor; +} + /* ** Generate code to evaluate an expression and store the results ** into a register. Return the register number where the results @@ -127196,7 +127222,6 @@ SQLITE_PRIVATE void sqlite3CreateIndex( assert( j<=0x7fff ); if( j<0 ){ j = pTab->iPKey; - pIndex->bIdxRowid = 1; }else{ if( pTab->aCol[j].notNull==0 ){ pIndex->uniqNotNull = 0; @@ -153177,6 +153202,7 @@ SQLITE_PRIVATE int sqlite3Select( sqlite3VdbeAddOp2(v, OP_Integer, 0, iAbortFlag); VdbeComment((v, "clear abort flag")); sqlite3VdbeAddOp3(v, OP_Null, 0, iAMem, iAMem+pGroupBy->nExpr-1); + sqlite3ExprNullRegisterRange(pParse, iAMem, pGroupBy->nExpr); /* Begin a loop that will extract all source rows in GROUP BY order. ** This might involve two separate loops with an OP_Sort in between, or @@ -160173,7 +160199,9 @@ static Expr *removeUnindexableInClauseTerms( int iField; assert( (pLoop->aLTerm[i]->eOperator & (WO_OR|WO_AND))==0 ); iField = pLoop->aLTerm[i]->u.x.iField - 1; - if( pOrigRhs->a[iField].pExpr==0 ) continue; /* Duplicate PK column */ + if( NEVER(pOrigRhs->a[iField].pExpr==0) ){ + continue; /* Duplicate PK column */ + } pRhs = sqlite3ExprListAppend(pParse, pRhs, pOrigRhs->a[iField].pExpr); pOrigRhs->a[iField].pExpr = 0; if( pRhs ) pRhs->a[pRhs->nExpr-1].u.x.iOrderByCol = iField+1; @@ -160270,7 +160298,7 @@ static SQLITE_NOINLINE void codeINTerm( return; } } - for(i=iEq;inLTerm; i++){ + for(i=iEq; inLTerm; i++){ assert( pLoop->aLTerm[i]!=0 ); if( pLoop->aLTerm[i]->pExpr==pX ) nEq++; } @@ -160279,22 +160307,13 @@ static SQLITE_NOINLINE void codeINTerm( if( !ExprUseXSelect(pX) || pX->x.pSelect->pEList->nExpr==1 ){ eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, 0, &iTab); }else{ - Expr *pExpr = pTerm->pExpr; - if( pExpr->iTable==0 || !ExprHasProperty(pExpr, EP_Subrtn) ){ - sqlite3 *db = pParse->db; - pX = removeUnindexableInClauseTerms(pParse, iEq, pLoop, pX); - if( !db->mallocFailed ){ - aiMap = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int)*nEq); - eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, aiMap,&iTab); - pExpr->iTable = iTab; - } - sqlite3ExprDelete(db, pX); - }else{ - int n = sqlite3ExprVectorSize(pX->pLeft); - aiMap = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int)*MAX(nEq,n)); - eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, aiMap, &iTab); + sqlite3 *db = pParse->db; + Expr *pXMod = removeUnindexableInClauseTerms(pParse, iEq, pLoop, pX); + if( !db->mallocFailed ){ + aiMap = (int*)sqlite3DbMallocZero(db, sizeof(int)*nEq); + eType = sqlite3FindInIndex(pParse, pXMod, IN_INDEX_LOOP, 0, aiMap, &iTab); } - pX = pExpr; + sqlite3ExprDelete(db, pXMod); } if( eType==IN_INDEX_INDEX_DESC ){ @@ -160324,7 +160343,7 @@ static SQLITE_NOINLINE void codeINTerm( if( pIn ){ int iMap = 0; /* Index in aiMap[] */ pIn += i; - for(i=iEq;inLTerm; i++){ + for(i=iEq; inLTerm; i++){ if( pLoop->aLTerm[i]->pExpr==pX ){ int iOut = iTarget + i - iEq; if( eType==IN_INDEX_ROWID ){ @@ -167682,6 +167701,7 @@ static int whereLoopAddBtreeIndex( if( ExprUseXSelect(pExpr) ){ /* "x IN (SELECT ...)": TUNING: the SELECT returns 25 rows */ int i; + int bRedundant = 0; nIn = 46; assert( 46==sqlite3LogEst(25) ); /* The expression may actually be of the form (x, y) IN (SELECT...). @@ -167690,7 +167710,20 @@ static int whereLoopAddBtreeIndex( ** for each such term. The following loop checks that pTerm is the ** first such term in use, and sets nIn back to 0 if it is not. */ for(i=0; inLTerm-1; i++){ - if( pNew->aLTerm[i] && pNew->aLTerm[i]->pExpr==pExpr ) nIn = 0; + if( pNew->aLTerm[i] && pNew->aLTerm[i]->pExpr==pExpr ){ + nIn = 0; + if( pNew->aLTerm[i]->u.x.iField == pTerm->u.x.iField ){ + /* Detect when two or more columns of an index match the same + ** column of a vector IN operater, and avoid adding the column + ** to the WhereLoop more than once. See tag-20250707-01 + ** in test/rowvalue.test */ + bRedundant = 1; + } + } + } + if( bRedundant ){ + pNew->nLTerm--; + continue; } }else if( ALWAYS(pExpr->x.pList && pExpr->x.pList->nExpr) ){ /* "x IN (value, value, ...)" */ @@ -167922,7 +167955,7 @@ static int whereLoopAddBtreeIndex( if( (pNew->wsFlags & WHERE_TOP_LIMIT)==0 && pNew->u.btree.nEqnColumn && (pNew->u.btree.nEqnKeyCol || - (pProbe->idxType!=SQLITE_IDXTYPE_PRIMARYKEY && !pProbe->bIdxRowid)) + pProbe->idxType!=SQLITE_IDXTYPE_PRIMARYKEY) ){ if( pNew->u.btree.nEq>3 ){ sqlite3ProgressCheck(pParse); @@ -168465,6 +168498,7 @@ static int whereLoopAddBtree( pNew->u.btree.nEq = 0; pNew->u.btree.nBtm = 0; pNew->u.btree.nTop = 0; + pNew->u.btree.nDistinctCol = 0; pNew->nSkip = 0; pNew->nLTerm = 0; pNew->iSortIdx = 0; @@ -169533,8 +169567,6 @@ static i8 wherePathSatisfiesOrderBy( obSat = obDone; } break; - }else if( wctrlFlags & WHERE_DISTINCTBY ){ - pLoop->u.btree.nDistinctCol = 0; } iCur = pWInfo->pTabList->a[pLoop->iTab].iCursor; @@ -179897,12 +179929,21 @@ static YYACTIONTYPE yy_reduce( ** expr1 IN () ** expr1 NOT IN () ** - ** simplify to constants 0 (false) and 1 (true), respectively, - ** regardless of the value of expr1. + ** simplify to constants 0 (false) and 1 (true), respectively. + ** + ** Except, do not apply this optimization if expr1 contains a function + ** because that function might be an aggregate (we don't know yet whether + ** it is or not) and if it is an aggregate, that could change the meaning + ** of the whole query. */ - sqlite3ExprUnmapAndDelete(pParse, yymsp[-4].minor.yy590); - yymsp[-4].minor.yy590 = sqlite3Expr(pParse->db, TK_STRING, yymsp[-3].minor.yy502 ? "true" : "false"); - if( yymsp[-4].minor.yy590 ) sqlite3ExprIdToTrueFalse(yymsp[-4].minor.yy590); + Expr *pB = sqlite3Expr(pParse->db, TK_STRING, yymsp[-3].minor.yy502 ? "true" : "false"); + if( pB ) sqlite3ExprIdToTrueFalse(pB); + if( !ExprHasProperty(yymsp[-4].minor.yy590, EP_HasFunc) ){ + sqlite3ExprUnmapAndDelete(pParse, yymsp[-4].minor.yy590); + yymsp[-4].minor.yy590 = pB; + }else{ + yymsp[-4].minor.yy590 = sqlite3PExpr(pParse, yymsp[-3].minor.yy502 ? TK_OR : TK_AND, pB, yymsp[-4].minor.yy590); + } }else{ Expr *pRHS = yymsp[-1].minor.yy402->a[0].pExpr; if( yymsp[-1].minor.yy402->nExpr==1 && sqlite3ExprIsConstant(pParse,pRHS) && yymsp[-4].minor.yy590->op!=TK_VECTOR ){ @@ -181508,7 +181549,7 @@ static int getToken(const unsigned char **pz){ int t; /* Token type to return */ do { z += sqlite3GetToken(z, &t); - }while( t==TK_SPACE ); + }while( t==TK_SPACE || t==TK_COMMENT ); if( t==TK_ID || t==TK_STRING || t==TK_JOIN_KW @@ -246163,9 +246204,9 @@ static void fts5SegIterSetNext(Fts5Index *p, Fts5SegIter *pIter){ ** leave an error in the Fts5Index object. */ static void fts5SegIterAllocTombstone(Fts5Index *p, Fts5SegIter *pIter){ - const int nTomb = pIter->pSeg->nPgTombstone; + const i64 nTomb = (i64)pIter->pSeg->nPgTombstone; if( nTomb>0 ){ - int nByte = SZ_FTS5TOMBSTONEARRAY(nTomb+1); + i64 nByte = SZ_FTS5TOMBSTONEARRAY(nTomb+1); Fts5TombstoneArray *pNew; pNew = (Fts5TombstoneArray*)sqlite3Fts5MallocZero(&p->rc, nByte); if( pNew ){ @@ -257266,7 +257307,7 @@ static void fts5SourceIdFunc( ){ assert( nArg==0 ); UNUSED_PARAM2(nArg, apUnused); - sqlite3_result_text(pCtx, "fts5: 2025-06-28 14:00:48 2af157d77fb1304a74176eaee7fbc7c7e932d946bf25325e9c26c91db19e3079", -1, SQLITE_TRANSIENT); + sqlite3_result_text(pCtx, "fts5: 2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3", -1, SQLITE_TRANSIENT); } /* diff --git a/contrib/sqlite3/sqlite3.h b/contrib/sqlite3/sqlite3.h index f56dd8d86a2d..c2ed750305b2 100644 --- a/contrib/sqlite3/sqlite3.h +++ b/contrib/sqlite3/sqlite3.h @@ -146,9 +146,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.50.2" -#define SQLITE_VERSION_NUMBER 3050002 -#define SQLITE_SOURCE_ID "2025-06-28 14:00:48 2af157d77fb1304a74176eaee7fbc7c7e932d946bf25325e9c26c91db19e3079" +#define SQLITE_VERSION "3.50.4" +#define SQLITE_VERSION_NUMBER 3050004 +#define SQLITE_SOURCE_ID "2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -9058,13 +9058,13 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** [[SQLITE_STMTSTATUS_SORT]]
SQLITE_STMTSTATUS_SORT
**
^This is the number of sort operations that have occurred. ** A non-zero value in this counter may indicate an opportunity to -** improvement performance through careful use of indices.
+** improve performance through careful use of indices. ** ** [[SQLITE_STMTSTATUS_AUTOINDEX]]
SQLITE_STMTSTATUS_AUTOINDEX
**
^This is the number of rows inserted into transient indices that ** were created automatically in order to help joins run faster. ** A non-zero value in this counter may indicate an opportunity to -** improvement performance by adding permanent indices that do not +** improve performance by adding permanent indices that do not ** need to be reinitialized each time the statement is run.
** ** [[SQLITE_STMTSTATUS_VM_STEP]]
SQLITE_STMTSTATUS_VM_STEP
@@ -9073,19 +9073,19 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** to 2147483647. The number of virtual machine operations can be ** used as a proxy for the total work done by the prepared statement. ** If the number of virtual machine operations exceeds 2147483647 -** then the value returned by this statement status code is undefined. +** then the value returned by this statement status code is undefined. ** ** [[SQLITE_STMTSTATUS_REPREPARE]]
SQLITE_STMTSTATUS_REPREPARE
**
^This is the number of times that the prepare statement has been ** automatically regenerated due to schema changes or changes to -** [bound parameters] that might affect the query plan. +** [bound parameters] that might affect the query plan.
** ** [[SQLITE_STMTSTATUS_RUN]]
SQLITE_STMTSTATUS_RUN
**
^This is the number of times that the prepared statement has ** been run. A single "run" for the purposes of this counter is one ** or more calls to [sqlite3_step()] followed by a call to [sqlite3_reset()]. ** The counter is incremented on the first [sqlite3_step()] call of each -** cycle. +** cycle.
** ** [[SQLITE_STMTSTATUS_FILTER_MISS]] ** [[SQLITE_STMTSTATUS_FILTER HIT]] @@ -9095,7 +9095,7 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** step was bypassed because a Bloom filter returned not-found. The ** corresponding SQLITE_STMTSTATUS_FILTER_MISS value is the number of ** times that the Bloom filter returned a find, and thus the join step -** had to be processed as normal. +** had to be processed as normal. ** ** [[SQLITE_STMTSTATUS_MEMUSED]]
SQLITE_STMTSTATUS_MEMUSED
**
^This is the approximate number of bytes of heap memory @@ -9200,9 +9200,9 @@ struct sqlite3_pcache_page { ** SQLite will typically create one cache instance for each open database file, ** though this is not guaranteed. ^The ** first parameter, szPage, is the size in bytes of the pages that must -** be allocated by the cache. ^szPage will always a power of two. ^The +** be allocated by the cache. ^szPage will always be a power of two. ^The ** second parameter szExtra is a number of bytes of extra storage -** associated with each page cache entry. ^The szExtra parameter will +** associated with each page cache entry. ^The szExtra parameter will be ** a number less than 250. SQLite will use the ** extra szExtra bytes on each page to store metadata about the underlying ** database page on disk. The value passed into szExtra depends @@ -9210,17 +9210,17 @@ struct sqlite3_pcache_page { ** ^The third argument to xCreate(), bPurgeable, is true if the cache being ** created will be used to cache database pages of a file stored on disk, or ** false if it is used for an in-memory database. The cache implementation -** does not have to do anything special based with the value of bPurgeable; +** does not have to do anything special based upon the value of bPurgeable; ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will ** never invoke xUnpin() except to deliberately delete a page. ** ^In other words, calls to xUnpin() on a cache with bPurgeable set to ** false will always have the "discard" flag set to true. -** ^Hence, a cache created with bPurgeable false will +** ^Hence, a cache created with bPurgeable set to false will ** never contain any unpinned pages. ** ** [[the xCachesize() page cache method]] ** ^(The xCachesize() method may be called at any time by SQLite to set the -** suggested maximum cache-size (number of pages stored by) the cache +** suggested maximum cache-size (number of pages stored) for the cache ** instance passed as the first argument. This is the value configured using ** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable ** parameter, the implementation is not required to do anything with this @@ -9247,12 +9247,12 @@ struct sqlite3_pcache_page { ** implementation must return a pointer to the page buffer with its content ** intact. If the requested page is not already in the cache, then the ** cache implementation should use the value of the createFlag -** parameter to help it determined what action to take: +** parameter to help it determine what action to take: ** ** **
createFlag Behavior when page is not already in cache **
0 Do not allocate a new page. Return NULL. -**
1 Allocate a new page if it easy and convenient to do so. +**
1 Allocate a new page if it is easy and convenient to do so. ** Otherwise return NULL. **
2 Make every effort to allocate a new page. Only return ** NULL if allocating a new page is effectively impossible. @@ -9269,7 +9269,7 @@ struct sqlite3_pcache_page { ** as its second argument. If the third parameter, discard, is non-zero, ** then the page must be evicted from the cache. ** ^If the discard parameter is -** zero, then the page may be discarded or retained at the discretion of +** zero, then the page may be discarded or retained at the discretion of the ** page cache implementation. ^The page cache implementation ** may choose to evict unpinned pages at any time. ** @@ -9287,7 +9287,7 @@ struct sqlite3_pcache_page { ** When SQLite calls the xTruncate() method, the cache must discard all ** existing cache entries with page numbers (keys) greater than or equal ** to the value of the iLimit parameter passed to xTruncate(). If any -** of these pages are pinned, they are implicitly unpinned, meaning that +** of these pages are pinned, they become implicitly unpinned, meaning that ** they can be safely discarded. ** ** [[the xDestroy() page cache method]] @@ -9586,7 +9586,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** application receives an SQLITE_LOCKED error, it may call the ** sqlite3_unlock_notify() method with the blocked connection handle as ** the first argument to register for a callback that will be invoked -** when the blocking connections current transaction is concluded. ^The +** when the blocking connection's current transaction is concluded. ^The ** callback is invoked from within the [sqlite3_step] or [sqlite3_close] ** call that concludes the blocking connection's transaction. ** @@ -9606,7 +9606,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** blocked connection already has a registered unlock-notify callback, ** then the new callback replaces the old.)^ ^If sqlite3_unlock_notify() is ** called with a NULL pointer as its second argument, then any existing -** unlock-notify callback is canceled. ^The blocked connections +** unlock-notify callback is canceled. ^The blocked connection's ** unlock-notify callback may also be canceled by closing the blocked ** connection using [sqlite3_close()]. ** @@ -10004,7 +10004,7 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...); ** support constraints. In this configuration (which is the default) if ** a call to the [xUpdate] method returns [SQLITE_CONSTRAINT], then the entire ** statement is rolled back as if [ON CONFLICT | OR ABORT] had been -** specified as part of the users SQL statement, regardless of the actual +** specified as part of the user's SQL statement, regardless of the actual ** ON CONFLICT mode specified. ** ** If X is non-zero, then the virtual table implementation guarantees @@ -10038,7 +10038,7 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...); ** [[SQLITE_VTAB_INNOCUOUS]]
SQLITE_VTAB_INNOCUOUS
**
Calls of the form ** [sqlite3_vtab_config](db,SQLITE_VTAB_INNOCUOUS) from within the -** the [xConnect] or [xCreate] methods of a [virtual table] implementation +** [xConnect] or [xCreate] methods of a [virtual table] implementation ** identify that virtual table as being safe to use from within triggers ** and views. Conceptually, the SQLITE_VTAB_INNOCUOUS tag means that the ** virtual table can do no serious harm even if it is controlled by a @@ -10206,7 +10206,7 @@ SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info*,int); **
** ** ^For the purposes of comparing virtual table output values to see if the -** values are same value for sorting purposes, two NULL values are considered +** values are the same value for sorting purposes, two NULL values are considered ** to be the same. In other words, the comparison operator is "IS" ** (or "IS NOT DISTINCT FROM") and not "==". ** @@ -10216,7 +10216,7 @@ SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info*,int); ** ** ^A virtual table implementation is always free to return rows in any order ** it wants, as long as the "orderByConsumed" flag is not set. ^When the -** the "orderByConsumed" flag is unset, the query planner will add extra +** "orderByConsumed" flag is unset, the query planner will add extra ** [bytecode] to ensure that the final results returned by the SQL query are ** ordered correctly. The use of the "orderByConsumed" flag and the ** sqlite3_vtab_distinct() interface is merely an optimization. ^Careful @@ -10313,7 +10313,7 @@ SQLITE_API int sqlite3_vtab_in(sqlite3_index_info*, int iCons, int bHandle); ** sqlite3_vtab_in_next(X,P) should be one of the parameters to the ** xFilter method which invokes these routines, and specifically ** a parameter that was previously selected for all-at-once IN constraint -** processing use the [sqlite3_vtab_in()] interface in the +** processing using the [sqlite3_vtab_in()] interface in the ** [xBestIndex|xBestIndex method]. ^(If the X parameter is not ** an xFilter argument that was selected for all-at-once IN constraint ** processing, then these routines return [SQLITE_ERROR].)^ @@ -10368,7 +10368,7 @@ SQLITE_API int sqlite3_vtab_in_next(sqlite3_value *pVal, sqlite3_value **ppOut); ** and only if *V is set to a value. ^The sqlite3_vtab_rhs_value(P,J,V) ** inteface returns SQLITE_NOTFOUND if the right-hand side of the J-th ** constraint is not available. ^The sqlite3_vtab_rhs_value() interface -** can return an result code other than SQLITE_OK or SQLITE_NOTFOUND if +** can return a result code other than SQLITE_OK or SQLITE_NOTFOUND if ** something goes wrong. ** ** The sqlite3_vtab_rhs_value() interface is usually only successful if @@ -10396,8 +10396,8 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** ** KEYWORDS: {conflict resolution mode} ** ** These constants are returned by [sqlite3_vtab_on_conflict()] to -** inform a [virtual table] implementation what the [ON CONFLICT] mode -** is for the SQL statement being evaluated. +** inform a [virtual table] implementation of the [ON CONFLICT] mode +** for the SQL statement being evaluated. ** ** Note that the [SQLITE_IGNORE] constant is also used as a potential ** return value from the [sqlite3_set_authorizer()] callback and that @@ -10437,39 +10437,39 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** ** [[SQLITE_SCANSTAT_EST]]
SQLITE_SCANSTAT_EST
**
^The "double" variable pointed to by the V parameter will be set to the ** query planner's estimate for the average number of rows output from each -** iteration of the X-th loop. If the query planner's estimates was accurate, +** iteration of the X-th loop. If the query planner's estimate was accurate, ** then this value will approximate the quotient NVISIT/NLOOP and the ** product of this value for all prior loops with the same SELECTID will -** be the NLOOP value for the current loop. +** be the NLOOP value for the current loop.
** ** [[SQLITE_SCANSTAT_NAME]]
SQLITE_SCANSTAT_NAME
**
^The "const char *" variable pointed to by the V parameter will be set ** to a zero-terminated UTF-8 string containing the name of the index or table -** used for the X-th loop. +** used for the X-th loop.
** ** [[SQLITE_SCANSTAT_EXPLAIN]]
SQLITE_SCANSTAT_EXPLAIN
**
^The "const char *" variable pointed to by the V parameter will be set ** to a zero-terminated UTF-8 string containing the [EXPLAIN QUERY PLAN] -** description for the X-th loop. +** description for the X-th loop.
** ** [[SQLITE_SCANSTAT_SELECTID]]
SQLITE_SCANSTAT_SELECTID
**
^The "int" variable pointed to by the V parameter will be set to the ** id for the X-th query plan element. The id value is unique within the ** statement. The select-id is the same value as is output in the first -** column of an [EXPLAIN QUERY PLAN] query. +** column of an [EXPLAIN QUERY PLAN] query.
** ** [[SQLITE_SCANSTAT_PARENTID]]
SQLITE_SCANSTAT_PARENTID
**
The "int" variable pointed to by the V parameter will be set to the -** the id of the parent of the current query element, if applicable, or +** id of the parent of the current query element, if applicable, or ** to zero if the query element has no parent. This is the same value as -** returned in the second column of an [EXPLAIN QUERY PLAN] query. +** returned in the second column of an [EXPLAIN QUERY PLAN] query.
** ** [[SQLITE_SCANSTAT_NCYCLE]]
SQLITE_SCANSTAT_NCYCLE
**
The sqlite3_int64 output value is set to the number of cycles, ** according to the processor time-stamp counter, that elapsed while the ** query element was being processed. This value is not available for ** all query elements - if it is unavailable the output variable is -** set to -1. +** set to -1.
** */ #define SQLITE_SCANSTAT_NLOOP 0 @@ -10510,8 +10510,8 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** ** sqlite3_stmt_scanstatus_v2() with a zeroed flags parameter. ** ** Parameter "idx" identifies the specific query element to retrieve statistics -** for. Query elements are numbered starting from zero. A value of -1 may be -** to query for statistics regarding the entire query. ^If idx is out of range +** for. Query elements are numbered starting from zero. A value of -1 may +** retrieve statistics for the entire query. ^If idx is out of range ** - less than -1 or greater than or equal to the total number of query ** elements used to implement the statement - a non-zero value is returned and ** the variable that pOut points to is unchanged. @@ -10668,8 +10668,8 @@ SQLITE_API int sqlite3_db_cacheflush(sqlite3*); ** triggers; and so forth. ** ** When the [sqlite3_blob_write()] API is used to update a blob column, -** the pre-update hook is invoked with SQLITE_DELETE. This is because the -** in this case the new values are not available. In this case, when a +** the pre-update hook is invoked with SQLITE_DELETE, because +** the new values are not yet available. In this case, when a ** callback made with op==SQLITE_DELETE is actually a write using the ** sqlite3_blob_write() API, the [sqlite3_preupdate_blobwrite()] returns ** the index of the column being written. In other cases, where the @@ -10922,7 +10922,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const c ** For an ordinary on-disk database file, the serialization is just a ** copy of the disk file. For an in-memory database or a "TEMP" database, ** the serialization is the same sequence of bytes which would be written -** to disk if that database where backed up to disk. +** to disk if that database were backed up to disk. ** ** The usual case is that sqlite3_serialize() copies the serialization of ** the database into memory obtained from [sqlite3_malloc64()] and returns @@ -10931,7 +10931,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const c ** contains the SQLITE_SERIALIZE_NOCOPY bit, then no memory allocations ** are made, and the sqlite3_serialize() function will return a pointer ** to the contiguous memory representation of the database that SQLite -** is currently using for that database, or NULL if the no such contiguous +** is currently using for that database, or NULL if no such contiguous ** memory representation of the database exists. A contiguous memory ** representation of the database will usually only exist if there has ** been a prior call to [sqlite3_deserialize(D,S,...)] with the same @@ -11002,7 +11002,7 @@ SQLITE_API unsigned char *sqlite3_serialize( ** database is currently in a read transaction or is involved in a backup ** operation. ** -** It is not possible to deserialized into the TEMP database. If the +** It is not possible to deserialize into the TEMP database. If the ** S argument to sqlite3_deserialize(D,S,P,N,M,F) is "temp" then the ** function returns SQLITE_ERROR. ** @@ -11024,7 +11024,7 @@ SQLITE_API int sqlite3_deserialize( sqlite3 *db, /* The database connection */ const char *zSchema, /* Which DB to reopen with the deserialization */ unsigned char *pData, /* The serialized database content */ - sqlite3_int64 szDb, /* Number bytes in the deserialization */ + sqlite3_int64 szDb, /* Number of bytes in the deserialization */ sqlite3_int64 szBuf, /* Total size of buffer pData[] */ unsigned mFlags /* Zero or more SQLITE_DESERIALIZE_* flags */ ); @@ -11032,7 +11032,7 @@ SQLITE_API int sqlite3_deserialize( /* ** CAPI3REF: Flags for sqlite3_deserialize() ** -** The following are allowed values for 6th argument (the F argument) to +** The following are allowed values for the 6th argument (the F argument) to ** the [sqlite3_deserialize(D,S,P,N,M,F)] interface. ** ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization diff --git a/contrib/sqlite3/sqlite3.pc.in b/contrib/sqlite3/sqlite3.pc.in index a9f941b1e40d..723dd5156390 100644 --- a/contrib/sqlite3/sqlite3.pc.in +++ b/contrib/sqlite3/sqlite3.pc.in @@ -9,5 +9,5 @@ Name: SQLite Description: SQL database engine Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lsqlite3 -Libs.private: @LDFLAGS_MATH@ @LDFLAGS_ZLIB@ @LDFLAGS_ICU@ +Libs.private: @LDFLAGS_MATH@ @LDFLAGS_ZLIB@ @LDFLAGS_DLOPEN@ @LDFLAGS_PTHREAD@ @LDFLAGS_ICU@ Cflags: -I${includedir} diff --git a/contrib/sqlite3/sqlite3rc.h b/contrib/sqlite3/sqlite3rc.h index d412190d370b..42ece488e353 100644 --- a/contrib/sqlite3/sqlite3rc.h +++ b/contrib/sqlite3/sqlite3rc.h @@ -1,3 +1,3 @@ #ifndef SQLITE_RESOURCE_VERSION -#define SQLITE_RESOURCE_VERSION 3,50,2 +#define SQLITE_RESOURCE_VERSION 3,50,4 *** 1 LINES SKIPPED *** From nobody Tue Dec 2 15:58:30 2025 X-Original-To: dev-commits-src-branches@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 4dLQRb4tx8z6HgmS for ; Tue, 02 Dec 2025 15:58:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dLQRb35Drz4NKm for ; Tue, 02 Dec 2025 15:58:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764691115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fZ7QOeSLHYHzpAuy8A1LndNovnNNhWnHIBXbblUCdp8=; b=sjB23snqJN2ObDsLWLgcuY0tj+D1HwuMLIbf41JSneNhBMt+/kBzgOg9UC3WgvrP4joRpV YNFOPuOGq1B5JsGOINiwI8H94jDdS7xQ9M+j8UqlKKG8ycTIfmVBT9JrCEUSuu6ik8AMq3 5Q1LAxKc9fcWnVyXN4KoKZCPAo+KEIUAEJzukm6xgRT18WagFVSxMMmBvucINg2nxJTonW nAi3TNqHV1MDm9UunAXKj+l4+xUF6+uNQ/lf10aa8e5jKE0s2OFPofOs4rV6gkwre8/PNB mg+CmtCZmqPgC1bwpJPzaePd/SLKZTJbJ4WSg3lNzS+oik75Akx/KhiSOSPm+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764691115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fZ7QOeSLHYHzpAuy8A1LndNovnNNhWnHIBXbblUCdp8=; b=lFJJIwR2FFiWVrWtgHfUnFm29aqnlt5XwY0+IjCY2X/vc1k6d1QN6na/DXAoMtYUnblR74 7D7fFbEyH/UfF6a7ENYyvEk/AIroufvASNjP6RV79UDKgDsRLsRj7J7QmVMcCIMGuUJFhK YOeBI8RE1S9Y0FV/kz4X++THmKLdNB4v97+5nmB/3MHw2e4urRyH2avbOHJtrI+/Ewn9Yx CjnZaJxTn1HBlDlU7jpv5o36TWYmdKQkNkG63UXMupAYapg4V+r5/SWm2ClTWIPYvrBs6p bMx0GxTD3MhiaLu4JyIxNi5qL1JINNHAcxU5e4J6/EMCrQmqfQz0/NeGdfj/YQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764691115; a=rsa-sha256; cv=none; b=rP76PTWjicANBrJMD9I++bxRxNarxe5tdWX0hADyyUnp7uAMSru3NS86SybtaFNZmlrveH TIiJ8yMI8B/lloYZ6loLwtIhJ06Ce0hAQF+/H9M5y2S/jhVJKup771zxs8sByKBb3dTP6i v3/4AiWqJ1kRP5xC8OCV33TeXW5kQTdzTrE2zwNYn52w4TkTuUdCeuzfCOWaqw+3BPz0L4 AOdg82UGGzXsnS1SnPUprq8kWpAsFjTogWu1xys08jA5LeoX6piyIuDoZclumL5zLFQXoT i2726ZPC2VP/NAVm5uXDBrGI5i5yDsBASVwD3MJtm7x1/4cgsB4GMKmF7c5oOQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dLQRb2ZYjz1Cm7 for ; Tue, 02 Dec 2025 15:58:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 37371 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 02 Dec 2025 15:58:30 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 38eec1fc77cd - stable/14 - ipfilter: Load optionlist prior to ippool invocation List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 38eec1fc77cd15377f8908ce9937c9982d4ea9d1 Auto-Submitted: auto-generated Date: Tue, 02 Dec 2025 15:58:30 +0000 Message-Id: <692f0ca6.37371.53687d65@gitrepo.freebsd.org> The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=38eec1fc77cd15377f8908ce9937c9982d4ea9d1 commit 38eec1fc77cd15377f8908ce9937c9982d4ea9d1 Author: Cy Schubert AuthorDate: 2025-11-26 19:40:36 +0000 Commit: Cy Schubert CommitDate: 2025-12-02 15:28:46 +0000 ipfilter: Load optionlist prior to ippool invocation As a safety precaution df381bec2d2b limits ippool hash table size to 1K. This causes any legitimely large hash table to fail to load. The htable_size_max ipf tuneable adjusts this but the adjustment is made in the ipfilter rc script, invoked after the ippool script (because it depends on ippool). Let's load the ipfilter_optionlist in ippool as well. ipfilter_optionlist load will also occur in the ipfilter rc script in case the user uses ipfilter without ippool. Fixes: df381bec2d2b (cherry picked from commit d5d005e9bf4933d5680dd0bb5d42bdf440122aa4) --- libexec/rc/rc.d/ippool | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libexec/rc/rc.d/ippool b/libexec/rc/rc.d/ippool index 42cef3faf7eb..527e1fc780b2 100755 --- a/libexec/rc/rc.d/ippool +++ b/libexec/rc/rc.d/ippool @@ -23,6 +23,9 @@ required_modules="ipl:ipfilter" ippool_start_precmd() { rc_flags="-f ${ippool_rules} ${rc_flags}" + if [ -n "${ifilter_optionlist}" ]; then + ${ipfilter_program:-/sbin/ipf} -T "${ipfilter_optionlist}" + fi } ippool_reload() From nobody Wed Dec 3 02:38:05 2025 X-Original-To: dev-commits-src-branches@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 4dLhdT6fLRz6JffT for ; Wed, 03 Dec 2025 02:38:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dLhdT63DKz3rkY for ; Wed, 03 Dec 2025 02:38:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764729485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=++nEe8AMf/uy0NijzfXX5eRrhQJ8Si7Yn0v02XyXiBY=; b=PFa1rB0oUq7X3rsy8Eq6d+2/4ywVcGEs/HclcJ3YxZTdmVuBwku9LZ60w6CJCkbXYZjE90 iFmZtQuysJAsvT7GE63eSbkTNuiJvxCMnTxPuEyzsow4JIuxl3UJE0p+KlX7XkrFCA1ExY ZvmDrhTYQ5bbAKfz8M58Iz0oT+mZ1Uzi7JBc6u3rJzZeIPi7ZBTcGmjm+AwKzY59f9ipo7 TVZMszQ0jc3fA1QA/SmOTULn7hD64igA+cWamm6elLwftKaKGHTQE6vj6WN/GnJx+EG63T N4LD2cxSjJH07Kp3NtGempYqIbmpFBuohtk/ECCXX8ll1K3Nr2k6lO32J+DRBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764729485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=++nEe8AMf/uy0NijzfXX5eRrhQJ8Si7Yn0v02XyXiBY=; b=Nxfd7md9YiV2//+5LlnBEq/4bFWfJG8ucU0wjWrjkPPiVaN8hQNTi8lGhARswOd5pXQSF1 Tdf05q2k74ffo8YZxz6PM2p+ZQEblXAqpKh6JJzi+AWrEdn0iag0fUOKHTzat49jk99JD7 q+Fce3R31aQ1T406aeYYYdy+P52WRMOJk653afcIgeuO4+QoqEOhaP117Nemwj/4PMkb0I +E7laSM+b8veqWpjUQO+FDxwJgH9u20Gzjami9YecYqCIW+BAAkIQSbDgLGbzxUxAtr216 HjXdJsHY+L2QsoRVL2Hk1yvhspuOeFbpRh/X9gifENlXRecoEycB/qEOxQrLhg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764729485; a=rsa-sha256; cv=none; b=oow7tgO0ZIL8SCevdkwA0X28PeSOyC+TXGoVwu81XKmnbJnr81oI8oXD+a61+b/DO+8R5Z +mSAFligH+zEiC5blKMwd0foHL+vVJIHHi38jJRjKrm+rYwYVJ4M34K+N1OSc3qoBFe3Ae VmShSnQtjDogDfol5SNyExkx7Mdk6FnIqhk5YoQROafd6v9+5BBPmGxAs6PBYAsFzRgJZo pp1nMnCUZaiKJuU+uyJAM5n2XKcR+LQoVpbcY90R2S8X3T98nXYm/0qDAiIEtdRv34xHq0 l5QLURLNf8+VkeE6Z8NwIvC5JLlPzrwHj7oPihd8SPVCqeAKKXguMLeVgNdcLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dLhdT5MJFz3Rg for ; Wed, 03 Dec 2025 02:38:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2ffbc by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 03 Dec 2025 02:38:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 2929eb93f335 - stable/15 - strfmon: Fix typo s/poistion/position/ List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 2929eb93f33553eb7c9e037b6f2081d3d6675628 Auto-Submitted: auto-generated Date: Wed, 03 Dec 2025 02:38:05 +0000 Message-Id: <692fa28d.2ffbc.1a5c0284@gitrepo.freebsd.org> The branch stable/15 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=2929eb93f33553eb7c9e037b6f2081d3d6675628 commit 2929eb93f33553eb7c9e037b6f2081d3d6675628 Author: Jose Luis Duran AuthorDate: 2025-11-23 16:58:55 +0000 Commit: Jose Luis Duran CommitDate: 2025-12-03 02:28:06 +0000 strfmon: Fix typo s/poistion/position/ MFC after: 1 week (cherry picked from commit 91e7f19ec4056587a85c1461a4f34a6d5d4b7b52) --- lib/libc/stdlib/strfmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/stdlib/strfmon.c b/lib/libc/stdlib/strfmon.c index 68a36a6d5567..230d194233f5 100644 --- a/lib/libc/stdlib/strfmon.c +++ b/lib/libc/stdlib/strfmon.c @@ -106,7 +106,7 @@ vstrfmon_l(char *__restrict s, size_t maxsize, locale_t loc, const char *__restrict format, va_list ap) { char *dst; /* output destination pointer */ - const char *fmt; /* current format poistion pointer */ + const char *fmt; /* current format position pointer */ struct lconv *lc; /* pointer to lconv structure */ char *asciivalue; /* formatted double pointer */ From nobody Wed Dec 3 02:38:06 2025 X-Original-To: dev-commits-src-branches@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 4dLhdV75c6z6Jfpr for ; Wed, 03 Dec 2025 02:38:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dLhdV5zngz3rmP for ; Wed, 03 Dec 2025 02:38:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764729486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xm69oAlGheTnr3E/1Se5+743DE2mqKsPZHoV7TYGDho=; b=l53Dc2P++fMSSHHpylOCJehEv9+SzjgvyyiT0OrVhge0awmjDZDyrlu3+57rFSss2TKGe/ EUHWG5bZgx4rogBv9wiWjxjRy71E2+PQIN26U/r5hd74szB4933gfGYHHlE3I5k8Q1Ofuy GN/nL5hbZdTAPbN3S5Ocvui6wqkn+dkGy3lqBAYz8vQpcvRdBQdg2XKeUoPbCiahQalnZV qy0McMX+OPSEW3Moi+YDqiYhOX2Pgo3JwIk29q4xhVALlAAfwJziFBU8MndiRP53AaiHjQ L77J2SewldMnsBN38kELLp4xQgvJntr8U3/Qa0yRmzYpV44eQR3B06yZTf8wQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764729486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xm69oAlGheTnr3E/1Se5+743DE2mqKsPZHoV7TYGDho=; b=RFBp9AP9YgpxI0Pn7Hkb+Ka+EDh7ctI2ooehyJTwCKM1EsdEzAJ/C/VFCFLC+Yq1sz4WMX CiBRlF6XRQmgIXOxwEFHR+f/VdZsRgGIoDKYxoW7uhnjqNukhIdLwnuHpURH+KA4XvHq+g sig2xTcVQmRtroXixeqqLQg8KbFrFQcFqHMFJYwWXx+WWbSvxmL9gBIf8LmO0kaMg3IXh1 4vCrN/SpZlJOyI6yTnXf08dvcdBO8+miM9VuRn0wBW+hUYjbTEW0/OyTapltwyYvfAT7ye ERigF0u2J/9v0Bq00sFgLOKukRL99/VOL/DJ6uUu+jJvv93fkhy9d7dhj7/BWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764729486; a=rsa-sha256; cv=none; b=iMXCwXVwFYsRWTtc38659OVTrhJOB84jWaOeTV61qFEnlyTPzFv5yPXlVXQWbRiQjghm99 d7iU8EDRR+r7R36wTvLFf2kQ4Ku+F5ka3pLzkWaNejsDjIys67SfWtZleg3tXphtSo2FVa rsCrOT6lI4wlF2qF/nnc+8GYDARM7QFaEduH2Lkfp8XbzAx/Ny5t2ycIjeywINilt4oKUV 0UabiYEXLvaGBx+sljvGxyG7jVnmUBTXeBo4ZA+nZs5f4efjfUnvGHECFay5QwpijVIsiW FIZUUgXSMFdFtkvulqEMKCGz4Oix2AVaeQtptwBKzfYQ3StPirJ9DG8rGv10tQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dLhdV5Yftz3Mk for ; Wed, 03 Dec 2025 02:38:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 310af by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 03 Dec 2025 02:38:06 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: d3dbfab0d04e - stable/15 - strfmon: Add tests for Austin Group Defect 1199 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: d3dbfab0d04e54ddeff4dcfa43c3a0f8a9a37370 Auto-Submitted: auto-generated Date: Wed, 03 Dec 2025 02:38:06 +0000 Message-Id: <692fa28e.310af.52ec0e91@gitrepo.freebsd.org> The branch stable/15 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=d3dbfab0d04e54ddeff4dcfa43c3a0f8a9a37370 commit d3dbfab0d04e54ddeff4dcfa43c3a0f8a9a37370 Author: Jose Luis Duran AuthorDate: 2025-11-26 20:34:55 +0000 Commit: Jose Luis Duran CommitDate: 2025-12-03 02:28:34 +0000 strfmon: Add tests for Austin Group Defect 1199 Add tests for The Open Group Base Specifications Issue 8[1], Austin Group Defect 1199[2]. Items marked with XXX represent an invalid output. These items will be fixed in subsequent commits. Notice that an existing test is now considered invalid. Our locale definitions do not include int_p_sep_by_space nor int_n_sep_by_space[3]. Those will be addressed in a subsequent commit. However, the CLDR project defines them as "0", which causes the output to appear as "USD123.45". If our locale definitions were to set the international {n,p}_sep_by_space to "1", the output would display as the expected "USD 123.45". While here, use the SPDX license identifier and add my name to the file. [1]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/strfmon.html [2]: https://www.austingroupbugs.net/view.php?id=1199 [3]: https://unicode-org.atlassian.net/browse/CLDR-237 Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53911 (cherry picked from commit 19e153004fb63c32eba0ef40249f5ede61a93170) --- lib/libc/tests/stdlib/strfmon_test.c | 80 +++++++++++++++++++++++++----------- 1 file changed, 57 insertions(+), 23 deletions(-) diff --git a/lib/libc/tests/stdlib/strfmon_test.c b/lib/libc/tests/stdlib/strfmon_test.c index 86f6256dba0b..3c97d61ba82c 100644 --- a/lib/libc/tests/stdlib/strfmon_test.c +++ b/lib/libc/tests/stdlib/strfmon_test.c @@ -1,31 +1,14 @@ -/*- - * Copyright (C) 2018 Conrad Meyer +/* + * Copyright (c) 2018 Conrad Meyer * All rights reserved. + * Copyright (c) 2022-2025 Jose Luis Duran * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * SPDX-License-Identifier: BSD-2-Clause */ #include +#include #include #include #include @@ -208,6 +191,56 @@ ATF_TC_BODY(strfmon_international_currency_code, tc) } } +ATF_TC_WITHOUT_HEAD(strfmon_plus_or_parenthesis); +ATF_TC_BODY(strfmon_plus_or_parenthesis, tc) +{ + const struct { + const char *format; + const char *locale; + const char *expected; + } tests[] = { + { "%+n", "en_US.UTF-8", "[$123.45] [-$123.45]" }, + { "%+i", "en_US.UTF-8", "[USD123.45] [-USD123.45]" }, + { "%(n", "C", "[123.45] [(123.45)]" }, + { "%(i", "C", "[123.45] [(123.45)]" }, + { "%(n", "en_US.UTF-8", "[$123.45] [($123.45)]" }, + { "%(i", "en_US.UTF-8", "[USD123.45] [(USD123.45)]" }, + { "%n", "C", "[123.45] [(123.45)]" }, /* XXX */ + { "%i", "C", "[123.45] [(123.45)]" }, /* XXX */ + { "%n", "en_US.UTF-8", "[$123.45] [-$123.45]" }, + { "%i", "en_US.UTF-8", "[USD123.45] [-USD123.45]" }, + }; + size_t i; + char actual[100], format[50]; + + for (i = 0; i < nitems(tests); ++i) { + if (setlocale(LC_MONETARY, tests[i].locale) == NULL) + atf_tc_skip("unable to setlocale(): %s", + tests[i].locale); + + snprintf(format, sizeof(format), "[%s] [%s]", + tests[i].format, tests[i].format); + strfmon(actual, sizeof(actual) - 1, format, + 123.45, -123.45); + ATF_CHECK_STREQ_MSG(tests[i].expected, actual, + "[%s] %s", tests[i].format, tests[i].locale); + } + + /* + * The '+' flag was included in a conversion specification and + * the locale's positive_sign and negative_sign values would + * both be returned by localeconv() as empty strings. + */ + if (setlocale(LC_MONETARY, "C") == NULL) + atf_tc_skip("unable to setlocale(): %s", tests[i].locale); + + /* ATF_CHECK_ERRNO(EINVAL, strfmon(actual, sizeof(actual) - 1, + "[%+n] [%+n]", 123.45, -123.45)); XXX */ + + /* ATF_CHECK_ERRNO(EINVAL, strfmon(actual, sizeof(actual) - 1, + "[%+i] [%+i]", 123.45, -123.45)); XXX */ +} + ATF_TC(strfmon_l); ATF_TC_HEAD(strfmon_l, tc) { @@ -220,7 +253,7 @@ ATF_TC_BODY(strfmon_l, tc) const char *locale; const char *expected; } tests[] = { - { "C", "[ **1234.57 ] [ **1234.57 ]" }, + { "C", "[ **1234.57 ] [ **1234.57 ]" }, /* XXX */ { "de_DE.UTF-8", "[ **1234,57 €] [ **1.234,57 EUR]" }, { "en_GB.UTF-8", "[ £**1234.57] [ GBP**1,234.57]" }, }; @@ -247,6 +280,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, strfmon_cs_precedes_0); ATF_TP_ADD_TC(tp, strfmon_cs_precedes_1); ATF_TP_ADD_TC(tp, strfmon_international_currency_code); + ATF_TP_ADD_TC(tp, strfmon_plus_or_parenthesis); ATF_TP_ADD_TC(tp, strfmon_l); return (atf_no_error()); } From nobody Wed Dec 3 02:38:07 2025 X-Original-To: dev-commits-src-branches@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 4dLhdX0d2mz6Jfn4 for ; Wed, 03 Dec 2025 02:38:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dLhdW6vS8z3rZc for ; Wed, 03 Dec 2025 02:38:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764729488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WBuT4cMYap4EBrURY0vOM74cEsn8ektI+eYPW4une+c=; b=YHke2bVcXijMNk8zSTm/Z3WQxZDYlgMQupPUJF/XvCQQXGiP/JiH9Bo8Fa4x3m5rIPZtf5 aWVvF8FfhNknoTMgnQQ8MThmmy/xlHj1VnFDZr/uBRDQzzWrMDN+Jkl0Ubqe6c9lQdDvps Tg5AqLZQm/kYHdd2boLQwd3NFLLh/JVpTeLZ29beCLXaq7ITb8huH2cs0QWG6jMreZ/YeZ jfh+Y1iTFdUbK1OtxD87EJqsWpRfcQnR2sIh53eTetoKqKi3Eog7Odfo6CB+VqXkm1QLgo prQhLaHnwoMMaO3drUpcUrCi4hyDM4kqc1ZFqFThQvFF6w/+DlJ7vnfMY8VZxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764729488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WBuT4cMYap4EBrURY0vOM74cEsn8ektI+eYPW4une+c=; b=WwczwEAcIHHhZicMpJVxLu4g1FdcYXDz68VbLZl14aLB6KbLkJQIBzoiO2njdwzxPQkRT4 mJNYkx313iHXU+hlZC76abdmNLixzF2vRWht79/1pvjnjxAyeGkg1u4JGdcfXfN9wmN1Lu LSkfpbtRluIIrslC7ija087Cx4PRHar6WOm5gtIpop/oIxbjcaIkH+0elyeHt1yG42vm6O osAgTv3QotCdmsaNAdtRaNb7WAebONf7YJ9mAxiUKW6M/ogr70xHP6X2HQ/kY5RL3O9wjT ShQeTzDtHK1vAOHv7r8NF951RmpyNboX1SBZivkWDY/hh4R+G/2EJcssvrAlOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764729488; a=rsa-sha256; cv=none; b=v+KqxowBXHzkNY4ImKBxdv5SvSDfXCoUQos14MNESM24oawxqRbj/0gGYk4zYnNwrd4ZZV oZ10bHfeVi0DacxOyJTD1N3pmnjL9Ekqt4K1uSLp19FDz3IdxsY2ET8e0iGf5+KL1eGLJ0 Lsion9+XvEiaEdXpo2W6l2N1Nm2KgGPlJOhg9h1SWjDQQjDihc6Blfk0B5d0wyH4wRFWRC hbJv0UyP/9m6Vy1w8AZqUedptXDVhzgn+qm2GGKSUw/0RSEv3DeUAc7cy1La0cm7qygInp Csnncvif30Y3yforB7QecPsDdjJi1a567bcL6hXDuhpBvxCl9Kuvf/eAke6osA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dLhdW6Nf7z3td for ; Wed, 03 Dec 2025 02:38:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2f7ab by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 03 Dec 2025 02:38:07 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 488c4a511434 - stable/15 - strfmon: EINVAL if the '+' flag and both signs are empty List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 488c4a511434c9f72729846163e04b265cb9d170 Auto-Submitted: auto-generated Date: Wed, 03 Dec 2025 02:38:07 +0000 Message-Id: <692fa28f.2f7ab.1a30038b@gitrepo.freebsd.org> The branch stable/15 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=488c4a511434c9f72729846163e04b265cb9d170 commit 488c4a511434c9f72729846163e04b265cb9d170 Author: Jose Luis Duran AuthorDate: 2025-11-26 20:34:55 +0000 Commit: Jose Luis Duran CommitDate: 2025-12-03 02:28:53 +0000 strfmon: EINVAL if the '+' flag and both signs are empty According to the Open Group Base Specifications Issue 8[1], strfmon(3) should return EINVAL when the '+' flag was included in a conversion specification and the locale's positive_sign and negative_sign values would both be returned by localeconv(3) as empty strings. Austin Group Defect 1199[2] is applied, adding the [EINVAL] error. [1]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/strfmon.html [2]: https://www.austingroupbugs.net/view.php?id=1199 Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53912 (cherry picked from commit 1fd018972a18b682521bb8f004dfd162327e5db2) --- lib/libc/stdlib/strfmon.3 | 12 +++++++++++- lib/libc/stdlib/strfmon.c | 4 +++- lib/libc/tests/stdlib/strfmon_test.c | 8 ++++---- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/lib/libc/stdlib/strfmon.3 b/lib/libc/stdlib/strfmon.3 index 20cc560d401d..d537d9d05fa7 100644 --- a/lib/libc/stdlib/strfmon.3 +++ b/lib/libc/stdlib/strfmon.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 6, 2023 +.Dd November 24, 2025 .Dt STRFMON 3 .Os .Sh NAME @@ -182,6 +182,16 @@ function will fail if: Conversion stopped due to lack of space in the buffer. .It Bq Er EINVAL The format string is invalid. +.It Bq Er EINVAL +The +.Cm + +flag was included in a conversion specification and the locale's +.Va positive_sign +and +.Va negative_sign +values would both be returned by +.Xr localeconv 3 +as empty strings. .It Bq Er ENOMEM Not enough memory for temporary buffers. .El diff --git a/lib/libc/stdlib/strfmon.c b/lib/libc/stdlib/strfmon.c index 230d194233f5..b19d9fc43369 100644 --- a/lib/libc/stdlib/strfmon.c +++ b/lib/libc/stdlib/strfmon.c @@ -171,7 +171,9 @@ literal: flags &= ~(NEED_GROUPING); continue; case '+': /* use locale defined signs */ - if (flags & SIGN_POSN_USED) + if ((flags & SIGN_POSN_USED) || + ((lc->positive_sign[0] == '\0') && + (lc->negative_sign[0] == '\0'))) goto format_error; flags |= (SIGN_POSN_USED | LOCALE_POSN); continue; diff --git a/lib/libc/tests/stdlib/strfmon_test.c b/lib/libc/tests/stdlib/strfmon_test.c index 3c97d61ba82c..165ddcc2ab56 100644 --- a/lib/libc/tests/stdlib/strfmon_test.c +++ b/lib/libc/tests/stdlib/strfmon_test.c @@ -234,11 +234,11 @@ ATF_TC_BODY(strfmon_plus_or_parenthesis, tc) if (setlocale(LC_MONETARY, "C") == NULL) atf_tc_skip("unable to setlocale(): %s", tests[i].locale); - /* ATF_CHECK_ERRNO(EINVAL, strfmon(actual, sizeof(actual) - 1, - "[%+n] [%+n]", 123.45, -123.45)); XXX */ + ATF_CHECK_ERRNO(EINVAL, strfmon(actual, sizeof(actual) - 1, + "[%+n] [%+n]", 123.45, -123.45)); - /* ATF_CHECK_ERRNO(EINVAL, strfmon(actual, sizeof(actual) - 1, - "[%+i] [%+i]", 123.45, -123.45)); XXX */ + ATF_CHECK_ERRNO(EINVAL, strfmon(actual, sizeof(actual) - 1, + "[%+i] [%+i]", 123.45, -123.45)); } ATF_TC(strfmon_l); From nobody Wed Dec 3 02:38:09 2025 X-Original-To: dev-commits-src-branches@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 4dLhdY2kBlz6JfYh for ; Wed, 03 Dec 2025 02:38:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dLhdY19z6z3rdx for ; Wed, 03 Dec 2025 02:38:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764729489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QUDLqbUVxs6z84GlIYubiWcucUbnwWEd3IvWsAUClI4=; b=Q3wYCkJHq0XdOr28CLPzGGnksnts/OOD6Ip22U7OCw5xKGTr7w95/nPSEjaay+KT6HQpGk jPuNV9iaes46nF5DedqXHkJzJf+FSY2G9t6xbJ/zPVF1Ri8uhcaX5uCB5oYbuSujalzXm3 iX9ofALDTYnHK2OACEkq+uPKOIVq6mehK+0Oan/rGK86/5gG56hVZMZt7CcwbkNlX1mLYP gMPdMnN17h02dEvydmEjzgPK324aNOk52TGgfqm7qtBoD3Qxi3Jrf1OdcyPbjzIjz8kRHO MwcxexA1ajhxSGv/UrJQwYDqsUv2+G1DnRIhjhfW4G6ccnpyQuo3nuYtRwDj2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764729489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QUDLqbUVxs6z84GlIYubiWcucUbnwWEd3IvWsAUClI4=; b=WALBvu8V07WAXoPUmQnV/T/mezbk1hlcTNkzIYhpu3+GDCkdLUYrm3VJj9FQxxmBSqlOpi mJWpo9E9UKabEwuAqc2QeX8U3fa1o5kj+MeREJvNIOlXLadtZgJWusgVetcAVDTd555uc9 89uByDOc8PQVmUlB7mcyZg89zdbf10QbcxyNybhaAGK9CiShWZMA+OjY9GSJ/mcm7yk6ex dkPC5+J8iDpafK47ayfJsRPvpEmHdyOnyA+oeeqoscYfeMMDuHxLRrVvD1tdyk+5gAKy2D CvsmUAlqJicuPBafr9dMwV11f8ThYcfzlKbEb9T7YJVbpohNdoTxF4EJ5TqB9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764729489; a=rsa-sha256; cv=none; b=wlq6vhTyVUdDXl42NC62GfZ/C0DDex8wG9TlFdGP5414HoPe5MQjaHbojzIApL9MmuxGeX MWsrHDDCi5xDIfmFGHGct3F88Jt14fRKdDJuqouFyg04U3Yn+GG5/agcURSjlFcQXDEqyf jWxhx06F72laNIS+w8NFdOjcCi41RT/2ezJspzQI7M/lW906d3Rc0W35OocRAnYDNQYX1K ty5ygq2cvZ0d6OkRtJ+yrlqINHz66S0fKGMFyuxU1OjpjkX12bn5AL+zYBsws3G9roEFI5 7Dzn7wPnY5n8zGUBluKQbWoSGIARsW8isvT33qfNC2fQxOIWx/Yf0NbacwC/FQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dLhdY04z8z397 for ; Wed, 03 Dec 2025 02:38:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2f7af by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 03 Dec 2025 02:38:09 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 06c2e9b7685b - stable/15 - strfmon: Fix negative sign handling for C locale List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 06c2e9b7685b630d90b20364bbe778007086a624 Auto-Submitted: auto-generated Date: Wed, 03 Dec 2025 02:38:09 +0000 Message-Id: <692fa291.2f7af.8761815@gitrepo.freebsd.org> The branch stable/15 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=06c2e9b7685b630d90b20364bbe778007086a624 commit 06c2e9b7685b630d90b20364bbe778007086a624 Author: Jose Luis Duran AuthorDate: 2025-11-26 20:34:56 +0000 Commit: Jose Luis Duran CommitDate: 2025-12-03 02:29:13 +0000 strfmon: Fix negative sign handling for C locale If the locale's positive_sign and negative_sign values would both be returned by localeconv() as empty strings, strfmon() shall behave as if the negative_sign value was the string "-". This occurs with the C locale. The implementation previously assigned "0" to sign_posn (parentheses around the entire string); now it assigns it to "1" (sign before the string) when it is undefined (CHAR_MAX). Austin Group Defect 1199[1] is applied, changing the requirements for the '+' and '(' flags. [1]: https://www.austingroupbugs.net/view.php?id=1199 Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53913 (cherry picked from commit cf85e7034ad5640b18a3b68d6b291b7bf89bfc80) --- lib/libc/stdlib/strfmon.c | 2 +- lib/libc/tests/stdlib/strfmon_test.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/libc/stdlib/strfmon.c b/lib/libc/stdlib/strfmon.c index b19d9fc43369..611ac45b9c82 100644 --- a/lib/libc/stdlib/strfmon.c +++ b/lib/libc/stdlib/strfmon.c @@ -457,7 +457,7 @@ __setup_vars(int flags, char *cs_precedes, char *sep_by_space, char *sign_posn, if (*sep_by_space == CHAR_MAX) *sep_by_space = 0; if (*sign_posn == CHAR_MAX) - *sign_posn = 0; + *sign_posn = 1; } static int diff --git a/lib/libc/tests/stdlib/strfmon_test.c b/lib/libc/tests/stdlib/strfmon_test.c index 165ddcc2ab56..c6c20bd26985 100644 --- a/lib/libc/tests/stdlib/strfmon_test.c +++ b/lib/libc/tests/stdlib/strfmon_test.c @@ -205,8 +205,8 @@ ATF_TC_BODY(strfmon_plus_or_parenthesis, tc) { "%(i", "C", "[123.45] [(123.45)]" }, { "%(n", "en_US.UTF-8", "[$123.45] [($123.45)]" }, { "%(i", "en_US.UTF-8", "[USD123.45] [(USD123.45)]" }, - { "%n", "C", "[123.45] [(123.45)]" }, /* XXX */ - { "%i", "C", "[123.45] [(123.45)]" }, /* XXX */ + { "%n", "C", "[123.45] [-123.45]" }, + { "%i", "C", "[123.45] [-123.45]" }, { "%n", "en_US.UTF-8", "[$123.45] [-$123.45]" }, { "%i", "en_US.UTF-8", "[USD123.45] [-USD123.45]" }, }; @@ -253,7 +253,7 @@ ATF_TC_BODY(strfmon_l, tc) const char *locale; const char *expected; } tests[] = { - { "C", "[ **1234.57 ] [ **1234.57 ]" }, /* XXX */ + { "C", "[ **1234.57] [ **1234.57]" }, { "de_DE.UTF-8", "[ **1234,57 €] [ **1.234,57 EUR]" }, { "en_GB.UTF-8", "[ £**1234.57] [ GBP**1,234.57]" }, }; From nobody Wed Dec 3 02:38:27 2025 X-Original-To: dev-commits-src-branches@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 4dLhdv6FR1z6JflG for ; Wed, 03 Dec 2025 02:38:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dLhdv2R1vz3sNC for ; Wed, 03 Dec 2025 02:38:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764729507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uUd3ABTFDoR5ec5eDsw4A+GFvinlaap+L2KdIbLjZ3o=; b=cxTpoR3AShr1LABTiwL1JYPnJz3155ga04C0GsxPh++UelLbb3HaUysByhfz5VQ7WI6Zv0 Be+hVWSAx5vUW390Rek2kczaWWJBTigun+gVQMiFOom5LTpmhkj84zak5yTKcCDFoB1dGF wTOR5a4zGa8zfgwLlhMeSv5l+aaopfxe/3lrS2Id82iQRhM2eq5vm03iE2AxEKNFQpM+Vr 2GJHMkGcMKtc7yBQJkPNkOz8SpcQxU61ziDDBC0FJg65ykAs6lMU0VNmYoPjmWWGFjSlu5 PBFGmxj4sJyGeYwnW66Zzx/OeM1sD9/OSGenox25DQmYmdSSJTA3b9rJU1+zCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764729507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uUd3ABTFDoR5ec5eDsw4A+GFvinlaap+L2KdIbLjZ3o=; b=x36Q/ZXW1f3Uvsv78wVntdDkYeO7cnsxpa3HfWXkbty4xS0A2XBnbyew8OVG+oQ19+H6TU en8pT6hYBqpbVFY6Yq2Mp8NtZAk0/O4OZGMEn8kEJkCmbm0PCYES3hfmfoKAslzYqlc8r+ ccDCx6UDW4l0//M8FL/aPRpV8jWIkO91/02VMmFIJ8w2cR1LFmed4gUWIgNUOMWw+Attm9 qoGhB+urLdi4/NVtwUdu351QFW8RxR62QM+spgeFtgyYeu3ebdpMiGtH0Gjs7E5n1Nij6B HbSAq9ELrFQMi2Z7NtxcDruzl9tfpsOevYzLRLw5Pa/W/I/pX28MLyM1TgDGFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764729507; a=rsa-sha256; cv=none; b=dhUSH55lgUEaQthRvUlH02Wgybh1wFpp1/M/jnE8YoG0B3gIHBU8ewM+m7atDQin4w7U2O OeFMqZYUZcd8kRjgbpu5xqMH8959FwmVuWavOISHJig57QxNBY1OjZbFcf03yH9Ie5+b6/ bHwdc/cKuNPmTJlpkbG9gh40vYK0dJkTigj69lriPdiJYu23qMXZe29kwFvxs+OELCng+Y Nk6ZzzZmEh/QvQxpW5qa2nRu0/RBy2LcF08mc8NZzTBLxloOomfmqahkgcI0+QY8XCQP+Z 6u95HlEwcyDtifecV7wk3f/ERFpUNDR09iz9ycId6088E2rieddx5q6YT6znfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dLhdv20nnz399 for ; Wed, 03 Dec 2025 02:38:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2f7b7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 03 Dec 2025 02:38:27 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 7745ece2819e - stable/14 - strfmon: Add tests for Austin Group Defect 1199 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7745ece2819e3613308974c5c547b7d1218b3856 Auto-Submitted: auto-generated Date: Wed, 03 Dec 2025 02:38:27 +0000 Message-Id: <692fa2a3.2f7b7.5cbb4679@gitrepo.freebsd.org> The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=7745ece2819e3613308974c5c547b7d1218b3856 commit 7745ece2819e3613308974c5c547b7d1218b3856 Author: Jose Luis Duran AuthorDate: 2025-11-26 20:34:55 +0000 Commit: Jose Luis Duran CommitDate: 2025-12-03 02:34:09 +0000 strfmon: Add tests for Austin Group Defect 1199 Add tests for The Open Group Base Specifications Issue 8[1], Austin Group Defect 1199[2]. Items marked with XXX represent an invalid output. These items will be fixed in subsequent commits. Notice that an existing test is now considered invalid. Our locale definitions do not include int_p_sep_by_space nor int_n_sep_by_space[3]. Those will be addressed in a subsequent commit. However, the CLDR project defines them as "0", which causes the output to appear as "USD123.45". If our locale definitions were to set the international {n,p}_sep_by_space to "1", the output would display as the expected "USD 123.45". While here, use the SPDX license identifier and add my name to the file. [1]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/strfmon.html [2]: https://www.austingroupbugs.net/view.php?id=1199 [3]: https://unicode-org.atlassian.net/browse/CLDR-237 Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53911 (cherry picked from commit 19e153004fb63c32eba0ef40249f5ede61a93170) --- lib/libc/tests/stdlib/strfmon_test.c | 80 +++++++++++++++++++++++++----------- 1 file changed, 57 insertions(+), 23 deletions(-) diff --git a/lib/libc/tests/stdlib/strfmon_test.c b/lib/libc/tests/stdlib/strfmon_test.c index 86f6256dba0b..3c97d61ba82c 100644 --- a/lib/libc/tests/stdlib/strfmon_test.c +++ b/lib/libc/tests/stdlib/strfmon_test.c @@ -1,31 +1,14 @@ -/*- - * Copyright (C) 2018 Conrad Meyer +/* + * Copyright (c) 2018 Conrad Meyer * All rights reserved. + * Copyright (c) 2022-2025 Jose Luis Duran * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * SPDX-License-Identifier: BSD-2-Clause */ #include +#include #include #include #include @@ -208,6 +191,56 @@ ATF_TC_BODY(strfmon_international_currency_code, tc) } } +ATF_TC_WITHOUT_HEAD(strfmon_plus_or_parenthesis); +ATF_TC_BODY(strfmon_plus_or_parenthesis, tc) +{ + const struct { + const char *format; + const char *locale; + const char *expected; + } tests[] = { + { "%+n", "en_US.UTF-8", "[$123.45] [-$123.45]" }, + { "%+i", "en_US.UTF-8", "[USD123.45] [-USD123.45]" }, + { "%(n", "C", "[123.45] [(123.45)]" }, + { "%(i", "C", "[123.45] [(123.45)]" }, + { "%(n", "en_US.UTF-8", "[$123.45] [($123.45)]" }, + { "%(i", "en_US.UTF-8", "[USD123.45] [(USD123.45)]" }, + { "%n", "C", "[123.45] [(123.45)]" }, /* XXX */ + { "%i", "C", "[123.45] [(123.45)]" }, /* XXX */ + { "%n", "en_US.UTF-8", "[$123.45] [-$123.45]" }, + { "%i", "en_US.UTF-8", "[USD123.45] [-USD123.45]" }, + }; + size_t i; + char actual[100], format[50]; + + for (i = 0; i < nitems(tests); ++i) { + if (setlocale(LC_MONETARY, tests[i].locale) == NULL) + atf_tc_skip("unable to setlocale(): %s", + tests[i].locale); + + snprintf(format, sizeof(format), "[%s] [%s]", + tests[i].format, tests[i].format); + strfmon(actual, sizeof(actual) - 1, format, + 123.45, -123.45); + ATF_CHECK_STREQ_MSG(tests[i].expected, actual, + "[%s] %s", tests[i].format, tests[i].locale); + } + + /* + * The '+' flag was included in a conversion specification and + * the locale's positive_sign and negative_sign values would + * both be returned by localeconv() as empty strings. + */ + if (setlocale(LC_MONETARY, "C") == NULL) + atf_tc_skip("unable to setlocale(): %s", tests[i].locale); + + /* ATF_CHECK_ERRNO(EINVAL, strfmon(actual, sizeof(actual) - 1, + "[%+n] [%+n]", 123.45, -123.45)); XXX */ + + /* ATF_CHECK_ERRNO(EINVAL, strfmon(actual, sizeof(actual) - 1, + "[%+i] [%+i]", 123.45, -123.45)); XXX */ +} + ATF_TC(strfmon_l); ATF_TC_HEAD(strfmon_l, tc) { @@ -220,7 +253,7 @@ ATF_TC_BODY(strfmon_l, tc) const char *locale; const char *expected; } tests[] = { - { "C", "[ **1234.57 ] [ **1234.57 ]" }, + { "C", "[ **1234.57 ] [ **1234.57 ]" }, /* XXX */ { "de_DE.UTF-8", "[ **1234,57 €] [ **1.234,57 EUR]" }, { "en_GB.UTF-8", "[ £**1234.57] [ GBP**1,234.57]" }, }; @@ -247,6 +280,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, strfmon_cs_precedes_0); ATF_TP_ADD_TC(tp, strfmon_cs_precedes_1); ATF_TP_ADD_TC(tp, strfmon_international_currency_code); + ATF_TP_ADD_TC(tp, strfmon_plus_or_parenthesis); ATF_TP_ADD_TC(tp, strfmon_l); return (atf_no_error()); } From nobody Wed Dec 3 02:38:26 2025 X-Original-To: dev-commits-src-branches@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 4dLhdt3HN8z6Jfq0 for ; Wed, 03 Dec 2025 02:38:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dLhdt1sz0z3sW8 for ; Wed, 03 Dec 2025 02:38:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764729506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hi+wf1IHU+iC5hrQ5d69/atRKuGJY8Z8ibRmWEZjpWI=; b=xCpwnRPSAvT27wnLlBGxkMBx4Cp78VxMt6XDkpNztWTz4XJAzTehRNd9qgrRpiWcGizrq/ yYodcq5hO7WNVICldnhgawE7YJ2jCsQS/oopoKvxmbOOxE22gByyMEYoxKpCO7LtPNDyB1 YzPzlfWHh/ZYzVKg6GutTZ8VFQCDMcFMiKqxIgJ6T4tZ+xgHefPbWf93L1jTi5KZH4POKI Xkh4Ky6dsh8pQC7sM0gOsiYi+wqVm1Bp+rMyeDiLdRcyAUiQsDCrES3yjy4PgQYcRwemPq ZZ3MZFiKJTajZLAes6p4tWRoPXHT8GxtC4NjkHcnePiFFrVum/N4j3yN5SIVew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764729506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hi+wf1IHU+iC5hrQ5d69/atRKuGJY8Z8ibRmWEZjpWI=; b=APr4zfFJedfaDAJ2f7X9JCGm8y49OTzfHb/r1frTxmT2ilPcuBHaZ3nrqTGtumUyE2Yji5 3NcsrosbgVQR3oHybv7BKl2uAc4jOUeKyDeaH1VInRu24FfldGsXjJsPpeucoQ7/rcggZn jQrk++37jUAL3Xs0KQI/YZg/GBun48cc66W04ZIjw0fQQ0Y1548lSKvFQPU8P49/qO+xMI nHhRFNNc0ExQS5ENz+Fkbj+6ySmnud3OwLVlb40QDnU5eT0ay04WmoGaWqSdoV1g4qKr/p NQoS0l2e5QWHNhGCGo0n84ztZf121/g3n+nAHb6D88GqlNBi21vpibSdJFAAoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764729506; a=rsa-sha256; cv=none; b=FsnD3gzc9sw7CO2Hletu873XcQgAi8xt9JigZfAwECRVPItu6F90tUZqp2O5nXZagjmsoV 7r9JlyhS/A+9yROAKyVGPwFj/z9mgxJUVH5inEjlRo7AHedIY8fiGIMbqfGign0Ol0iWww FmFfAsoVqo6pWC+czlFeXIwTzpK1ejgK8/yjlRxRD4Cson3MmqJqtwTl8jzTfWtLGSloQI puaZewClMkD4wMOI3XbJHC0KPEt1SEPCbrUn8SwraXNq8e8uH32qU5WKCRGx+2Cp+yCIXV vZ6eotJTtWxJ/g/V5YoaFvp0YXEL/6BtMyIevzi/87V6evSFoexDtXRpGn534A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dLhdt1F1Tz398 for ; Wed, 03 Dec 2025 02:38:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2f7b3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 03 Dec 2025 02:38:26 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: f830e53fc085 - stable/14 - strfmon: Fix typo s/poistion/position/ List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f830e53fc0850e58790ee8c58552a9f049244fd4 Auto-Submitted: auto-generated Date: Wed, 03 Dec 2025 02:38:26 +0000 Message-Id: <692fa2a2.2f7b3.28b205a1@gitrepo.freebsd.org> The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=f830e53fc0850e58790ee8c58552a9f049244fd4 commit f830e53fc0850e58790ee8c58552a9f049244fd4 Author: Jose Luis Duran AuthorDate: 2025-11-23 16:58:55 +0000 Commit: Jose Luis Duran CommitDate: 2025-12-03 02:33:57 +0000 strfmon: Fix typo s/poistion/position/ MFC after: 1 week (cherry picked from commit 91e7f19ec4056587a85c1461a4f34a6d5d4b7b52) --- lib/libc/stdlib/strfmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/stdlib/strfmon.c b/lib/libc/stdlib/strfmon.c index 68a36a6d5567..230d194233f5 100644 --- a/lib/libc/stdlib/strfmon.c +++ b/lib/libc/stdlib/strfmon.c @@ -106,7 +106,7 @@ vstrfmon_l(char *__restrict s, size_t maxsize, locale_t loc, const char *__restrict format, va_list ap) { char *dst; /* output destination pointer */ - const char *fmt; /* current format poistion pointer */ + const char *fmt; /* current format position pointer */ struct lconv *lc; /* pointer to lconv structure */ char *asciivalue; /* formatted double pointer */ From nobody Wed Dec 3 02:38:28 2025 X-Original-To: dev-commits-src-branches@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 4dLhdw63HXz6JfsK for ; Wed, 03 Dec 2025 02:38:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dLhdw3Kk8z3sNT for ; Wed, 03 Dec 2025 02:38:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764729508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HipXXDWkxvf68bOcXG/Bxl+ccuNjm4Xltwa1/u4SpI8=; b=qxTz3y/HXY22zEEgLyHM9Gh8c6cYBxEKdQppK5bD0ISJOYIHdyNWwGs0ia+f61LQV5IT8p 2ZWanoB9gMmgRefzzNnt+BRbe4gbcEYmnyIVzAdkUtCAuCqHDiBfHgH5jBMEqmcTMkr0p0 LKEgcYxzotY4skBFBDdAVKSOMmJgj11BjK47/lhi38PbsJnhNKLptl0ekk6SiRQSKAqMYP DLyRMJXtUsM+z5x2xcow4gwNpz0ATLdsIdkAzZfp+OH3qT202OYwxfjaCRVjrtmnNz/X9Q 1UF48YJBWR7NX9BGYoVSaVa9UkpGBQ7CgIRdGsITHP6CHq7rc4zRDsetoiTkzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764729508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HipXXDWkxvf68bOcXG/Bxl+ccuNjm4Xltwa1/u4SpI8=; b=I2ewsdwN/iepEZ0D2MIKpSnn7RfUdF1ho+/t8vQkdGVygqUmTIdwXdyefBdW0AVAwiPh6Z H8l3E9F9tnaolXkEqeMWmaPcEMudqPuJoCbWSdAGv3YEE3BH2ufYsATajv5pzdlunUV+kT 2qgFu1WKKVowvbf5/Mzc7Ln/hS5MMyYyXUSqbrqi1pxSOUnN+sOk3YZc5+XX59DRT68XGG 5+7o/imgVDjVGfJD6I5WWABDJpNWSWB8qAoIhqAe//THjMr/eLOyAAcM0QIV64g20NsI4z 60VjBTFGJxm+o1sY4ElnRKds/lQg6QRRnlMPgKrcHx4Sl0TYYlIM7DrAyvSs/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764729508; a=rsa-sha256; cv=none; b=EGUgQRvd//+teLnLqLzkM6iXUZYNZ05IMMpL9mqvbMCt18kdUMpI4RYWsAa/M6hzxTpZ7o 7B1ZxZdYUI0mTMEg3N2FMcsz7kzSzpgahbBgHEW0fnhG0ojZysAtf+ktL4dYTkJn8EIapj bE/8HirSLyKRGvzH27msLYySfADYurvLYyeyXRSn6vr9rNRzK9ayNuhAeMsrjfZ5qMwwJv +A8uh6rY6Uv0gQTcmndRkRf6Dvb6ErKOXnafkDoV4NdE32qTXdioKjtjwLP1+pcqm6YpHk MZXGLxVeiuk78ncuw3ywlPPhgQtnwhXi8NmX6xxreRFmGLGKka2ORyD+bUJ5Qg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dLhdw2qsGz3qB for ; Wed, 03 Dec 2025 02:38:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 30fac by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 03 Dec 2025 02:38:28 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 8dc8e3011d05 - stable/14 - strfmon: EINVAL if the '+' flag and both signs are empty List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8dc8e3011d05bdadb3e62fe99fbb054e33bfd8f2 Auto-Submitted: auto-generated Date: Wed, 03 Dec 2025 02:38:28 +0000 Message-Id: <692fa2a4.30fac.47c41e8d@gitrepo.freebsd.org> The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=8dc8e3011d05bdadb3e62fe99fbb054e33bfd8f2 commit 8dc8e3011d05bdadb3e62fe99fbb054e33bfd8f2 Author: Jose Luis Duran AuthorDate: 2025-11-26 20:34:55 +0000 Commit: Jose Luis Duran CommitDate: 2025-12-03 02:34:21 +0000 strfmon: EINVAL if the '+' flag and both signs are empty According to the Open Group Base Specifications Issue 8[1], strfmon(3) should return EINVAL when the '+' flag was included in a conversion specification and the locale's positive_sign and negative_sign values would both be returned by localeconv(3) as empty strings. Austin Group Defect 1199[2] is applied, adding the [EINVAL] error. [1]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/strfmon.html [2]: https://www.austingroupbugs.net/view.php?id=1199 Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53912 (cherry picked from commit 1fd018972a18b682521bb8f004dfd162327e5db2) --- lib/libc/stdlib/strfmon.3 | 12 +++++++++++- lib/libc/stdlib/strfmon.c | 4 +++- lib/libc/tests/stdlib/strfmon_test.c | 8 ++++---- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/lib/libc/stdlib/strfmon.3 b/lib/libc/stdlib/strfmon.3 index 20cc560d401d..d537d9d05fa7 100644 --- a/lib/libc/stdlib/strfmon.3 +++ b/lib/libc/stdlib/strfmon.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 6, 2023 +.Dd November 24, 2025 .Dt STRFMON 3 .Os .Sh NAME @@ -182,6 +182,16 @@ function will fail if: Conversion stopped due to lack of space in the buffer. .It Bq Er EINVAL The format string is invalid. +.It Bq Er EINVAL +The +.Cm + +flag was included in a conversion specification and the locale's +.Va positive_sign +and +.Va negative_sign +values would both be returned by +.Xr localeconv 3 +as empty strings. .It Bq Er ENOMEM Not enough memory for temporary buffers. .El diff --git a/lib/libc/stdlib/strfmon.c b/lib/libc/stdlib/strfmon.c index 230d194233f5..b19d9fc43369 100644 --- a/lib/libc/stdlib/strfmon.c +++ b/lib/libc/stdlib/strfmon.c @@ -171,7 +171,9 @@ literal: flags &= ~(NEED_GROUPING); continue; case '+': /* use locale defined signs */ - if (flags & SIGN_POSN_USED) + if ((flags & SIGN_POSN_USED) || + ((lc->positive_sign[0] == '\0') && + (lc->negative_sign[0] == '\0'))) goto format_error; flags |= (SIGN_POSN_USED | LOCALE_POSN); continue; diff --git a/lib/libc/tests/stdlib/strfmon_test.c b/lib/libc/tests/stdlib/strfmon_test.c index 3c97d61ba82c..165ddcc2ab56 100644 --- a/lib/libc/tests/stdlib/strfmon_test.c +++ b/lib/libc/tests/stdlib/strfmon_test.c @@ -234,11 +234,11 @@ ATF_TC_BODY(strfmon_plus_or_parenthesis, tc) if (setlocale(LC_MONETARY, "C") == NULL) atf_tc_skip("unable to setlocale(): %s", tests[i].locale); - /* ATF_CHECK_ERRNO(EINVAL, strfmon(actual, sizeof(actual) - 1, - "[%+n] [%+n]", 123.45, -123.45)); XXX */ + ATF_CHECK_ERRNO(EINVAL, strfmon(actual, sizeof(actual) - 1, + "[%+n] [%+n]", 123.45, -123.45)); - /* ATF_CHECK_ERRNO(EINVAL, strfmon(actual, sizeof(actual) - 1, - "[%+i] [%+i]", 123.45, -123.45)); XXX */ + ATF_CHECK_ERRNO(EINVAL, strfmon(actual, sizeof(actual) - 1, + "[%+i] [%+i]", 123.45, -123.45)); } ATF_TC(strfmon_l); From nobody Wed Dec 3 02:38:29 2025 X-Original-To: dev-commits-src-branches@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 4dLhdy04JVz6Jfhh for ; Wed, 03 Dec 2025 02:38:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dLhdx577Jz3shr for ; Wed, 03 Dec 2025 02:38:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764729509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N6agJsGQgMFpcNt1uNNI/dGkY5nKcxZYvXoiaFFOvbU=; b=PPZlEXwPFmIfn2zPhHRD8tGMZKmhFjGfETZtkEEhpcZvTKVvFybW0AXwsxF5MAckvy8aSb wHIu9ksllxWO2OGFl2oU3m9ppchMW8AQNMIdh5NhlwSOTy7qIJSNDhoZFY5Mv1LS6lva1v nfjYi8QuAMf+AeOtzTEpBfwOugTxNDIlZoH4MRcURWBRXb8QA7E73jRnnc+uvZa10kUINR SKFJPPGGfJbatxPytQ7Hn4rHd7KtM2okQ2vOecCxhXy8ZpIr/vQ4kjL9zhxpmsYlVGHs3F kWFpFwJIEEZuNaQ8Qg/hIvqbjAFtScc1ED8v+AexHmkxKe4Dl+jvqJCeC2hDZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764729509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N6agJsGQgMFpcNt1uNNI/dGkY5nKcxZYvXoiaFFOvbU=; b=dd0Qc0P/hazOHXMGIiDe5bHdPAmcwYKF4vpeuh12IzmP4Yrxu4xTVDZ6ADwVjcYIsadMyZ GXdzdZwE7aTsveKjAzZc5zBf0u8Qv5o8zeiQcSwLD0qElsqIwnWp8gXTFBioNPYrqZVMkT +kA2bLNFVpKgVgmt6/1qvaZJCuiaNNvizUH2dc9FLXmROxr+k30eMOlTKdroV3/xdI/7tg Cuc6lq0UnfbDI+Wyly9xvn7yI6xsaiQSPiKbxTefwtWQEF5BhawYLJGhUrqBaEb7mFzsfQ KOC9BkItMo1Pl+3JydOQqVyGi9m8KsTJ3ptrfSJoevF5Le1svF4y41jcxVJZVQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764729509; a=rsa-sha256; cv=none; b=yRxu8xpzMkKMqXn+a3E3rcDqwa/7YaM26MH+WalX0zI9eH5N/0AF3s/F9H2QaNHxcE8U/B q7wih2VulAlh0U1caW2tucrI9U377CJ1qY3MyOv/Kj/9/yNnBwUcznnP7eEYAQEGDkchgY 1t9Cc8IPQ1M2OCQ08Up1K3jyU6rObJ9wZRxQIqfbib+KROu5JU5w8EBImvB7/xZDjnr5Z/ GxwOgaNYQbd9STvwHfxV89AcwbEVQHjByewUoszpkVKtm0ZjvmFFjYZchxpTAk0MfCnOWh cGSP9bG+kpBsDC/lbSPA+3PbUF4w9RwrbpEPx/LjJ69HTj9wdq4mhJ+b7rlRAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dLhdx3djtz3qC for ; Wed, 03 Dec 2025 02:38:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2f86a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 03 Dec 2025 02:38:29 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 1869d604e22d - stable/14 - strfmon: Fix negative sign handling for C locale List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1869d604e22d88c8c7487cd8a547de42847a40be Auto-Submitted: auto-generated Date: Wed, 03 Dec 2025 02:38:29 +0000 Message-Id: <692fa2a5.2f86a.6c439f47@gitrepo.freebsd.org> The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=1869d604e22d88c8c7487cd8a547de42847a40be commit 1869d604e22d88c8c7487cd8a547de42847a40be Author: Jose Luis Duran AuthorDate: 2025-11-26 20:34:56 +0000 Commit: Jose Luis Duran CommitDate: 2025-12-03 02:34:33 +0000 strfmon: Fix negative sign handling for C locale If the locale's positive_sign and negative_sign values would both be returned by localeconv() as empty strings, strfmon() shall behave as if the negative_sign value was the string "-". This occurs with the C locale. The implementation previously assigned "0" to sign_posn (parentheses around the entire string); now it assigns it to "1" (sign before the string) when it is undefined (CHAR_MAX). Austin Group Defect 1199[1] is applied, changing the requirements for the '+' and '(' flags. [1]: https://www.austingroupbugs.net/view.php?id=1199 Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53913 (cherry picked from commit cf85e7034ad5640b18a3b68d6b291b7bf89bfc80) --- lib/libc/stdlib/strfmon.c | 2 +- lib/libc/tests/stdlib/strfmon_test.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/libc/stdlib/strfmon.c b/lib/libc/stdlib/strfmon.c index b19d9fc43369..611ac45b9c82 100644 --- a/lib/libc/stdlib/strfmon.c +++ b/lib/libc/stdlib/strfmon.c @@ -457,7 +457,7 @@ __setup_vars(int flags, char *cs_precedes, char *sep_by_space, char *sign_posn, if (*sep_by_space == CHAR_MAX) *sep_by_space = 0; if (*sign_posn == CHAR_MAX) - *sign_posn = 0; + *sign_posn = 1; } static int diff --git a/lib/libc/tests/stdlib/strfmon_test.c b/lib/libc/tests/stdlib/strfmon_test.c index 165ddcc2ab56..c6c20bd26985 100644 --- a/lib/libc/tests/stdlib/strfmon_test.c +++ b/lib/libc/tests/stdlib/strfmon_test.c @@ -205,8 +205,8 @@ ATF_TC_BODY(strfmon_plus_or_parenthesis, tc) { "%(i", "C", "[123.45] [(123.45)]" }, { "%(n", "en_US.UTF-8", "[$123.45] [($123.45)]" }, { "%(i", "en_US.UTF-8", "[USD123.45] [(USD123.45)]" }, - { "%n", "C", "[123.45] [(123.45)]" }, /* XXX */ - { "%i", "C", "[123.45] [(123.45)]" }, /* XXX */ + { "%n", "C", "[123.45] [-123.45]" }, + { "%i", "C", "[123.45] [-123.45]" }, { "%n", "en_US.UTF-8", "[$123.45] [-$123.45]" }, { "%i", "en_US.UTF-8", "[USD123.45] [-USD123.45]" }, }; @@ -253,7 +253,7 @@ ATF_TC_BODY(strfmon_l, tc) const char *locale; const char *expected; } tests[] = { - { "C", "[ **1234.57 ] [ **1234.57 ]" }, /* XXX */ + { "C", "[ **1234.57] [ **1234.57]" }, { "de_DE.UTF-8", "[ **1234,57 €] [ **1.234,57 EUR]" }, { "en_GB.UTF-8", "[ £**1234.57] [ GBP**1,234.57]" }, }; From nobody Wed Dec 3 02:38:51 2025 X-Original-To: dev-commits-src-branches@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 4dLhfM6c0kz6Jfnl for ; Wed, 03 Dec 2025 02:38:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dLhfM5Nzgz3tJL for ; Wed, 03 Dec 2025 02:38:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764729531; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bwvpmyA6Qs7MUHyVjKxu5Fw2T7Y+2OIn/sItq7+hQ+Y=; b=UoYVTl54hScZe1r6soWZ9JGgOB7TqKJMFSLa0eiI0e5Heayw/glukm2ciMTjwcfOTe1vIb qjH2hoL9iCNYHbTN+0GUlI0c6f2aEN5OV6fnJvC5JoM4S1sG9edi48NWBub/bW01yPJ9xN +9A9BQqmEcyMM0R1s3qUrELsWi7zMcYV4y6Vt0YZuN3WhqWTzaswgH1ILik+zDjA2ywOUE HzwbKSRNPSt2AYMYkFEkI3s7k+6JXilHtA8qnkBlmGZ21D5+1vn9WE99oS+IkENo5znz08 +HYISoxhNSjDsrMO6XNdC8ZNzQwwbywPMlpskXmh7CIueTV/2Vbr9+WfThD7Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764729531; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bwvpmyA6Qs7MUHyVjKxu5Fw2T7Y+2OIn/sItq7+hQ+Y=; b=Dg9Qbe3KMHvVwyCr58LQIxrdm4ga6Z8+pYcRf9Q79QNuljBM/hk57zI5JTuMq6oZFJEKwL FfobQ002A0Zn/kZqc6IYyMHDa59rygjKQJpFpYTSVre2ndzkyEMwEUuCgJHAmDZKB6tF6/ vTTntNoMCoMZOeEk1fak5HcetGriIRTjD882LqPZvoDMxZxzxn8Rmh8ixSpCd36LxE9N3d 7OMW8N6sENbyPJ7wfyLMzjAekIKH3C9ttJs1sk+2s2cFlulVp8XRO6NVUMpmFZ5KmrC+rf sRvi1jAfDk9zdfECzLVtzGJ/W1qKsstwD+XlBGgvveIN1HFxCfQkLAQnFSEq5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764729531; a=rsa-sha256; cv=none; b=oEUAeEoMH/QNegb730LnuyEXpZJnegl3ENkW8uiaeBdIs9QgtIDdTfvqp3HP2js/zHsAL5 c/yZ6UeCJvILAynEjDZvPeesnJS2eTt2o0ilX4d/WVsJuCuf/JOacTuy68/ASsZBgkSGum 2hgPnU0MTvWayRuCQpkAdKaTXsYLgMqj4LpYzKR0mWLjhpA5ldTx+y72H67klUjuyTkAzh fJ+d+MT+ajl4u9HF9UzxtoPawCihvbpt3hDYhichEYrcLm9Fq2pB1fK5iA3fBdWwTHpXcZ aKlzODVnFrusaOUzlmH8JGS/p1iWWqf7sG6a71nLo+h4PvtzvKqlISBcwXKYmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dLhfM4x4Pz39C for ; Wed, 03 Dec 2025 02:38:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 30892 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 03 Dec 2025 02:38:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 33189f868ab9 - stable/13 - strfmon: Add tests for Austin Group Defect 1199 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 33189f868ab9d2c672413916b6510c856db3dd4c Auto-Submitted: auto-generated Date: Wed, 03 Dec 2025 02:38:51 +0000 Message-Id: <692fa2bb.30892.22fe3109@gitrepo.freebsd.org> The branch stable/13 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=33189f868ab9d2c672413916b6510c856db3dd4c commit 33189f868ab9d2c672413916b6510c856db3dd4c Author: Jose Luis Duran AuthorDate: 2025-11-26 20:34:55 +0000 Commit: Jose Luis Duran CommitDate: 2025-12-03 02:35:23 +0000 strfmon: Add tests for Austin Group Defect 1199 Add tests for The Open Group Base Specifications Issue 8[1], Austin Group Defect 1199[2]. Items marked with XXX represent an invalid output. These items will be fixed in subsequent commits. Notice that an existing test is now considered invalid. Our locale definitions do not include int_p_sep_by_space nor int_n_sep_by_space[3]. Those will be addressed in a subsequent commit. However, the CLDR project defines them as "0", which causes the output to appear as "USD123.45". If our locale definitions were to set the international {n,p}_sep_by_space to "1", the output would display as the expected "USD 123.45". While here, use the SPDX license identifier and add my name to the file. [1]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/strfmon.html [2]: https://www.austingroupbugs.net/view.php?id=1199 [3]: https://unicode-org.atlassian.net/browse/CLDR-237 Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53911 (cherry picked from commit 19e153004fb63c32eba0ef40249f5ede61a93170) --- lib/libc/tests/stdlib/strfmon_test.c | 80 +++++++++++++++++++++++++----------- 1 file changed, 57 insertions(+), 23 deletions(-) diff --git a/lib/libc/tests/stdlib/strfmon_test.c b/lib/libc/tests/stdlib/strfmon_test.c index f092c071724a..0126c2f3f8a8 100644 --- a/lib/libc/tests/stdlib/strfmon_test.c +++ b/lib/libc/tests/stdlib/strfmon_test.c @@ -1,32 +1,15 @@ -/*- - * Copyright (C) 2018 Conrad Meyer +/* + * Copyright (c) 2018 Conrad Meyer * All rights reserved. + * Copyright (c) 2022-2025 Jose Luis Duran * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * SPDX-License-Identifier: BSD-2-Clause */ #include #include +#include #include #include #include @@ -209,6 +192,56 @@ ATF_TC_BODY(strfmon_international_currency_code, tc) } } +ATF_TC_WITHOUT_HEAD(strfmon_plus_or_parenthesis); +ATF_TC_BODY(strfmon_plus_or_parenthesis, tc) +{ + const struct { + const char *format; + const char *locale; + const char *expected; + } tests[] = { + { "%+n", "en_US.UTF-8", "[$123.45] [-$123.45]" }, + { "%+i", "en_US.UTF-8", "[USD123.45] [-USD123.45]" }, + { "%(n", "C", "[123.45] [(123.45)]" }, + { "%(i", "C", "[123.45] [(123.45)]" }, + { "%(n", "en_US.UTF-8", "[$123.45] [($123.45)]" }, + { "%(i", "en_US.UTF-8", "[USD123.45] [(USD123.45)]" }, + { "%n", "C", "[123.45] [(123.45)]" }, /* XXX */ + { "%i", "C", "[123.45] [(123.45)]" }, /* XXX */ + { "%n", "en_US.UTF-8", "[$123.45] [-$123.45]" }, + { "%i", "en_US.UTF-8", "[USD123.45] [-USD123.45]" }, + }; + size_t i; + char actual[100], format[50]; + + for (i = 0; i < nitems(tests); ++i) { + if (setlocale(LC_MONETARY, tests[i].locale) == NULL) + atf_tc_skip("unable to setlocale(): %s", + tests[i].locale); + + snprintf(format, sizeof(format), "[%s] [%s]", + tests[i].format, tests[i].format); + strfmon(actual, sizeof(actual) - 1, format, + 123.45, -123.45); + ATF_CHECK_STREQ_MSG(tests[i].expected, actual, + "[%s] %s", tests[i].format, tests[i].locale); + } + + /* + * The '+' flag was included in a conversion specification and + * the locale's positive_sign and negative_sign values would + * both be returned by localeconv() as empty strings. + */ + if (setlocale(LC_MONETARY, "C") == NULL) + atf_tc_skip("unable to setlocale(): %s", tests[i].locale); + + /* ATF_CHECK_ERRNO(EINVAL, strfmon(actual, sizeof(actual) - 1, + "[%+n] [%+n]", 123.45, -123.45)); XXX */ + + /* ATF_CHECK_ERRNO(EINVAL, strfmon(actual, sizeof(actual) - 1, + "[%+i] [%+i]", 123.45, -123.45)); XXX */ +} + ATF_TC(strfmon_l); ATF_TC_HEAD(strfmon_l, tc) { @@ -221,7 +254,7 @@ ATF_TC_BODY(strfmon_l, tc) const char *locale; const char *expected; } tests[] = { - { "C", "[ **1234.57 ] [ **1234.57 ]" }, + { "C", "[ **1234.57 ] [ **1234.57 ]" }, /* XXX */ { "de_DE.UTF-8", "[ **1234,57 €] [ **1.234,57 EUR]" }, { "en_GB.UTF-8", "[ £**1234.57] [ GBP**1,234.57]" }, }; @@ -248,6 +281,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, strfmon_cs_precedes_0); ATF_TP_ADD_TC(tp, strfmon_cs_precedes_1); ATF_TP_ADD_TC(tp, strfmon_international_currency_code); + ATF_TP_ADD_TC(tp, strfmon_plus_or_parenthesis); ATF_TP_ADD_TC(tp, strfmon_l); return (atf_no_error()); } From nobody Wed Dec 3 02:38:50 2025 X-Original-To: dev-commits-src-branches@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 4dLhfL6mzPz6JfcP for ; Wed, 03 Dec 2025 02:38:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dLhfL4mC1z3t7n for ; Wed, 03 Dec 2025 02:38:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764729530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BR3ZEbI0nb/nH0bAPpW0TgsHtCLG/+x+LyQuGXhYk5c=; b=WNSfZKAdHrXoLN9JfN1jnKUas+DcJkWGUgJIcDOLTnLa/Dcq0VberchRqOmTJcPdfzCVAX 4xvH+0FBJ+2V1PgoSll5cDw975V2hjGlgcVVfIe2J1iOTK0ClhMtSgnXyD/8N4b7nHVNXK swawPPYYZjwxOj8hjrEQpyrzlmTkyj3DX89K6UCouTqn3wAbPOZuQRkU6yx/ukP33CE69g cX/abzNzy09fDqTavjjqY4E1AE0cccdHCW3PttePBNhrLsxE2RzqwWU6Pmm/clryAg0zqW squwjPHzkQOltZHNHUbrqhwktVm8+xLA6GW1HS5xh0B0SPEis9wShuJLjfLwpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764729530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BR3ZEbI0nb/nH0bAPpW0TgsHtCLG/+x+LyQuGXhYk5c=; b=IEzxdwhiymzqyIFHLADCTwFB2EHpKo/hQomqkTqUgu4ibNGuP1hcpfZeUUg4hGEqV7jf0S L1IYtp8zVQIqa0M1ccIgvh5andK0UZ7f8Sq1dzRCLyTQMfe9x4QmjFDnlRiU0r/eL6NQzZ 4rdAzAfgC77LYHIvp9oxgLXTeN04uTIzuc+Ly05qDHeOoVdXK5tQP4Vn5MkV/9ftZpUtfo TpDUKs++HMWTCmVGjm0InLZ9xRxulM0cvT0piYMGm02trE//v1C1Iwf+cQ0SePCH9ryBR+ zQS62nmJxYvIt1EA780k+cha3BajgTyDHJhx5/MomQ/qjco7943M8nG7B+YBhg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764729530; a=rsa-sha256; cv=none; b=N3By3/RoHEDcdrEy7PK47aAEusA5/Gty1J2OWCC4Jj8mUxWdGTefJ5DlWFESfw/fWP0Kpi GRpRvvTUT/KT3UNtDL/VScMGSOEaF6sgRbES1ZRyCvJaqoVd+jgTSOKY5bDg0gquHlifWo mSSlbiXdabW8QeENrNv/MTiRdw6XaUqnFCGnnFU5jIsH9w7XP4iNydxZHGao/wnIHjkf8J TCE0bMd/rglEwmRtlX0a7BkG7jLK1GdQcmMK6t+E1Wx8pRGeYKLi81AMFD1amGI62ncLi/ i+f8lFrcCWy0XmYdPdYrKvYbEwRD4SAD5I4ZlPMOK//YouC+POovU7H6w4Z7bA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dLhfL4HPfz3qD for ; Wed, 03 Dec 2025 02:38:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2ffc0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 03 Dec 2025 02:38:50 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 6cccf4db1346 - stable/13 - strfmon: Fix typo s/poistion/position/ List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6cccf4db1346d64dcd8b2247e8d597e220dadf02 Auto-Submitted: auto-generated Date: Wed, 03 Dec 2025 02:38:50 +0000 Message-Id: <692fa2ba.2ffc0.3d28fb13@gitrepo.freebsd.org> The branch stable/13 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=6cccf4db1346d64dcd8b2247e8d597e220dadf02 commit 6cccf4db1346d64dcd8b2247e8d597e220dadf02 Author: Jose Luis Duran AuthorDate: 2025-11-23 16:58:55 +0000 Commit: Jose Luis Duran CommitDate: 2025-12-03 02:35:07 +0000 strfmon: Fix typo s/poistion/position/ MFC after: 1 week (cherry picked from commit 91e7f19ec4056587a85c1461a4f34a6d5d4b7b52) --- lib/libc/stdlib/strfmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/stdlib/strfmon.c b/lib/libc/stdlib/strfmon.c index d3efc9080c09..caccbdb476b0 100644 --- a/lib/libc/stdlib/strfmon.c +++ b/lib/libc/stdlib/strfmon.c @@ -107,7 +107,7 @@ vstrfmon_l(char *__restrict s, size_t maxsize, locale_t loc, const char *__restrict format, va_list ap) { char *dst; /* output destination pointer */ - const char *fmt; /* current format poistion pointer */ + const char *fmt; /* current format position pointer */ struct lconv *lc; /* pointer to lconv structure */ char *asciivalue; /* formatted double pointer */ From nobody Wed Dec 3 02:38:52 2025 X-Original-To: dev-commits-src-branches@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 4dLhfP0yNzz6Jfnq for ; Wed, 03 Dec 2025 02:38:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dLhfN60S9z3tJW for ; Wed, 03 Dec 2025 02:38:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764729532; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3J0KJ1nLDC2TgHqKWy+6VWD830JorenojGy9gvhw3VE=; b=x671wWvqeWy2/DJDr03/FfkwYppqlVHlUnDhG9g+ZMNnC2/nZdSMTXtU1Fz1rGoJqffmRa LMMC15R/R+CFsHXp7K61JHTmGT8SDsmeJ/CGNB4E05mF3Blv5KrEtPHXPF9Smm8Du06gnP 5swK8d4Mr0KXxVVYhHqZoImmI14qdQjmSPqndNeo8Tk3+r3ceFV8xtHwrEbBY3JOn1hm8d FedTa8vftS5h9a5KKXZEFCihjZVDoqtQiLau0mKuiiNkXSATxTM3+Uk/ASVeSCMfvRv+VD IkkXSQLLu5kl4UtARYZn9wOf3SbXWhCqJAhFx5Lv3q/yoIox2d6BnFbWimov5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764729532; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3J0KJ1nLDC2TgHqKWy+6VWD830JorenojGy9gvhw3VE=; b=orqbNkSbkE4nd7WpSV6elvBWYXtaD3YvlTWPVw+ncf7tWRuXGyA3MDrwV1d6IwkSwpWDq2 bPlTQjZLo3hFC07/nkc1N48kGhvBVTcMRVyzcEk/sWz1oHr2HHreCDu0o1WhY24t+/I0DW b/mBOnzlePo9wa2SsGHYxmOQSf1A9evAnb3klD0ilmuxvA7JmOn4YwiMeFD7JMBPByK6sg CDALgN7x8Qb0Of73CKJsF5HX0P6STEMeXahzM22FqD+3QDMEslseApQEvywY2YubIy/VXF O/5QvknTH78lap56kTwsE1SIRce5jkFO+BVFUFjZIcBZwwZMPtKy4wdiFVrzrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764729532; a=rsa-sha256; cv=none; b=Y8/B59Ct89FIEH5o1yrLpPx9KtFtcNWACEgqbQvTvC58zV4U7xFKLZJg/WzMXvKv5qdRQb EUeaW2dIalKWbaL7bXPGPX35F6sa/Exc6yxR5IruZrHcBIhhy9IzEsRM1k5r/49izA6t8Y EwSmz7EeVjShU19gWCwLpPM69dWqwzEQbR3Sok4T3VgmTfEVdGkcNBD2ICI3oUZDOCHCoK inkoNPnJ668SJOodKTbWSRLeya0Hw6ErHsEA2TJ9Nnj6O/2nJAQ0tR5ywznqsU9smoqpbk va2cZ96cTGV3EAcMO/i2Mt9X640/hh1c3k2ZUElzzJh+OKbWZ/ifi+2WiOt+/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dLhfN5Ylmz3Mq for ; Wed, 03 Dec 2025 02:38:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 307a5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 03 Dec 2025 02:38:52 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 6b0e99570fa2 - stable/13 - strfmon: EINVAL if the '+' flag and both signs are empty List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6b0e99570fa208cc299c047591b7ded7b1b9a58d Auto-Submitted: auto-generated Date: Wed, 03 Dec 2025 02:38:52 +0000 Message-Id: <692fa2bc.307a5.3aab421@gitrepo.freebsd.org> The branch stable/13 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=6b0e99570fa208cc299c047591b7ded7b1b9a58d commit 6b0e99570fa208cc299c047591b7ded7b1b9a58d Author: Jose Luis Duran AuthorDate: 2025-11-26 20:34:55 +0000 Commit: Jose Luis Duran CommitDate: 2025-12-03 02:35:42 +0000 strfmon: EINVAL if the '+' flag and both signs are empty According to the Open Group Base Specifications Issue 8[1], strfmon(3) should return EINVAL when the '+' flag was included in a conversion specification and the locale's positive_sign and negative_sign values would both be returned by localeconv(3) as empty strings. Austin Group Defect 1199[2] is applied, adding the [EINVAL] error. [1]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/strfmon.html [2]: https://www.austingroupbugs.net/view.php?id=1199 Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53912 (cherry picked from commit 1fd018972a18b682521bb8f004dfd162327e5db2) --- lib/libc/stdlib/strfmon.3 | 12 +++++++++++- lib/libc/stdlib/strfmon.c | 4 +++- lib/libc/tests/stdlib/strfmon_test.c | 8 ++++---- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/lib/libc/stdlib/strfmon.3 b/lib/libc/stdlib/strfmon.3 index 20cc560d401d..d537d9d05fa7 100644 --- a/lib/libc/stdlib/strfmon.3 +++ b/lib/libc/stdlib/strfmon.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 6, 2023 +.Dd November 24, 2025 .Dt STRFMON 3 .Os .Sh NAME @@ -182,6 +182,16 @@ function will fail if: Conversion stopped due to lack of space in the buffer. .It Bq Er EINVAL The format string is invalid. +.It Bq Er EINVAL +The +.Cm + +flag was included in a conversion specification and the locale's +.Va positive_sign +and +.Va negative_sign +values would both be returned by +.Xr localeconv 3 +as empty strings. .It Bq Er ENOMEM Not enough memory for temporary buffers. .El diff --git a/lib/libc/stdlib/strfmon.c b/lib/libc/stdlib/strfmon.c index caccbdb476b0..2dfc7d99510e 100644 --- a/lib/libc/stdlib/strfmon.c +++ b/lib/libc/stdlib/strfmon.c @@ -172,7 +172,9 @@ literal: flags &= ~(NEED_GROUPING); continue; case '+': /* use locale defined signs */ - if (flags & SIGN_POSN_USED) + if ((flags & SIGN_POSN_USED) || + ((lc->positive_sign[0] == '\0') && + (lc->negative_sign[0] == '\0'))) goto format_error; flags |= (SIGN_POSN_USED | LOCALE_POSN); continue; diff --git a/lib/libc/tests/stdlib/strfmon_test.c b/lib/libc/tests/stdlib/strfmon_test.c index 0126c2f3f8a8..7fc0afc9e229 100644 --- a/lib/libc/tests/stdlib/strfmon_test.c +++ b/lib/libc/tests/stdlib/strfmon_test.c @@ -235,11 +235,11 @@ ATF_TC_BODY(strfmon_plus_or_parenthesis, tc) if (setlocale(LC_MONETARY, "C") == NULL) atf_tc_skip("unable to setlocale(): %s", tests[i].locale); - /* ATF_CHECK_ERRNO(EINVAL, strfmon(actual, sizeof(actual) - 1, - "[%+n] [%+n]", 123.45, -123.45)); XXX */ + ATF_CHECK_ERRNO(EINVAL, strfmon(actual, sizeof(actual) - 1, + "[%+n] [%+n]", 123.45, -123.45)); - /* ATF_CHECK_ERRNO(EINVAL, strfmon(actual, sizeof(actual) - 1, - "[%+i] [%+i]", 123.45, -123.45)); XXX */ + ATF_CHECK_ERRNO(EINVAL, strfmon(actual, sizeof(actual) - 1, + "[%+i] [%+i]", 123.45, -123.45)); } ATF_TC(strfmon_l); From nobody Wed Dec 3 02:38:53 2025 X-Original-To: dev-commits-src-branches@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 4dLhfQ3ZZ0z6JfqR for ; Wed, 03 Dec 2025 02:38:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dLhfQ0Bfqz3tP9 for ; Wed, 03 Dec 2025 02:38:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764729534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vRvDgoP4nJVK4UqUGidNDF/2O6RAKzVX+XfilbDg/EM=; b=mSrerb/SQhMPXa6e5S1yqfdoYFqyBAl2huI4t5TMj0J9DfgeZGTp3s4OlXQZwIPKDpHthA gfoPot020boLGWgrMeQZ6JBm69AubeKpsq5eMAGTCV4rZc9S91+WihNvmiOpIsutemkWUu btFzbJOe3azI+Br23CfmWsSkZ7hRatw1gnb7V4El8jSiOXLUHUN9o8hHBr3qmi6z5qj7Bg q3DGFv9XVDTbcqQVvbi8/eahYR6fCdrtHhan9DR7cEWv93SvoJyJ11WVXUWr9SjvM+0mRD L9wO4hGxaCfbTmdWtxBS8PPv/Vp+wJx2vko8cJXu2A3aGTxi4ogC6ueMtbE00g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764729534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vRvDgoP4nJVK4UqUGidNDF/2O6RAKzVX+XfilbDg/EM=; b=KY6MGSpsmR9Me7fLHN1vPAcebKevTDPHffKWR/ufLQ7FHBwhKxl1PDEcAXPs5yjzpcsno1 oxFypa5coxyFj7SyAlCmAGggG8sqizd7XNQ6rsbuJzNUeCwjcFTBcS58lD5NGHvr73XD8r Us5JgSelauhT9Y0f3OO4IwGs3B32PQJzULUdxg3S33PTwf/bs0E8qzMDN3V4zuDJDfTSOx Fu/RhRvpEpdxL24PKOjTzdzH6btInAq69Nbmo3O3cOUCNDwyUHnhxQ95aEio2A+rt3B/UQ p+xxoIgyiK3iTJu8OKZ6+8M/cOPIGBbGtvz9wE8W11f8yhtBFJORUyEMjlsK6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764729534; a=rsa-sha256; cv=none; b=u8/OSG9vw/QBx27n7u356qs4IYTFu2JvZ837Dl/2ejgxPhBGKSS2Q+kXlZugdokQfhgi59 E9ZAMuU/f71h8GkFTIE8brdBghXX0euEx0522xVnsGSz5SLI6S+A5YjQNC0iBjfPgHpr90 PQ7F1IKxoURTdK6slvUYHdYfkOAyoedGxNvEwM35SoQvuqZGP+r4d/XF0ECvOI9lS3kVUV FtnCljAQGpR+udmFo1SHjCmbX8CEQZg6ZKV+9xZjuSnje0dbQtguKzAAAkwQy6hBuKweaS ZZYXDngXCz3JyYQEl146xwh09gMp8+4Wpei80Q5jtaGa8Ectlr167pL+4DRzTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dLhfP6LHBz3QK for ; Wed, 03 Dec 2025 02:38:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2f86e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 03 Dec 2025 02:38:53 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 02a810d9b4cc - stable/13 - strfmon: Fix negative sign handling for C locale List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 02a810d9b4cc8b3cd30d7e6bfe01b5e3c68ee492 Auto-Submitted: auto-generated Date: Wed, 03 Dec 2025 02:38:53 +0000 Message-Id: <692fa2bd.2f86e.32b7985b@gitrepo.freebsd.org> The branch stable/13 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=02a810d9b4cc8b3cd30d7e6bfe01b5e3c68ee492 commit 02a810d9b4cc8b3cd30d7e6bfe01b5e3c68ee492 Author: Jose Luis Duran AuthorDate: 2025-11-26 20:34:56 +0000 Commit: Jose Luis Duran CommitDate: 2025-12-03 02:35:56 +0000 strfmon: Fix negative sign handling for C locale If the locale's positive_sign and negative_sign values would both be returned by localeconv() as empty strings, strfmon() shall behave as if the negative_sign value was the string "-". This occurs with the C locale. The implementation previously assigned "0" to sign_posn (parentheses around the entire string); now it assigns it to "1" (sign before the string) when it is undefined (CHAR_MAX). Austin Group Defect 1199[1] is applied, changing the requirements for the '+' and '(' flags. [1]: https://www.austingroupbugs.net/view.php?id=1199 Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53913 (cherry picked from commit cf85e7034ad5640b18a3b68d6b291b7bf89bfc80) --- lib/libc/stdlib/strfmon.c | 2 +- lib/libc/tests/stdlib/strfmon_test.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/libc/stdlib/strfmon.c b/lib/libc/stdlib/strfmon.c index 2dfc7d99510e..7a4e1093fc4d 100644 --- a/lib/libc/stdlib/strfmon.c +++ b/lib/libc/stdlib/strfmon.c @@ -458,7 +458,7 @@ __setup_vars(int flags, char *cs_precedes, char *sep_by_space, char *sign_posn, if (*sep_by_space == CHAR_MAX) *sep_by_space = 0; if (*sign_posn == CHAR_MAX) - *sign_posn = 0; + *sign_posn = 1; } static int diff --git a/lib/libc/tests/stdlib/strfmon_test.c b/lib/libc/tests/stdlib/strfmon_test.c index 7fc0afc9e229..a112fbf65c1d 100644 --- a/lib/libc/tests/stdlib/strfmon_test.c +++ b/lib/libc/tests/stdlib/strfmon_test.c @@ -206,8 +206,8 @@ ATF_TC_BODY(strfmon_plus_or_parenthesis, tc) { "%(i", "C", "[123.45] [(123.45)]" }, { "%(n", "en_US.UTF-8", "[$123.45] [($123.45)]" }, { "%(i", "en_US.UTF-8", "[USD123.45] [(USD123.45)]" }, - { "%n", "C", "[123.45] [(123.45)]" }, /* XXX */ - { "%i", "C", "[123.45] [(123.45)]" }, /* XXX */ + { "%n", "C", "[123.45] [-123.45]" }, + { "%i", "C", "[123.45] [-123.45]" }, { "%n", "en_US.UTF-8", "[$123.45] [-$123.45]" }, { "%i", "en_US.UTF-8", "[USD123.45] [-USD123.45]" }, }; @@ -254,7 +254,7 @@ ATF_TC_BODY(strfmon_l, tc) const char *locale; const char *expected; } tests[] = { - { "C", "[ **1234.57 ] [ **1234.57 ]" }, /* XXX */ + { "C", "[ **1234.57] [ **1234.57]" }, { "de_DE.UTF-8", "[ **1234,57 €] [ **1.234,57 EUR]" }, { "en_GB.UTF-8", "[ £**1234.57] [ GBP**1,234.57]" }, }; From nobody Fri Dec 5 13:19:52 2025 X-Original-To: dev-commits-src-branches@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 4dNBn56pJsz6HntJ for ; Fri, 05 Dec 2025 13:19:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dNBn51PDfz3Z7K for ; Fri, 05 Dec 2025 13:19:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764940793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=De2A6fvojwrnPcYu48OdtrjDfLrPynFqROMw5jfMPlE=; b=oFk0Ey/qm/7p5HMcSAQuh/0102qDZ3nMMo9N5nusEQx/DsW0PTP5KDSzbJiSxxwQghkkbA dNKNXOhdPARPpzCy7d0afIEUPbNZl77+yWYM2DWrzHOQmjqmWdiSwQMjmln0GkizFwx+n8 p7cW7a2fh61aYPDCkPeXkdr4Q0qarBSSuC0adCQVO+k+D5m/oBcKNbpT0w8597V8oLUo/s r1FFOMN04KYels2IU0rixKnW21MIblFBBgF4YESE57r5/F0yTsiTLmSxYFuR2F4dwWBa3Z DAcHKT+Gx9fSfAYtG69N1YrtUk0XGOnMwzd+LYBJbSemEaZJqsR2zaM7FOTW8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764940793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=De2A6fvojwrnPcYu48OdtrjDfLrPynFqROMw5jfMPlE=; b=c/PyNHKWjo2IUIn8qbOEZHO1/wiD45o8RN9ZU9SVMr4fmmoB4/V1Fd1z+KhC2vJSNSgYE1 v2AZKAMcnTQp8IoxrLu8EXzykZDBTljTU0l0wWHIuwHRoUqrIxD6n0PWGRzM4YNlldP7do VOyrASB21ex44ojYfmwam1jDvNBurD6cX+pn8QIkFwkMO0ykTDt0MyNHK3PxI80xt4ORsj +xRzJtxle4FkeSrpYM50z6TTKzhcLcvmt6Qhd5le/JK4oOgwZPrVyYIQsjfspGbY5Kn4qt stLXs8qzveocrdJBLVN1LNv/OB7/0mxzkzeZCfTrwiJ2BCU8TDQOC2ICFR5IXw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764940793; a=rsa-sha256; cv=none; b=sZq9vLZKZS2ErYiELRiTK6qFDbHuSAl0GEEcllh5zYEx9ooX9Igi1sUXpvd8hdCk+LDFtN mAvqmY97G+wV2wfjatYW3Ne1P0rzouo6ttWccMQkiTm89O11dCaKPUX+5FvOgNVG+tC/Pu 1xFMiCN8lLct8zEd92poj3QLaPHXzFxJOU8Q78yuGgV0tig4TUjfYTaMhf0Nqy+lRF8p+/ IDNn9FJHj0kkR2L2L7bhQhnbtuH201UFi2mLR/IlRwsTXGO8NeSF3OCXsoshz0czzH8SdH RUcBjs6RPUd94nEbcn1CGTYZtTHF8vB7TGWFyiV9HdLGUMZqySomVH1PkBDdPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dNBn50dX9z1B31 for ; Fri, 05 Dec 2025 13:19:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 262f1 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 05 Dec 2025 13:19:52 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: e37206a66db0 - stable/15 - sqlite3: Update to 3.50.4 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: e37206a66db0bc359901435ecc09726fc6fe701d Auto-Submitted: auto-generated Date: Fri, 05 Dec 2025 13:19:52 +0000 Message-Id: <6932dbf8.262f1.50dd6d46@gitrepo.freebsd.org> The branch stable/15 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=e37206a66db0bc359901435ecc09726fc6fe701d commit e37206a66db0bc359901435ecc09726fc6fe701d Author: Cy Schubert AuthorDate: 2025-12-02 15:22:26 +0000 Commit: Cy Schubert CommitDate: 2025-12-05 13:19:36 +0000 sqlite3: Update to 3.50.4 Release notes at https://www.sqlite.org/releaselog/3_50_4.html. Obtained from: https://www.sqlite.org/2025/sqlite-autoconf-3500400.tar.gz Merge commit 'e7e917ee3cf2b3010b1c511c6ebaf8b65b983ad7' (cherry picked from commit 07d5a9b1b2dd95d95137c6c2afcb84ad40c05b75) --- contrib/sqlite3/VERSION | 2 +- contrib/sqlite3/sqlite3.c | 203 +++++++++++++++++++++++++----------------- contrib/sqlite3/sqlite3.h | 90 +++++++++---------- contrib/sqlite3/sqlite3.pc.in | 2 +- contrib/sqlite3/sqlite3rc.h | 2 +- 5 files changed, 170 insertions(+), 129 deletions(-) diff --git a/contrib/sqlite3/VERSION b/contrib/sqlite3/VERSION index 18d0478a0414..acecb4fcb7aa 100644 --- a/contrib/sqlite3/VERSION +++ b/contrib/sqlite3/VERSION @@ -1 +1 @@ -3.50.2 +3.50.4 diff --git a/contrib/sqlite3/sqlite3.c b/contrib/sqlite3/sqlite3.c index 0b071b2b6cc2..26a7a43d8658 100644 --- a/contrib/sqlite3/sqlite3.c +++ b/contrib/sqlite3/sqlite3.c @@ -1,6 +1,6 @@ /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.50.2. By combining all the individual C code files into this +** version 3.50.4. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -18,7 +18,7 @@ ** separate file. This file contains only code for the core SQLite library. ** ** The content in this amalgamation comes from Fossil check-in -** 2af157d77fb1304a74176eaee7fbc7c7e932 with changes in files: +** 4d8adfb30e03f9cf27f800a2c1ba3c48fb4c with changes in files: ** ** */ @@ -465,9 +465,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.50.2" -#define SQLITE_VERSION_NUMBER 3050002 -#define SQLITE_SOURCE_ID "2025-06-28 14:00:48 2af157d77fb1304a74176eaee7fbc7c7e932d946bf25325e9c26c91db19e3079" +#define SQLITE_VERSION "3.50.4" +#define SQLITE_VERSION_NUMBER 3050004 +#define SQLITE_SOURCE_ID "2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -9377,13 +9377,13 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** [[SQLITE_STMTSTATUS_SORT]]
SQLITE_STMTSTATUS_SORT
**
^This is the number of sort operations that have occurred. ** A non-zero value in this counter may indicate an opportunity to -** improvement performance through careful use of indices.
+** improve performance through careful use of indices. ** ** [[SQLITE_STMTSTATUS_AUTOINDEX]]
SQLITE_STMTSTATUS_AUTOINDEX
**
^This is the number of rows inserted into transient indices that ** were created automatically in order to help joins run faster. ** A non-zero value in this counter may indicate an opportunity to -** improvement performance by adding permanent indices that do not +** improve performance by adding permanent indices that do not ** need to be reinitialized each time the statement is run.
** ** [[SQLITE_STMTSTATUS_VM_STEP]]
SQLITE_STMTSTATUS_VM_STEP
@@ -9392,19 +9392,19 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** to 2147483647. The number of virtual machine operations can be ** used as a proxy for the total work done by the prepared statement. ** If the number of virtual machine operations exceeds 2147483647 -** then the value returned by this statement status code is undefined. +** then the value returned by this statement status code is undefined. ** ** [[SQLITE_STMTSTATUS_REPREPARE]]
SQLITE_STMTSTATUS_REPREPARE
**
^This is the number of times that the prepare statement has been ** automatically regenerated due to schema changes or changes to -** [bound parameters] that might affect the query plan. +** [bound parameters] that might affect the query plan.
** ** [[SQLITE_STMTSTATUS_RUN]]
SQLITE_STMTSTATUS_RUN
**
^This is the number of times that the prepared statement has ** been run. A single "run" for the purposes of this counter is one ** or more calls to [sqlite3_step()] followed by a call to [sqlite3_reset()]. ** The counter is incremented on the first [sqlite3_step()] call of each -** cycle. +** cycle.
** ** [[SQLITE_STMTSTATUS_FILTER_MISS]] ** [[SQLITE_STMTSTATUS_FILTER HIT]] @@ -9414,7 +9414,7 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** step was bypassed because a Bloom filter returned not-found. The ** corresponding SQLITE_STMTSTATUS_FILTER_MISS value is the number of ** times that the Bloom filter returned a find, and thus the join step -** had to be processed as normal. +** had to be processed as normal. ** ** [[SQLITE_STMTSTATUS_MEMUSED]]
SQLITE_STMTSTATUS_MEMUSED
**
^This is the approximate number of bytes of heap memory @@ -9519,9 +9519,9 @@ struct sqlite3_pcache_page { ** SQLite will typically create one cache instance for each open database file, ** though this is not guaranteed. ^The ** first parameter, szPage, is the size in bytes of the pages that must -** be allocated by the cache. ^szPage will always a power of two. ^The +** be allocated by the cache. ^szPage will always be a power of two. ^The ** second parameter szExtra is a number of bytes of extra storage -** associated with each page cache entry. ^The szExtra parameter will +** associated with each page cache entry. ^The szExtra parameter will be ** a number less than 250. SQLite will use the ** extra szExtra bytes on each page to store metadata about the underlying ** database page on disk. The value passed into szExtra depends @@ -9529,17 +9529,17 @@ struct sqlite3_pcache_page { ** ^The third argument to xCreate(), bPurgeable, is true if the cache being ** created will be used to cache database pages of a file stored on disk, or ** false if it is used for an in-memory database. The cache implementation -** does not have to do anything special based with the value of bPurgeable; +** does not have to do anything special based upon the value of bPurgeable; ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will ** never invoke xUnpin() except to deliberately delete a page. ** ^In other words, calls to xUnpin() on a cache with bPurgeable set to ** false will always have the "discard" flag set to true. -** ^Hence, a cache created with bPurgeable false will +** ^Hence, a cache created with bPurgeable set to false will ** never contain any unpinned pages. ** ** [[the xCachesize() page cache method]] ** ^(The xCachesize() method may be called at any time by SQLite to set the -** suggested maximum cache-size (number of pages stored by) the cache +** suggested maximum cache-size (number of pages stored) for the cache ** instance passed as the first argument. This is the value configured using ** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable ** parameter, the implementation is not required to do anything with this @@ -9566,12 +9566,12 @@ struct sqlite3_pcache_page { ** implementation must return a pointer to the page buffer with its content ** intact. If the requested page is not already in the cache, then the ** cache implementation should use the value of the createFlag -** parameter to help it determined what action to take: +** parameter to help it determine what action to take: ** ** **
createFlag Behavior when page is not already in cache **
0 Do not allocate a new page. Return NULL. -**
1 Allocate a new page if it easy and convenient to do so. +**
1 Allocate a new page if it is easy and convenient to do so. ** Otherwise return NULL. **
2 Make every effort to allocate a new page. Only return ** NULL if allocating a new page is effectively impossible. @@ -9588,7 +9588,7 @@ struct sqlite3_pcache_page { ** as its second argument. If the third parameter, discard, is non-zero, ** then the page must be evicted from the cache. ** ^If the discard parameter is -** zero, then the page may be discarded or retained at the discretion of +** zero, then the page may be discarded or retained at the discretion of the ** page cache implementation. ^The page cache implementation ** may choose to evict unpinned pages at any time. ** @@ -9606,7 +9606,7 @@ struct sqlite3_pcache_page { ** When SQLite calls the xTruncate() method, the cache must discard all ** existing cache entries with page numbers (keys) greater than or equal ** to the value of the iLimit parameter passed to xTruncate(). If any -** of these pages are pinned, they are implicitly unpinned, meaning that +** of these pages are pinned, they become implicitly unpinned, meaning that ** they can be safely discarded. ** ** [[the xDestroy() page cache method]] @@ -9905,7 +9905,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** application receives an SQLITE_LOCKED error, it may call the ** sqlite3_unlock_notify() method with the blocked connection handle as ** the first argument to register for a callback that will be invoked -** when the blocking connections current transaction is concluded. ^The +** when the blocking connection's current transaction is concluded. ^The ** callback is invoked from within the [sqlite3_step] or [sqlite3_close] ** call that concludes the blocking connection's transaction. ** @@ -9925,7 +9925,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** blocked connection already has a registered unlock-notify callback, ** then the new callback replaces the old.)^ ^If sqlite3_unlock_notify() is ** called with a NULL pointer as its second argument, then any existing -** unlock-notify callback is canceled. ^The blocked connections +** unlock-notify callback is canceled. ^The blocked connection's ** unlock-notify callback may also be canceled by closing the blocked ** connection using [sqlite3_close()]. ** @@ -10323,7 +10323,7 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...); ** support constraints. In this configuration (which is the default) if ** a call to the [xUpdate] method returns [SQLITE_CONSTRAINT], then the entire ** statement is rolled back as if [ON CONFLICT | OR ABORT] had been -** specified as part of the users SQL statement, regardless of the actual +** specified as part of the user's SQL statement, regardless of the actual ** ON CONFLICT mode specified. ** ** If X is non-zero, then the virtual table implementation guarantees @@ -10357,7 +10357,7 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...); ** [[SQLITE_VTAB_INNOCUOUS]]
SQLITE_VTAB_INNOCUOUS
**
Calls of the form ** [sqlite3_vtab_config](db,SQLITE_VTAB_INNOCUOUS) from within the -** the [xConnect] or [xCreate] methods of a [virtual table] implementation +** [xConnect] or [xCreate] methods of a [virtual table] implementation ** identify that virtual table as being safe to use from within triggers ** and views. Conceptually, the SQLITE_VTAB_INNOCUOUS tag means that the ** virtual table can do no serious harm even if it is controlled by a @@ -10525,7 +10525,7 @@ SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info*,int); **
** ** ^For the purposes of comparing virtual table output values to see if the -** values are same value for sorting purposes, two NULL values are considered +** values are the same value for sorting purposes, two NULL values are considered ** to be the same. In other words, the comparison operator is "IS" ** (or "IS NOT DISTINCT FROM") and not "==". ** @@ -10535,7 +10535,7 @@ SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info*,int); ** ** ^A virtual table implementation is always free to return rows in any order ** it wants, as long as the "orderByConsumed" flag is not set. ^When the -** the "orderByConsumed" flag is unset, the query planner will add extra +** "orderByConsumed" flag is unset, the query planner will add extra ** [bytecode] to ensure that the final results returned by the SQL query are ** ordered correctly. The use of the "orderByConsumed" flag and the ** sqlite3_vtab_distinct() interface is merely an optimization. ^Careful @@ -10632,7 +10632,7 @@ SQLITE_API int sqlite3_vtab_in(sqlite3_index_info*, int iCons, int bHandle); ** sqlite3_vtab_in_next(X,P) should be one of the parameters to the ** xFilter method which invokes these routines, and specifically ** a parameter that was previously selected for all-at-once IN constraint -** processing use the [sqlite3_vtab_in()] interface in the +** processing using the [sqlite3_vtab_in()] interface in the ** [xBestIndex|xBestIndex method]. ^(If the X parameter is not ** an xFilter argument that was selected for all-at-once IN constraint ** processing, then these routines return [SQLITE_ERROR].)^ @@ -10687,7 +10687,7 @@ SQLITE_API int sqlite3_vtab_in_next(sqlite3_value *pVal, sqlite3_value **ppOut); ** and only if *V is set to a value. ^The sqlite3_vtab_rhs_value(P,J,V) ** inteface returns SQLITE_NOTFOUND if the right-hand side of the J-th ** constraint is not available. ^The sqlite3_vtab_rhs_value() interface -** can return an result code other than SQLITE_OK or SQLITE_NOTFOUND if +** can return a result code other than SQLITE_OK or SQLITE_NOTFOUND if ** something goes wrong. ** ** The sqlite3_vtab_rhs_value() interface is usually only successful if @@ -10715,8 +10715,8 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** ** KEYWORDS: {conflict resolution mode} ** ** These constants are returned by [sqlite3_vtab_on_conflict()] to -** inform a [virtual table] implementation what the [ON CONFLICT] mode -** is for the SQL statement being evaluated. +** inform a [virtual table] implementation of the [ON CONFLICT] mode +** for the SQL statement being evaluated. ** ** Note that the [SQLITE_IGNORE] constant is also used as a potential ** return value from the [sqlite3_set_authorizer()] callback and that @@ -10756,39 +10756,39 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** ** [[SQLITE_SCANSTAT_EST]]
SQLITE_SCANSTAT_EST
**
^The "double" variable pointed to by the V parameter will be set to the ** query planner's estimate for the average number of rows output from each -** iteration of the X-th loop. If the query planner's estimates was accurate, +** iteration of the X-th loop. If the query planner's estimate was accurate, ** then this value will approximate the quotient NVISIT/NLOOP and the ** product of this value for all prior loops with the same SELECTID will -** be the NLOOP value for the current loop. +** be the NLOOP value for the current loop.
** ** [[SQLITE_SCANSTAT_NAME]]
SQLITE_SCANSTAT_NAME
**
^The "const char *" variable pointed to by the V parameter will be set ** to a zero-terminated UTF-8 string containing the name of the index or table -** used for the X-th loop. +** used for the X-th loop.
** ** [[SQLITE_SCANSTAT_EXPLAIN]]
SQLITE_SCANSTAT_EXPLAIN
**
^The "const char *" variable pointed to by the V parameter will be set ** to a zero-terminated UTF-8 string containing the [EXPLAIN QUERY PLAN] -** description for the X-th loop. +** description for the X-th loop.
** ** [[SQLITE_SCANSTAT_SELECTID]]
SQLITE_SCANSTAT_SELECTID
**
^The "int" variable pointed to by the V parameter will be set to the ** id for the X-th query plan element. The id value is unique within the ** statement. The select-id is the same value as is output in the first -** column of an [EXPLAIN QUERY PLAN] query. +** column of an [EXPLAIN QUERY PLAN] query.
** ** [[SQLITE_SCANSTAT_PARENTID]]
SQLITE_SCANSTAT_PARENTID
**
The "int" variable pointed to by the V parameter will be set to the -** the id of the parent of the current query element, if applicable, or +** id of the parent of the current query element, if applicable, or ** to zero if the query element has no parent. This is the same value as -** returned in the second column of an [EXPLAIN QUERY PLAN] query. +** returned in the second column of an [EXPLAIN QUERY PLAN] query.
** ** [[SQLITE_SCANSTAT_NCYCLE]]
SQLITE_SCANSTAT_NCYCLE
**
The sqlite3_int64 output value is set to the number of cycles, ** according to the processor time-stamp counter, that elapsed while the ** query element was being processed. This value is not available for ** all query elements - if it is unavailable the output variable is -** set to -1. +** set to -1.
** */ #define SQLITE_SCANSTAT_NLOOP 0 @@ -10829,8 +10829,8 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** ** sqlite3_stmt_scanstatus_v2() with a zeroed flags parameter. ** ** Parameter "idx" identifies the specific query element to retrieve statistics -** for. Query elements are numbered starting from zero. A value of -1 may be -** to query for statistics regarding the entire query. ^If idx is out of range +** for. Query elements are numbered starting from zero. A value of -1 may +** retrieve statistics for the entire query. ^If idx is out of range ** - less than -1 or greater than or equal to the total number of query ** elements used to implement the statement - a non-zero value is returned and ** the variable that pOut points to is unchanged. @@ -10987,8 +10987,8 @@ SQLITE_API int sqlite3_db_cacheflush(sqlite3*); ** triggers; and so forth. ** ** When the [sqlite3_blob_write()] API is used to update a blob column, -** the pre-update hook is invoked with SQLITE_DELETE. This is because the -** in this case the new values are not available. In this case, when a +** the pre-update hook is invoked with SQLITE_DELETE, because +** the new values are not yet available. In this case, when a ** callback made with op==SQLITE_DELETE is actually a write using the ** sqlite3_blob_write() API, the [sqlite3_preupdate_blobwrite()] returns ** the index of the column being written. In other cases, where the @@ -11241,7 +11241,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const c ** For an ordinary on-disk database file, the serialization is just a ** copy of the disk file. For an in-memory database or a "TEMP" database, ** the serialization is the same sequence of bytes which would be written -** to disk if that database where backed up to disk. +** to disk if that database were backed up to disk. ** ** The usual case is that sqlite3_serialize() copies the serialization of ** the database into memory obtained from [sqlite3_malloc64()] and returns @@ -11250,7 +11250,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const c ** contains the SQLITE_SERIALIZE_NOCOPY bit, then no memory allocations ** are made, and the sqlite3_serialize() function will return a pointer ** to the contiguous memory representation of the database that SQLite -** is currently using for that database, or NULL if the no such contiguous +** is currently using for that database, or NULL if no such contiguous ** memory representation of the database exists. A contiguous memory ** representation of the database will usually only exist if there has ** been a prior call to [sqlite3_deserialize(D,S,...)] with the same @@ -11321,7 +11321,7 @@ SQLITE_API unsigned char *sqlite3_serialize( ** database is currently in a read transaction or is involved in a backup ** operation. ** -** It is not possible to deserialized into the TEMP database. If the +** It is not possible to deserialize into the TEMP database. If the ** S argument to sqlite3_deserialize(D,S,P,N,M,F) is "temp" then the ** function returns SQLITE_ERROR. ** @@ -11343,7 +11343,7 @@ SQLITE_API int sqlite3_deserialize( sqlite3 *db, /* The database connection */ const char *zSchema, /* Which DB to reopen with the deserialization */ unsigned char *pData, /* The serialized database content */ - sqlite3_int64 szDb, /* Number bytes in the deserialization */ + sqlite3_int64 szDb, /* Number of bytes in the deserialization */ sqlite3_int64 szBuf, /* Total size of buffer pData[] */ unsigned mFlags /* Zero or more SQLITE_DESERIALIZE_* flags */ ); @@ -11351,7 +11351,7 @@ SQLITE_API int sqlite3_deserialize( /* ** CAPI3REF: Flags for sqlite3_deserialize() ** -** The following are allowed values for 6th argument (the F argument) to +** The following are allowed values for the 6th argument (the F argument) to ** the [sqlite3_deserialize(D,S,P,N,M,F)] interface. ** ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization @@ -19168,7 +19168,6 @@ struct Index { unsigned hasStat1:1; /* aiRowLogEst values come from sqlite_stat1 */ unsigned bNoQuery:1; /* Do not use this index to optimize queries */ unsigned bAscKeyBug:1; /* True if the bba7b69f9849b5bf bug applies */ - unsigned bIdxRowid:1; /* One or more of the index keys is the ROWID */ unsigned bHasVCol:1; /* Index references one or more VIRTUAL columns */ unsigned bHasExpr:1; /* Index contains an expression, either a literal ** expression, or a reference to a VIRTUAL column */ @@ -19441,6 +19440,7 @@ struct Expr { Table *pTab; /* TK_COLUMN: Table containing column. Can be NULL ** for a column of an index on an expression */ Window *pWin; /* EP_WinFunc: Window/Filter defn for a function */ + int nReg; /* TK_NULLS: Number of registers to NULL out */ struct { /* TK_IN, TK_SELECT, and TK_EXISTS */ int iAddr; /* Subroutine entry address */ int regReturn; /* Register used to hold return address */ @@ -21475,6 +21475,7 @@ SQLITE_PRIVATE void sqlite3ExprCodeGeneratedColumn(Parse*, Table*, Column*, int) SQLITE_PRIVATE void sqlite3ExprCodeCopy(Parse*, Expr*, int); SQLITE_PRIVATE void sqlite3ExprCodeFactorable(Parse*, Expr*, int); SQLITE_PRIVATE int sqlite3ExprCodeRunJustOnce(Parse*, Expr*, int); +SQLITE_PRIVATE void sqlite3ExprNullRegisterRange(Parse*, int, int); SQLITE_PRIVATE int sqlite3ExprCodeTemp(Parse*, Expr*, int*); SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse*, Expr*, int); SQLITE_PRIVATE int sqlite3ExprCodeExprList(Parse*, ExprList*, int, int, u8); @@ -111488,7 +111489,7 @@ SQLITE_PRIVATE Expr *sqlite3ExprAnd(Parse *pParse, Expr *pLeft, Expr *pRight){ return pLeft; }else{ u32 f = pLeft->flags | pRight->flags; - if( (f&(EP_OuterON|EP_InnerON|EP_IsFalse))==EP_IsFalse + if( (f&(EP_OuterON|EP_InnerON|EP_IsFalse|EP_HasFunc))==EP_IsFalse && !IN_RENAME_OBJECT ){ sqlite3ExprDeferredDelete(pParse, pLeft); @@ -115242,6 +115243,12 @@ expr_code_doover: sqlite3VdbeLoadString(v, target, pExpr->u.zToken); return target; } + case TK_NULLS: { + /* Set a range of registers to NULL. pExpr->y.nReg registers starting + ** with target */ + sqlite3VdbeAddOp3(v, OP_Null, 0, target, target + pExpr->y.nReg - 1); + return target; + } default: { /* Make NULL the default case so that if a bug causes an illegal ** Expr node to be passed into this function, it will be handled @@ -115926,6 +115933,25 @@ SQLITE_PRIVATE int sqlite3ExprCodeRunJustOnce( return regDest; } +/* +** Make arrangements to invoke OP_Null on a range of registers +** during initialization. +*/ +SQLITE_PRIVATE SQLITE_NOINLINE void sqlite3ExprNullRegisterRange( + Parse *pParse, /* Parsing context */ + int iReg, /* First register to set to NULL */ + int nReg /* Number of sequential registers to NULL out */ +){ + u8 okConstFactor = pParse->okConstFactor; + Expr t; + memset(&t, 0, sizeof(t)); + t.op = TK_NULLS; + t.y.nReg = nReg; + pParse->okConstFactor = 1; + sqlite3ExprCodeRunJustOnce(pParse, &t, iReg); + pParse->okConstFactor = okConstFactor; +} + /* ** Generate code to evaluate an expression and store the results ** into a register. Return the register number where the results @@ -127196,7 +127222,6 @@ SQLITE_PRIVATE void sqlite3CreateIndex( assert( j<=0x7fff ); if( j<0 ){ j = pTab->iPKey; - pIndex->bIdxRowid = 1; }else{ if( pTab->aCol[j].notNull==0 ){ pIndex->uniqNotNull = 0; @@ -153177,6 +153202,7 @@ SQLITE_PRIVATE int sqlite3Select( sqlite3VdbeAddOp2(v, OP_Integer, 0, iAbortFlag); VdbeComment((v, "clear abort flag")); sqlite3VdbeAddOp3(v, OP_Null, 0, iAMem, iAMem+pGroupBy->nExpr-1); + sqlite3ExprNullRegisterRange(pParse, iAMem, pGroupBy->nExpr); /* Begin a loop that will extract all source rows in GROUP BY order. ** This might involve two separate loops with an OP_Sort in between, or @@ -160173,7 +160199,9 @@ static Expr *removeUnindexableInClauseTerms( int iField; assert( (pLoop->aLTerm[i]->eOperator & (WO_OR|WO_AND))==0 ); iField = pLoop->aLTerm[i]->u.x.iField - 1; - if( pOrigRhs->a[iField].pExpr==0 ) continue; /* Duplicate PK column */ + if( NEVER(pOrigRhs->a[iField].pExpr==0) ){ + continue; /* Duplicate PK column */ + } pRhs = sqlite3ExprListAppend(pParse, pRhs, pOrigRhs->a[iField].pExpr); pOrigRhs->a[iField].pExpr = 0; if( pRhs ) pRhs->a[pRhs->nExpr-1].u.x.iOrderByCol = iField+1; @@ -160270,7 +160298,7 @@ static SQLITE_NOINLINE void codeINTerm( return; } } - for(i=iEq;inLTerm; i++){ + for(i=iEq; inLTerm; i++){ assert( pLoop->aLTerm[i]!=0 ); if( pLoop->aLTerm[i]->pExpr==pX ) nEq++; } @@ -160279,22 +160307,13 @@ static SQLITE_NOINLINE void codeINTerm( if( !ExprUseXSelect(pX) || pX->x.pSelect->pEList->nExpr==1 ){ eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, 0, &iTab); }else{ - Expr *pExpr = pTerm->pExpr; - if( pExpr->iTable==0 || !ExprHasProperty(pExpr, EP_Subrtn) ){ - sqlite3 *db = pParse->db; - pX = removeUnindexableInClauseTerms(pParse, iEq, pLoop, pX); - if( !db->mallocFailed ){ - aiMap = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int)*nEq); - eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, aiMap,&iTab); - pExpr->iTable = iTab; - } - sqlite3ExprDelete(db, pX); - }else{ - int n = sqlite3ExprVectorSize(pX->pLeft); - aiMap = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int)*MAX(nEq,n)); - eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, aiMap, &iTab); + sqlite3 *db = pParse->db; + Expr *pXMod = removeUnindexableInClauseTerms(pParse, iEq, pLoop, pX); + if( !db->mallocFailed ){ + aiMap = (int*)sqlite3DbMallocZero(db, sizeof(int)*nEq); + eType = sqlite3FindInIndex(pParse, pXMod, IN_INDEX_LOOP, 0, aiMap, &iTab); } - pX = pExpr; + sqlite3ExprDelete(db, pXMod); } if( eType==IN_INDEX_INDEX_DESC ){ @@ -160324,7 +160343,7 @@ static SQLITE_NOINLINE void codeINTerm( if( pIn ){ int iMap = 0; /* Index in aiMap[] */ pIn += i; - for(i=iEq;inLTerm; i++){ + for(i=iEq; inLTerm; i++){ if( pLoop->aLTerm[i]->pExpr==pX ){ int iOut = iTarget + i - iEq; if( eType==IN_INDEX_ROWID ){ @@ -167682,6 +167701,7 @@ static int whereLoopAddBtreeIndex( if( ExprUseXSelect(pExpr) ){ /* "x IN (SELECT ...)": TUNING: the SELECT returns 25 rows */ int i; + int bRedundant = 0; nIn = 46; assert( 46==sqlite3LogEst(25) ); /* The expression may actually be of the form (x, y) IN (SELECT...). @@ -167690,7 +167710,20 @@ static int whereLoopAddBtreeIndex( ** for each such term. The following loop checks that pTerm is the ** first such term in use, and sets nIn back to 0 if it is not. */ for(i=0; inLTerm-1; i++){ - if( pNew->aLTerm[i] && pNew->aLTerm[i]->pExpr==pExpr ) nIn = 0; + if( pNew->aLTerm[i] && pNew->aLTerm[i]->pExpr==pExpr ){ + nIn = 0; + if( pNew->aLTerm[i]->u.x.iField == pTerm->u.x.iField ){ + /* Detect when two or more columns of an index match the same + ** column of a vector IN operater, and avoid adding the column + ** to the WhereLoop more than once. See tag-20250707-01 + ** in test/rowvalue.test */ + bRedundant = 1; + } + } + } + if( bRedundant ){ + pNew->nLTerm--; + continue; } }else if( ALWAYS(pExpr->x.pList && pExpr->x.pList->nExpr) ){ /* "x IN (value, value, ...)" */ @@ -167922,7 +167955,7 @@ static int whereLoopAddBtreeIndex( if( (pNew->wsFlags & WHERE_TOP_LIMIT)==0 && pNew->u.btree.nEqnColumn && (pNew->u.btree.nEqnKeyCol || - (pProbe->idxType!=SQLITE_IDXTYPE_PRIMARYKEY && !pProbe->bIdxRowid)) + pProbe->idxType!=SQLITE_IDXTYPE_PRIMARYKEY) ){ if( pNew->u.btree.nEq>3 ){ sqlite3ProgressCheck(pParse); @@ -168465,6 +168498,7 @@ static int whereLoopAddBtree( pNew->u.btree.nEq = 0; pNew->u.btree.nBtm = 0; pNew->u.btree.nTop = 0; + pNew->u.btree.nDistinctCol = 0; pNew->nSkip = 0; pNew->nLTerm = 0; pNew->iSortIdx = 0; @@ -169533,8 +169567,6 @@ static i8 wherePathSatisfiesOrderBy( obSat = obDone; } break; - }else if( wctrlFlags & WHERE_DISTINCTBY ){ - pLoop->u.btree.nDistinctCol = 0; } iCur = pWInfo->pTabList->a[pLoop->iTab].iCursor; @@ -179897,12 +179929,21 @@ static YYACTIONTYPE yy_reduce( ** expr1 IN () ** expr1 NOT IN () ** - ** simplify to constants 0 (false) and 1 (true), respectively, - ** regardless of the value of expr1. + ** simplify to constants 0 (false) and 1 (true), respectively. + ** + ** Except, do not apply this optimization if expr1 contains a function + ** because that function might be an aggregate (we don't know yet whether + ** it is or not) and if it is an aggregate, that could change the meaning + ** of the whole query. */ - sqlite3ExprUnmapAndDelete(pParse, yymsp[-4].minor.yy590); - yymsp[-4].minor.yy590 = sqlite3Expr(pParse->db, TK_STRING, yymsp[-3].minor.yy502 ? "true" : "false"); - if( yymsp[-4].minor.yy590 ) sqlite3ExprIdToTrueFalse(yymsp[-4].minor.yy590); + Expr *pB = sqlite3Expr(pParse->db, TK_STRING, yymsp[-3].minor.yy502 ? "true" : "false"); + if( pB ) sqlite3ExprIdToTrueFalse(pB); + if( !ExprHasProperty(yymsp[-4].minor.yy590, EP_HasFunc) ){ + sqlite3ExprUnmapAndDelete(pParse, yymsp[-4].minor.yy590); + yymsp[-4].minor.yy590 = pB; + }else{ + yymsp[-4].minor.yy590 = sqlite3PExpr(pParse, yymsp[-3].minor.yy502 ? TK_OR : TK_AND, pB, yymsp[-4].minor.yy590); + } }else{ Expr *pRHS = yymsp[-1].minor.yy402->a[0].pExpr; if( yymsp[-1].minor.yy402->nExpr==1 && sqlite3ExprIsConstant(pParse,pRHS) && yymsp[-4].minor.yy590->op!=TK_VECTOR ){ @@ -181508,7 +181549,7 @@ static int getToken(const unsigned char **pz){ int t; /* Token type to return */ do { z += sqlite3GetToken(z, &t); - }while( t==TK_SPACE ); + }while( t==TK_SPACE || t==TK_COMMENT ); if( t==TK_ID || t==TK_STRING || t==TK_JOIN_KW @@ -246163,9 +246204,9 @@ static void fts5SegIterSetNext(Fts5Index *p, Fts5SegIter *pIter){ ** leave an error in the Fts5Index object. */ static void fts5SegIterAllocTombstone(Fts5Index *p, Fts5SegIter *pIter){ - const int nTomb = pIter->pSeg->nPgTombstone; + const i64 nTomb = (i64)pIter->pSeg->nPgTombstone; if( nTomb>0 ){ - int nByte = SZ_FTS5TOMBSTONEARRAY(nTomb+1); + i64 nByte = SZ_FTS5TOMBSTONEARRAY(nTomb+1); Fts5TombstoneArray *pNew; pNew = (Fts5TombstoneArray*)sqlite3Fts5MallocZero(&p->rc, nByte); if( pNew ){ @@ -257266,7 +257307,7 @@ static void fts5SourceIdFunc( ){ assert( nArg==0 ); UNUSED_PARAM2(nArg, apUnused); - sqlite3_result_text(pCtx, "fts5: 2025-06-28 14:00:48 2af157d77fb1304a74176eaee7fbc7c7e932d946bf25325e9c26c91db19e3079", -1, SQLITE_TRANSIENT); + sqlite3_result_text(pCtx, "fts5: 2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3", -1, SQLITE_TRANSIENT); } /* diff --git a/contrib/sqlite3/sqlite3.h b/contrib/sqlite3/sqlite3.h index f56dd8d86a2d..c2ed750305b2 100644 --- a/contrib/sqlite3/sqlite3.h +++ b/contrib/sqlite3/sqlite3.h @@ -146,9 +146,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.50.2" -#define SQLITE_VERSION_NUMBER 3050002 -#define SQLITE_SOURCE_ID "2025-06-28 14:00:48 2af157d77fb1304a74176eaee7fbc7c7e932d946bf25325e9c26c91db19e3079" +#define SQLITE_VERSION "3.50.4" +#define SQLITE_VERSION_NUMBER 3050004 +#define SQLITE_SOURCE_ID "2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -9058,13 +9058,13 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** [[SQLITE_STMTSTATUS_SORT]]
SQLITE_STMTSTATUS_SORT
**
^This is the number of sort operations that have occurred. ** A non-zero value in this counter may indicate an opportunity to -** improvement performance through careful use of indices.
+** improve performance through careful use of indices. ** ** [[SQLITE_STMTSTATUS_AUTOINDEX]]
SQLITE_STMTSTATUS_AUTOINDEX
**
^This is the number of rows inserted into transient indices that ** were created automatically in order to help joins run faster. ** A non-zero value in this counter may indicate an opportunity to -** improvement performance by adding permanent indices that do not +** improve performance by adding permanent indices that do not ** need to be reinitialized each time the statement is run.
** ** [[SQLITE_STMTSTATUS_VM_STEP]]
SQLITE_STMTSTATUS_VM_STEP
@@ -9073,19 +9073,19 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** to 2147483647. The number of virtual machine operations can be ** used as a proxy for the total work done by the prepared statement. ** If the number of virtual machine operations exceeds 2147483647 -** then the value returned by this statement status code is undefined. +** then the value returned by this statement status code is undefined. ** ** [[SQLITE_STMTSTATUS_REPREPARE]]
SQLITE_STMTSTATUS_REPREPARE
**
^This is the number of times that the prepare statement has been ** automatically regenerated due to schema changes or changes to -** [bound parameters] that might affect the query plan. +** [bound parameters] that might affect the query plan.
** ** [[SQLITE_STMTSTATUS_RUN]]
SQLITE_STMTSTATUS_RUN
**
^This is the number of times that the prepared statement has ** been run. A single "run" for the purposes of this counter is one ** or more calls to [sqlite3_step()] followed by a call to [sqlite3_reset()]. ** The counter is incremented on the first [sqlite3_step()] call of each -** cycle. +** cycle.
** ** [[SQLITE_STMTSTATUS_FILTER_MISS]] ** [[SQLITE_STMTSTATUS_FILTER HIT]] @@ -9095,7 +9095,7 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** step was bypassed because a Bloom filter returned not-found. The ** corresponding SQLITE_STMTSTATUS_FILTER_MISS value is the number of ** times that the Bloom filter returned a find, and thus the join step -** had to be processed as normal. +** had to be processed as normal. ** ** [[SQLITE_STMTSTATUS_MEMUSED]]
SQLITE_STMTSTATUS_MEMUSED
**
^This is the approximate number of bytes of heap memory @@ -9200,9 +9200,9 @@ struct sqlite3_pcache_page { ** SQLite will typically create one cache instance for each open database file, ** though this is not guaranteed. ^The ** first parameter, szPage, is the size in bytes of the pages that must -** be allocated by the cache. ^szPage will always a power of two. ^The +** be allocated by the cache. ^szPage will always be a power of two. ^The ** second parameter szExtra is a number of bytes of extra storage -** associated with each page cache entry. ^The szExtra parameter will +** associated with each page cache entry. ^The szExtra parameter will be ** a number less than 250. SQLite will use the ** extra szExtra bytes on each page to store metadata about the underlying ** database page on disk. The value passed into szExtra depends @@ -9210,17 +9210,17 @@ struct sqlite3_pcache_page { ** ^The third argument to xCreate(), bPurgeable, is true if the cache being ** created will be used to cache database pages of a file stored on disk, or ** false if it is used for an in-memory database. The cache implementation -** does not have to do anything special based with the value of bPurgeable; +** does not have to do anything special based upon the value of bPurgeable; ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will ** never invoke xUnpin() except to deliberately delete a page. ** ^In other words, calls to xUnpin() on a cache with bPurgeable set to ** false will always have the "discard" flag set to true. -** ^Hence, a cache created with bPurgeable false will +** ^Hence, a cache created with bPurgeable set to false will ** never contain any unpinned pages. ** ** [[the xCachesize() page cache method]] ** ^(The xCachesize() method may be called at any time by SQLite to set the -** suggested maximum cache-size (number of pages stored by) the cache +** suggested maximum cache-size (number of pages stored) for the cache ** instance passed as the first argument. This is the value configured using ** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable ** parameter, the implementation is not required to do anything with this @@ -9247,12 +9247,12 @@ struct sqlite3_pcache_page { ** implementation must return a pointer to the page buffer with its content ** intact. If the requested page is not already in the cache, then the ** cache implementation should use the value of the createFlag -** parameter to help it determined what action to take: +** parameter to help it determine what action to take: ** ** **
createFlag Behavior when page is not already in cache **
0 Do not allocate a new page. Return NULL. -**
1 Allocate a new page if it easy and convenient to do so. +**
1 Allocate a new page if it is easy and convenient to do so. ** Otherwise return NULL. **
2 Make every effort to allocate a new page. Only return ** NULL if allocating a new page is effectively impossible. @@ -9269,7 +9269,7 @@ struct sqlite3_pcache_page { ** as its second argument. If the third parameter, discard, is non-zero, ** then the page must be evicted from the cache. ** ^If the discard parameter is -** zero, then the page may be discarded or retained at the discretion of +** zero, then the page may be discarded or retained at the discretion of the ** page cache implementation. ^The page cache implementation ** may choose to evict unpinned pages at any time. ** @@ -9287,7 +9287,7 @@ struct sqlite3_pcache_page { ** When SQLite calls the xTruncate() method, the cache must discard all ** existing cache entries with page numbers (keys) greater than or equal ** to the value of the iLimit parameter passed to xTruncate(). If any -** of these pages are pinned, they are implicitly unpinned, meaning that +** of these pages are pinned, they become implicitly unpinned, meaning that ** they can be safely discarded. ** ** [[the xDestroy() page cache method]] @@ -9586,7 +9586,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** application receives an SQLITE_LOCKED error, it may call the ** sqlite3_unlock_notify() method with the blocked connection handle as ** the first argument to register for a callback that will be invoked -** when the blocking connections current transaction is concluded. ^The +** when the blocking connection's current transaction is concluded. ^The ** callback is invoked from within the [sqlite3_step] or [sqlite3_close] ** call that concludes the blocking connection's transaction. ** @@ -9606,7 +9606,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** blocked connection already has a registered unlock-notify callback, ** then the new callback replaces the old.)^ ^If sqlite3_unlock_notify() is ** called with a NULL pointer as its second argument, then any existing -** unlock-notify callback is canceled. ^The blocked connections +** unlock-notify callback is canceled. ^The blocked connection's ** unlock-notify callback may also be canceled by closing the blocked ** connection using [sqlite3_close()]. ** @@ -10004,7 +10004,7 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...); ** support constraints. In this configuration (which is the default) if ** a call to the [xUpdate] method returns [SQLITE_CONSTRAINT], then the entire ** statement is rolled back as if [ON CONFLICT | OR ABORT] had been -** specified as part of the users SQL statement, regardless of the actual +** specified as part of the user's SQL statement, regardless of the actual ** ON CONFLICT mode specified. ** ** If X is non-zero, then the virtual table implementation guarantees @@ -10038,7 +10038,7 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...); ** [[SQLITE_VTAB_INNOCUOUS]]
SQLITE_VTAB_INNOCUOUS
**
Calls of the form ** [sqlite3_vtab_config](db,SQLITE_VTAB_INNOCUOUS) from within the -** the [xConnect] or [xCreate] methods of a [virtual table] implementation +** [xConnect] or [xCreate] methods of a [virtual table] implementation ** identify that virtual table as being safe to use from within triggers ** and views. Conceptually, the SQLITE_VTAB_INNOCUOUS tag means that the ** virtual table can do no serious harm even if it is controlled by a @@ -10206,7 +10206,7 @@ SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info*,int); **
** ** ^For the purposes of comparing virtual table output values to see if the -** values are same value for sorting purposes, two NULL values are considered +** values are the same value for sorting purposes, two NULL values are considered ** to be the same. In other words, the comparison operator is "IS" ** (or "IS NOT DISTINCT FROM") and not "==". ** @@ -10216,7 +10216,7 @@ SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info*,int); ** ** ^A virtual table implementation is always free to return rows in any order ** it wants, as long as the "orderByConsumed" flag is not set. ^When the -** the "orderByConsumed" flag is unset, the query planner will add extra +** "orderByConsumed" flag is unset, the query planner will add extra ** [bytecode] to ensure that the final results returned by the SQL query are ** ordered correctly. The use of the "orderByConsumed" flag and the ** sqlite3_vtab_distinct() interface is merely an optimization. ^Careful @@ -10313,7 +10313,7 @@ SQLITE_API int sqlite3_vtab_in(sqlite3_index_info*, int iCons, int bHandle); ** sqlite3_vtab_in_next(X,P) should be one of the parameters to the ** xFilter method which invokes these routines, and specifically ** a parameter that was previously selected for all-at-once IN constraint -** processing use the [sqlite3_vtab_in()] interface in the +** processing using the [sqlite3_vtab_in()] interface in the ** [xBestIndex|xBestIndex method]. ^(If the X parameter is not ** an xFilter argument that was selected for all-at-once IN constraint ** processing, then these routines return [SQLITE_ERROR].)^ @@ -10368,7 +10368,7 @@ SQLITE_API int sqlite3_vtab_in_next(sqlite3_value *pVal, sqlite3_value **ppOut); ** and only if *V is set to a value. ^The sqlite3_vtab_rhs_value(P,J,V) ** inteface returns SQLITE_NOTFOUND if the right-hand side of the J-th ** constraint is not available. ^The sqlite3_vtab_rhs_value() interface -** can return an result code other than SQLITE_OK or SQLITE_NOTFOUND if +** can return a result code other than SQLITE_OK or SQLITE_NOTFOUND if ** something goes wrong. ** ** The sqlite3_vtab_rhs_value() interface is usually only successful if @@ -10396,8 +10396,8 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** ** KEYWORDS: {conflict resolution mode} ** ** These constants are returned by [sqlite3_vtab_on_conflict()] to -** inform a [virtual table] implementation what the [ON CONFLICT] mode -** is for the SQL statement being evaluated. +** inform a [virtual table] implementation of the [ON CONFLICT] mode +** for the SQL statement being evaluated. ** ** Note that the [SQLITE_IGNORE] constant is also used as a potential ** return value from the [sqlite3_set_authorizer()] callback and that @@ -10437,39 +10437,39 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** ** [[SQLITE_SCANSTAT_EST]]
SQLITE_SCANSTAT_EST
**
^The "double" variable pointed to by the V parameter will be set to the ** query planner's estimate for the average number of rows output from each -** iteration of the X-th loop. If the query planner's estimates was accurate, +** iteration of the X-th loop. If the query planner's estimate was accurate, ** then this value will approximate the quotient NVISIT/NLOOP and the ** product of this value for all prior loops with the same SELECTID will -** be the NLOOP value for the current loop. +** be the NLOOP value for the current loop.
** ** [[SQLITE_SCANSTAT_NAME]]
SQLITE_SCANSTAT_NAME
**
^The "const char *" variable pointed to by the V parameter will be set ** to a zero-terminated UTF-8 string containing the name of the index or table -** used for the X-th loop. +** used for the X-th loop.
** ** [[SQLITE_SCANSTAT_EXPLAIN]]
SQLITE_SCANSTAT_EXPLAIN
**
^The "const char *" variable pointed to by the V parameter will be set ** to a zero-terminated UTF-8 string containing the [EXPLAIN QUERY PLAN] -** description for the X-th loop. +** description for the X-th loop.
** ** [[SQLITE_SCANSTAT_SELECTID]]
SQLITE_SCANSTAT_SELECTID
**
^The "int" variable pointed to by the V parameter will be set to the ** id for the X-th query plan element. The id value is unique within the ** statement. The select-id is the same value as is output in the first -** column of an [EXPLAIN QUERY PLAN] query. +** column of an [EXPLAIN QUERY PLAN] query.
** ** [[SQLITE_SCANSTAT_PARENTID]]
SQLITE_SCANSTAT_PARENTID
**
The "int" variable pointed to by the V parameter will be set to the -** the id of the parent of the current query element, if applicable, or +** id of the parent of the current query element, if applicable, or ** to zero if the query element has no parent. This is the same value as -** returned in the second column of an [EXPLAIN QUERY PLAN] query. +** returned in the second column of an [EXPLAIN QUERY PLAN] query.
** ** [[SQLITE_SCANSTAT_NCYCLE]]
SQLITE_SCANSTAT_NCYCLE
**
The sqlite3_int64 output value is set to the number of cycles, ** according to the processor time-stamp counter, that elapsed while the ** query element was being processed. This value is not available for ** all query elements - if it is unavailable the output variable is -** set to -1. +** set to -1.
** */ #define SQLITE_SCANSTAT_NLOOP 0 @@ -10510,8 +10510,8 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** ** sqlite3_stmt_scanstatus_v2() with a zeroed flags parameter. ** ** Parameter "idx" identifies the specific query element to retrieve statistics -** for. Query elements are numbered starting from zero. A value of -1 may be -** to query for statistics regarding the entire query. ^If idx is out of range +** for. Query elements are numbered starting from zero. A value of -1 may +** retrieve statistics for the entire query. ^If idx is out of range ** - less than -1 or greater than or equal to the total number of query ** elements used to implement the statement - a non-zero value is returned and ** the variable that pOut points to is unchanged. @@ -10668,8 +10668,8 @@ SQLITE_API int sqlite3_db_cacheflush(sqlite3*); ** triggers; and so forth. ** ** When the [sqlite3_blob_write()] API is used to update a blob column, -** the pre-update hook is invoked with SQLITE_DELETE. This is because the -** in this case the new values are not available. In this case, when a +** the pre-update hook is invoked with SQLITE_DELETE, because +** the new values are not yet available. In this case, when a ** callback made with op==SQLITE_DELETE is actually a write using the ** sqlite3_blob_write() API, the [sqlite3_preupdate_blobwrite()] returns ** the index of the column being written. In other cases, where the @@ -10922,7 +10922,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const c ** For an ordinary on-disk database file, the serialization is just a ** copy of the disk file. For an in-memory database or a "TEMP" database, ** the serialization is the same sequence of bytes which would be written -** to disk if that database where backed up to disk. +** to disk if that database were backed up to disk. ** ** The usual case is that sqlite3_serialize() copies the serialization of ** the database into memory obtained from [sqlite3_malloc64()] and returns @@ -10931,7 +10931,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const c ** contains the SQLITE_SERIALIZE_NOCOPY bit, then no memory allocations ** are made, and the sqlite3_serialize() function will return a pointer ** to the contiguous memory representation of the database that SQLite -** is currently using for that database, or NULL if the no such contiguous +** is currently using for that database, or NULL if no such contiguous ** memory representation of the database exists. A contiguous memory ** representation of the database will usually only exist if there has ** been a prior call to [sqlite3_deserialize(D,S,...)] with the same @@ -11002,7 +11002,7 @@ SQLITE_API unsigned char *sqlite3_serialize( ** database is currently in a read transaction or is involved in a backup ** operation. ** -** It is not possible to deserialized into the TEMP database. If the +** It is not possible to deserialize into the TEMP database. If the ** S argument to sqlite3_deserialize(D,S,P,N,M,F) is "temp" then the ** function returns SQLITE_ERROR. ** @@ -11024,7 +11024,7 @@ SQLITE_API int sqlite3_deserialize( sqlite3 *db, /* The database connection */ const char *zSchema, /* Which DB to reopen with the deserialization */ unsigned char *pData, /* The serialized database content */ - sqlite3_int64 szDb, /* Number bytes in the deserialization */ + sqlite3_int64 szDb, /* Number of bytes in the deserialization */ sqlite3_int64 szBuf, /* Total size of buffer pData[] */ unsigned mFlags /* Zero or more SQLITE_DESERIALIZE_* flags */ ); @@ -11032,7 +11032,7 @@ SQLITE_API int sqlite3_deserialize( /* ** CAPI3REF: Flags for sqlite3_deserialize() ** -** The following are allowed values for 6th argument (the F argument) to +** The following are allowed values for the 6th argument (the F argument) to ** the [sqlite3_deserialize(D,S,P,N,M,F)] interface. ** ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization diff --git a/contrib/sqlite3/sqlite3.pc.in b/contrib/sqlite3/sqlite3.pc.in index a9f941b1e40d..723dd5156390 100644 --- a/contrib/sqlite3/sqlite3.pc.in +++ b/contrib/sqlite3/sqlite3.pc.in @@ -9,5 +9,5 @@ Name: SQLite Description: SQL database engine Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lsqlite3 -Libs.private: @LDFLAGS_MATH@ @LDFLAGS_ZLIB@ @LDFLAGS_ICU@ +Libs.private: @LDFLAGS_MATH@ @LDFLAGS_ZLIB@ @LDFLAGS_DLOPEN@ @LDFLAGS_PTHREAD@ @LDFLAGS_ICU@ Cflags: -I${includedir} diff --git a/contrib/sqlite3/sqlite3rc.h b/contrib/sqlite3/sqlite3rc.h index d412190d370b..42ece488e353 100644 --- a/contrib/sqlite3/sqlite3rc.h +++ b/contrib/sqlite3/sqlite3rc.h @@ -1,3 +1,3 @@ #ifndef SQLITE_RESOURCE_VERSION -#define SQLITE_RESOURCE_VERSION 3,50,2 +#define SQLITE_RESOURCE_VERSION 3,50,4 *** 1 LINES SKIPPED *** From nobody Fri Dec 5 13:20:17 2025 X-Original-To: dev-commits-src-branches@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 4dNBnZ6WFrz6Hp2d for ; Fri, 05 Dec 2025 13:20:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dNBnZ4113z3ZNV for ; Fri, 05 Dec 2025 13:20:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764940818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jOowBaXNJ3vW82JfpETleq8gwVRRwGbk6j5TpZ7Ph7M=; b=B5NvSWA+eiPIoLcWHpI3omD5TvlzmlUDkQyDxbB6927uDrwInzwDhUjfZNw6Q7Y5dZUhV/ V5TAPSdIGxxZqk2cWSBGYUSHI4QkknOv7dRJJuOk2Wgj2H52qkQbtMD9FPGcwQ5z779KZ0 5oV/+Q6HeUu6jwZResAvHIUtOxrxtwBkpjCkx+uLsRYM62TXAR6WgvBzZG5+KFBzE9Pt5R UOXrL4AKwZPNhTgbd8bFcPfDWwS/IPERf3U8Q4VKij8fnQS+cD2Y+9F4GxzCj/z5d90AiK wEB0Rvh7rulhJ8W26B4+qGKXCc08fxHcrsk+3kFhIg99pHPkkNcUfPSFF6jHdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764940818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jOowBaXNJ3vW82JfpETleq8gwVRRwGbk6j5TpZ7Ph7M=; b=LksdRTK0Pi/HdTikx8GAxEnr5OChnNiybRfMQtJ3sRxtDfcehIlnN7KYLt/e3GgeJTN7vP ZhypbxPvxGtVNcOlQ+620TKpgdL2rkVKfF9WQHmZFT28NEK/tVg+SlkqpsUXNDWWpSFoJV +LZ3eNKz2ACeQK16p/wY3W8FQjpcRtH3hU3Z6Z/ro9/AVaPIji6k19VEdBMpkcjy8gvcUB NNQCXAix/sSk/Cdea7QCgNc2RCzxELSQ8EN2UzWExpZBT97z9+PXgviZbXxef6Vani4FOs rImaUZiN+aRu2BHJK/i2BglyoVZrFM9m/Hn/z/2oAMXMw5a2ndN0G/k3j1NpRg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764940818; a=rsa-sha256; cv=none; b=ABAKAx7fS9UIvK4WoJnuyxVZEU8CXIGCkW5RSFuDNGQVmwEfdI9XDelHvRRhk0IeRKBKw7 4+l5iVcpCRqm/yG4fn4+JekdOhu/yq7rHmnIygWSDXs6UGCR8o5gHqNw1/w4cwZbknj/2H vjqI8/TwdTFKYjtRasRYNPUCwPUri8VRu8VNjju5iXiVJsbohpHqTliEZ2KwiW854sF61a AknLFPEcyysCJ8z6YmjHOvVWvJq2b5LJSY3v34jNFEexeM1oCvK0YtZadtuWgLErNSpY90 tmBVFXhcHrliB4LjSwH47sgduIcsk54dbNPUirZ5hXFglF4qn9bz7nGkXYAn9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dNBnZ2KTWz19dm for ; Fri, 05 Dec 2025 13:20:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2931f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 05 Dec 2025 13:20:17 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 5b084744bb21 - stable/13 - sqlite3: Update to 3.50.4 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5b084744bb212e2783ffca8b8d332e40df9b6b02 Auto-Submitted: auto-generated Date: Fri, 05 Dec 2025 13:20:17 +0000 Message-Id: <6932dc11.2931f.3565f1dc@gitrepo.freebsd.org> The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=5b084744bb212e2783ffca8b8d332e40df9b6b02 commit 5b084744bb212e2783ffca8b8d332e40df9b6b02 Author: Cy Schubert AuthorDate: 2025-12-02 15:22:26 +0000 Commit: Cy Schubert CommitDate: 2025-12-05 13:20:12 +0000 sqlite3: Update to 3.50.4 Release notes at https://www.sqlite.org/releaselog/3_50_4.html. Obtained from: https://www.sqlite.org/2025/sqlite-autoconf-3500400.tar.gz Merge commit 'e7e917ee3cf2b3010b1c511c6ebaf8b65b983ad7' (cherry picked from commit 07d5a9b1b2dd95d95137c6c2afcb84ad40c05b75) --- contrib/sqlite3/VERSION | 2 +- contrib/sqlite3/sqlite3.c | 203 +++++++++++++++++++++++++----------------- contrib/sqlite3/sqlite3.h | 90 +++++++++---------- contrib/sqlite3/sqlite3.pc.in | 2 +- contrib/sqlite3/sqlite3rc.h | 2 +- 5 files changed, 170 insertions(+), 129 deletions(-) diff --git a/contrib/sqlite3/VERSION b/contrib/sqlite3/VERSION index 18d0478a0414..acecb4fcb7aa 100644 --- a/contrib/sqlite3/VERSION +++ b/contrib/sqlite3/VERSION @@ -1 +1 @@ -3.50.2 +3.50.4 diff --git a/contrib/sqlite3/sqlite3.c b/contrib/sqlite3/sqlite3.c index 0b071b2b6cc2..26a7a43d8658 100644 --- a/contrib/sqlite3/sqlite3.c +++ b/contrib/sqlite3/sqlite3.c @@ -1,6 +1,6 @@ /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.50.2. By combining all the individual C code files into this +** version 3.50.4. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -18,7 +18,7 @@ ** separate file. This file contains only code for the core SQLite library. ** ** The content in this amalgamation comes from Fossil check-in -** 2af157d77fb1304a74176eaee7fbc7c7e932 with changes in files: +** 4d8adfb30e03f9cf27f800a2c1ba3c48fb4c with changes in files: ** ** */ @@ -465,9 +465,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.50.2" -#define SQLITE_VERSION_NUMBER 3050002 -#define SQLITE_SOURCE_ID "2025-06-28 14:00:48 2af157d77fb1304a74176eaee7fbc7c7e932d946bf25325e9c26c91db19e3079" +#define SQLITE_VERSION "3.50.4" +#define SQLITE_VERSION_NUMBER 3050004 +#define SQLITE_SOURCE_ID "2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -9377,13 +9377,13 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** [[SQLITE_STMTSTATUS_SORT]]
SQLITE_STMTSTATUS_SORT
**
^This is the number of sort operations that have occurred. ** A non-zero value in this counter may indicate an opportunity to -** improvement performance through careful use of indices.
+** improve performance through careful use of indices. ** ** [[SQLITE_STMTSTATUS_AUTOINDEX]]
SQLITE_STMTSTATUS_AUTOINDEX
**
^This is the number of rows inserted into transient indices that ** were created automatically in order to help joins run faster. ** A non-zero value in this counter may indicate an opportunity to -** improvement performance by adding permanent indices that do not +** improve performance by adding permanent indices that do not ** need to be reinitialized each time the statement is run.
** ** [[SQLITE_STMTSTATUS_VM_STEP]]
SQLITE_STMTSTATUS_VM_STEP
@@ -9392,19 +9392,19 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** to 2147483647. The number of virtual machine operations can be ** used as a proxy for the total work done by the prepared statement. ** If the number of virtual machine operations exceeds 2147483647 -** then the value returned by this statement status code is undefined. +** then the value returned by this statement status code is undefined. ** ** [[SQLITE_STMTSTATUS_REPREPARE]]
SQLITE_STMTSTATUS_REPREPARE
**
^This is the number of times that the prepare statement has been ** automatically regenerated due to schema changes or changes to -** [bound parameters] that might affect the query plan. +** [bound parameters] that might affect the query plan.
** ** [[SQLITE_STMTSTATUS_RUN]]
SQLITE_STMTSTATUS_RUN
**
^This is the number of times that the prepared statement has ** been run. A single "run" for the purposes of this counter is one ** or more calls to [sqlite3_step()] followed by a call to [sqlite3_reset()]. ** The counter is incremented on the first [sqlite3_step()] call of each -** cycle. +** cycle.
** ** [[SQLITE_STMTSTATUS_FILTER_MISS]] ** [[SQLITE_STMTSTATUS_FILTER HIT]] @@ -9414,7 +9414,7 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** step was bypassed because a Bloom filter returned not-found. The ** corresponding SQLITE_STMTSTATUS_FILTER_MISS value is the number of ** times that the Bloom filter returned a find, and thus the join step -** had to be processed as normal. +** had to be processed as normal. ** ** [[SQLITE_STMTSTATUS_MEMUSED]]
SQLITE_STMTSTATUS_MEMUSED
**
^This is the approximate number of bytes of heap memory @@ -9519,9 +9519,9 @@ struct sqlite3_pcache_page { ** SQLite will typically create one cache instance for each open database file, ** though this is not guaranteed. ^The ** first parameter, szPage, is the size in bytes of the pages that must -** be allocated by the cache. ^szPage will always a power of two. ^The +** be allocated by the cache. ^szPage will always be a power of two. ^The ** second parameter szExtra is a number of bytes of extra storage -** associated with each page cache entry. ^The szExtra parameter will +** associated with each page cache entry. ^The szExtra parameter will be ** a number less than 250. SQLite will use the ** extra szExtra bytes on each page to store metadata about the underlying ** database page on disk. The value passed into szExtra depends @@ -9529,17 +9529,17 @@ struct sqlite3_pcache_page { ** ^The third argument to xCreate(), bPurgeable, is true if the cache being ** created will be used to cache database pages of a file stored on disk, or ** false if it is used for an in-memory database. The cache implementation -** does not have to do anything special based with the value of bPurgeable; +** does not have to do anything special based upon the value of bPurgeable; ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will ** never invoke xUnpin() except to deliberately delete a page. ** ^In other words, calls to xUnpin() on a cache with bPurgeable set to ** false will always have the "discard" flag set to true. -** ^Hence, a cache created with bPurgeable false will +** ^Hence, a cache created with bPurgeable set to false will ** never contain any unpinned pages. ** ** [[the xCachesize() page cache method]] ** ^(The xCachesize() method may be called at any time by SQLite to set the -** suggested maximum cache-size (number of pages stored by) the cache +** suggested maximum cache-size (number of pages stored) for the cache ** instance passed as the first argument. This is the value configured using ** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable ** parameter, the implementation is not required to do anything with this @@ -9566,12 +9566,12 @@ struct sqlite3_pcache_page { ** implementation must return a pointer to the page buffer with its content ** intact. If the requested page is not already in the cache, then the ** cache implementation should use the value of the createFlag -** parameter to help it determined what action to take: +** parameter to help it determine what action to take: ** ** **
createFlag Behavior when page is not already in cache **
0 Do not allocate a new page. Return NULL. -**
1 Allocate a new page if it easy and convenient to do so. +**
1 Allocate a new page if it is easy and convenient to do so. ** Otherwise return NULL. **
2 Make every effort to allocate a new page. Only return ** NULL if allocating a new page is effectively impossible. @@ -9588,7 +9588,7 @@ struct sqlite3_pcache_page { ** as its second argument. If the third parameter, discard, is non-zero, ** then the page must be evicted from the cache. ** ^If the discard parameter is -** zero, then the page may be discarded or retained at the discretion of +** zero, then the page may be discarded or retained at the discretion of the ** page cache implementation. ^The page cache implementation ** may choose to evict unpinned pages at any time. ** @@ -9606,7 +9606,7 @@ struct sqlite3_pcache_page { ** When SQLite calls the xTruncate() method, the cache must discard all ** existing cache entries with page numbers (keys) greater than or equal ** to the value of the iLimit parameter passed to xTruncate(). If any -** of these pages are pinned, they are implicitly unpinned, meaning that +** of these pages are pinned, they become implicitly unpinned, meaning that ** they can be safely discarded. ** ** [[the xDestroy() page cache method]] @@ -9905,7 +9905,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** application receives an SQLITE_LOCKED error, it may call the ** sqlite3_unlock_notify() method with the blocked connection handle as ** the first argument to register for a callback that will be invoked -** when the blocking connections current transaction is concluded. ^The +** when the blocking connection's current transaction is concluded. ^The ** callback is invoked from within the [sqlite3_step] or [sqlite3_close] ** call that concludes the blocking connection's transaction. ** @@ -9925,7 +9925,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** blocked connection already has a registered unlock-notify callback, ** then the new callback replaces the old.)^ ^If sqlite3_unlock_notify() is ** called with a NULL pointer as its second argument, then any existing -** unlock-notify callback is canceled. ^The blocked connections +** unlock-notify callback is canceled. ^The blocked connection's ** unlock-notify callback may also be canceled by closing the blocked ** connection using [sqlite3_close()]. ** @@ -10323,7 +10323,7 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...); ** support constraints. In this configuration (which is the default) if ** a call to the [xUpdate] method returns [SQLITE_CONSTRAINT], then the entire ** statement is rolled back as if [ON CONFLICT | OR ABORT] had been -** specified as part of the users SQL statement, regardless of the actual +** specified as part of the user's SQL statement, regardless of the actual ** ON CONFLICT mode specified. ** ** If X is non-zero, then the virtual table implementation guarantees @@ -10357,7 +10357,7 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...); ** [[SQLITE_VTAB_INNOCUOUS]]
SQLITE_VTAB_INNOCUOUS
**
Calls of the form ** [sqlite3_vtab_config](db,SQLITE_VTAB_INNOCUOUS) from within the -** the [xConnect] or [xCreate] methods of a [virtual table] implementation +** [xConnect] or [xCreate] methods of a [virtual table] implementation ** identify that virtual table as being safe to use from within triggers ** and views. Conceptually, the SQLITE_VTAB_INNOCUOUS tag means that the ** virtual table can do no serious harm even if it is controlled by a @@ -10525,7 +10525,7 @@ SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info*,int); **
** ** ^For the purposes of comparing virtual table output values to see if the -** values are same value for sorting purposes, two NULL values are considered +** values are the same value for sorting purposes, two NULL values are considered ** to be the same. In other words, the comparison operator is "IS" ** (or "IS NOT DISTINCT FROM") and not "==". ** @@ -10535,7 +10535,7 @@ SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info*,int); ** ** ^A virtual table implementation is always free to return rows in any order ** it wants, as long as the "orderByConsumed" flag is not set. ^When the -** the "orderByConsumed" flag is unset, the query planner will add extra +** "orderByConsumed" flag is unset, the query planner will add extra ** [bytecode] to ensure that the final results returned by the SQL query are ** ordered correctly. The use of the "orderByConsumed" flag and the ** sqlite3_vtab_distinct() interface is merely an optimization. ^Careful @@ -10632,7 +10632,7 @@ SQLITE_API int sqlite3_vtab_in(sqlite3_index_info*, int iCons, int bHandle); ** sqlite3_vtab_in_next(X,P) should be one of the parameters to the ** xFilter method which invokes these routines, and specifically ** a parameter that was previously selected for all-at-once IN constraint -** processing use the [sqlite3_vtab_in()] interface in the +** processing using the [sqlite3_vtab_in()] interface in the ** [xBestIndex|xBestIndex method]. ^(If the X parameter is not ** an xFilter argument that was selected for all-at-once IN constraint ** processing, then these routines return [SQLITE_ERROR].)^ @@ -10687,7 +10687,7 @@ SQLITE_API int sqlite3_vtab_in_next(sqlite3_value *pVal, sqlite3_value **ppOut); ** and only if *V is set to a value. ^The sqlite3_vtab_rhs_value(P,J,V) ** inteface returns SQLITE_NOTFOUND if the right-hand side of the J-th ** constraint is not available. ^The sqlite3_vtab_rhs_value() interface -** can return an result code other than SQLITE_OK or SQLITE_NOTFOUND if +** can return a result code other than SQLITE_OK or SQLITE_NOTFOUND if ** something goes wrong. ** ** The sqlite3_vtab_rhs_value() interface is usually only successful if @@ -10715,8 +10715,8 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** ** KEYWORDS: {conflict resolution mode} ** ** These constants are returned by [sqlite3_vtab_on_conflict()] to -** inform a [virtual table] implementation what the [ON CONFLICT] mode -** is for the SQL statement being evaluated. +** inform a [virtual table] implementation of the [ON CONFLICT] mode +** for the SQL statement being evaluated. ** ** Note that the [SQLITE_IGNORE] constant is also used as a potential ** return value from the [sqlite3_set_authorizer()] callback and that @@ -10756,39 +10756,39 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** ** [[SQLITE_SCANSTAT_EST]]
SQLITE_SCANSTAT_EST
**
^The "double" variable pointed to by the V parameter will be set to the ** query planner's estimate for the average number of rows output from each -** iteration of the X-th loop. If the query planner's estimates was accurate, +** iteration of the X-th loop. If the query planner's estimate was accurate, ** then this value will approximate the quotient NVISIT/NLOOP and the ** product of this value for all prior loops with the same SELECTID will -** be the NLOOP value for the current loop. +** be the NLOOP value for the current loop.
** ** [[SQLITE_SCANSTAT_NAME]]
SQLITE_SCANSTAT_NAME
**
^The "const char *" variable pointed to by the V parameter will be set ** to a zero-terminated UTF-8 string containing the name of the index or table -** used for the X-th loop. +** used for the X-th loop.
** ** [[SQLITE_SCANSTAT_EXPLAIN]]
SQLITE_SCANSTAT_EXPLAIN
**
^The "const char *" variable pointed to by the V parameter will be set ** to a zero-terminated UTF-8 string containing the [EXPLAIN QUERY PLAN] -** description for the X-th loop. +** description for the X-th loop.
** ** [[SQLITE_SCANSTAT_SELECTID]]
SQLITE_SCANSTAT_SELECTID
**
^The "int" variable pointed to by the V parameter will be set to the ** id for the X-th query plan element. The id value is unique within the ** statement. The select-id is the same value as is output in the first -** column of an [EXPLAIN QUERY PLAN] query. +** column of an [EXPLAIN QUERY PLAN] query.
** ** [[SQLITE_SCANSTAT_PARENTID]]
SQLITE_SCANSTAT_PARENTID
**
The "int" variable pointed to by the V parameter will be set to the -** the id of the parent of the current query element, if applicable, or +** id of the parent of the current query element, if applicable, or ** to zero if the query element has no parent. This is the same value as -** returned in the second column of an [EXPLAIN QUERY PLAN] query. +** returned in the second column of an [EXPLAIN QUERY PLAN] query.
** ** [[SQLITE_SCANSTAT_NCYCLE]]
SQLITE_SCANSTAT_NCYCLE
**
The sqlite3_int64 output value is set to the number of cycles, ** according to the processor time-stamp counter, that elapsed while the ** query element was being processed. This value is not available for ** all query elements - if it is unavailable the output variable is -** set to -1. +** set to -1.
** */ #define SQLITE_SCANSTAT_NLOOP 0 @@ -10829,8 +10829,8 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** ** sqlite3_stmt_scanstatus_v2() with a zeroed flags parameter. ** ** Parameter "idx" identifies the specific query element to retrieve statistics -** for. Query elements are numbered starting from zero. A value of -1 may be -** to query for statistics regarding the entire query. ^If idx is out of range +** for. Query elements are numbered starting from zero. A value of -1 may +** retrieve statistics for the entire query. ^If idx is out of range ** - less than -1 or greater than or equal to the total number of query ** elements used to implement the statement - a non-zero value is returned and ** the variable that pOut points to is unchanged. @@ -10987,8 +10987,8 @@ SQLITE_API int sqlite3_db_cacheflush(sqlite3*); ** triggers; and so forth. ** ** When the [sqlite3_blob_write()] API is used to update a blob column, -** the pre-update hook is invoked with SQLITE_DELETE. This is because the -** in this case the new values are not available. In this case, when a +** the pre-update hook is invoked with SQLITE_DELETE, because +** the new values are not yet available. In this case, when a ** callback made with op==SQLITE_DELETE is actually a write using the ** sqlite3_blob_write() API, the [sqlite3_preupdate_blobwrite()] returns ** the index of the column being written. In other cases, where the @@ -11241,7 +11241,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const c ** For an ordinary on-disk database file, the serialization is just a ** copy of the disk file. For an in-memory database or a "TEMP" database, ** the serialization is the same sequence of bytes which would be written -** to disk if that database where backed up to disk. +** to disk if that database were backed up to disk. ** ** The usual case is that sqlite3_serialize() copies the serialization of ** the database into memory obtained from [sqlite3_malloc64()] and returns @@ -11250,7 +11250,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const c ** contains the SQLITE_SERIALIZE_NOCOPY bit, then no memory allocations ** are made, and the sqlite3_serialize() function will return a pointer ** to the contiguous memory representation of the database that SQLite -** is currently using for that database, or NULL if the no such contiguous +** is currently using for that database, or NULL if no such contiguous ** memory representation of the database exists. A contiguous memory ** representation of the database will usually only exist if there has ** been a prior call to [sqlite3_deserialize(D,S,...)] with the same @@ -11321,7 +11321,7 @@ SQLITE_API unsigned char *sqlite3_serialize( ** database is currently in a read transaction or is involved in a backup ** operation. ** -** It is not possible to deserialized into the TEMP database. If the +** It is not possible to deserialize into the TEMP database. If the ** S argument to sqlite3_deserialize(D,S,P,N,M,F) is "temp" then the ** function returns SQLITE_ERROR. ** @@ -11343,7 +11343,7 @@ SQLITE_API int sqlite3_deserialize( sqlite3 *db, /* The database connection */ const char *zSchema, /* Which DB to reopen with the deserialization */ unsigned char *pData, /* The serialized database content */ - sqlite3_int64 szDb, /* Number bytes in the deserialization */ + sqlite3_int64 szDb, /* Number of bytes in the deserialization */ sqlite3_int64 szBuf, /* Total size of buffer pData[] */ unsigned mFlags /* Zero or more SQLITE_DESERIALIZE_* flags */ ); @@ -11351,7 +11351,7 @@ SQLITE_API int sqlite3_deserialize( /* ** CAPI3REF: Flags for sqlite3_deserialize() ** -** The following are allowed values for 6th argument (the F argument) to +** The following are allowed values for the 6th argument (the F argument) to ** the [sqlite3_deserialize(D,S,P,N,M,F)] interface. ** ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization @@ -19168,7 +19168,6 @@ struct Index { unsigned hasStat1:1; /* aiRowLogEst values come from sqlite_stat1 */ unsigned bNoQuery:1; /* Do not use this index to optimize queries */ unsigned bAscKeyBug:1; /* True if the bba7b69f9849b5bf bug applies */ - unsigned bIdxRowid:1; /* One or more of the index keys is the ROWID */ unsigned bHasVCol:1; /* Index references one or more VIRTUAL columns */ unsigned bHasExpr:1; /* Index contains an expression, either a literal ** expression, or a reference to a VIRTUAL column */ @@ -19441,6 +19440,7 @@ struct Expr { Table *pTab; /* TK_COLUMN: Table containing column. Can be NULL ** for a column of an index on an expression */ Window *pWin; /* EP_WinFunc: Window/Filter defn for a function */ + int nReg; /* TK_NULLS: Number of registers to NULL out */ struct { /* TK_IN, TK_SELECT, and TK_EXISTS */ int iAddr; /* Subroutine entry address */ int regReturn; /* Register used to hold return address */ @@ -21475,6 +21475,7 @@ SQLITE_PRIVATE void sqlite3ExprCodeGeneratedColumn(Parse*, Table*, Column*, int) SQLITE_PRIVATE void sqlite3ExprCodeCopy(Parse*, Expr*, int); SQLITE_PRIVATE void sqlite3ExprCodeFactorable(Parse*, Expr*, int); SQLITE_PRIVATE int sqlite3ExprCodeRunJustOnce(Parse*, Expr*, int); +SQLITE_PRIVATE void sqlite3ExprNullRegisterRange(Parse*, int, int); SQLITE_PRIVATE int sqlite3ExprCodeTemp(Parse*, Expr*, int*); SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse*, Expr*, int); SQLITE_PRIVATE int sqlite3ExprCodeExprList(Parse*, ExprList*, int, int, u8); @@ -111488,7 +111489,7 @@ SQLITE_PRIVATE Expr *sqlite3ExprAnd(Parse *pParse, Expr *pLeft, Expr *pRight){ return pLeft; }else{ u32 f = pLeft->flags | pRight->flags; - if( (f&(EP_OuterON|EP_InnerON|EP_IsFalse))==EP_IsFalse + if( (f&(EP_OuterON|EP_InnerON|EP_IsFalse|EP_HasFunc))==EP_IsFalse && !IN_RENAME_OBJECT ){ sqlite3ExprDeferredDelete(pParse, pLeft); @@ -115242,6 +115243,12 @@ expr_code_doover: sqlite3VdbeLoadString(v, target, pExpr->u.zToken); return target; } + case TK_NULLS: { + /* Set a range of registers to NULL. pExpr->y.nReg registers starting + ** with target */ + sqlite3VdbeAddOp3(v, OP_Null, 0, target, target + pExpr->y.nReg - 1); + return target; + } default: { /* Make NULL the default case so that if a bug causes an illegal ** Expr node to be passed into this function, it will be handled @@ -115926,6 +115933,25 @@ SQLITE_PRIVATE int sqlite3ExprCodeRunJustOnce( return regDest; } +/* +** Make arrangements to invoke OP_Null on a range of registers +** during initialization. +*/ +SQLITE_PRIVATE SQLITE_NOINLINE void sqlite3ExprNullRegisterRange( + Parse *pParse, /* Parsing context */ + int iReg, /* First register to set to NULL */ + int nReg /* Number of sequential registers to NULL out */ +){ + u8 okConstFactor = pParse->okConstFactor; + Expr t; + memset(&t, 0, sizeof(t)); + t.op = TK_NULLS; + t.y.nReg = nReg; + pParse->okConstFactor = 1; + sqlite3ExprCodeRunJustOnce(pParse, &t, iReg); + pParse->okConstFactor = okConstFactor; +} + /* ** Generate code to evaluate an expression and store the results ** into a register. Return the register number where the results @@ -127196,7 +127222,6 @@ SQLITE_PRIVATE void sqlite3CreateIndex( assert( j<=0x7fff ); if( j<0 ){ j = pTab->iPKey; - pIndex->bIdxRowid = 1; }else{ if( pTab->aCol[j].notNull==0 ){ pIndex->uniqNotNull = 0; @@ -153177,6 +153202,7 @@ SQLITE_PRIVATE int sqlite3Select( sqlite3VdbeAddOp2(v, OP_Integer, 0, iAbortFlag); VdbeComment((v, "clear abort flag")); sqlite3VdbeAddOp3(v, OP_Null, 0, iAMem, iAMem+pGroupBy->nExpr-1); + sqlite3ExprNullRegisterRange(pParse, iAMem, pGroupBy->nExpr); /* Begin a loop that will extract all source rows in GROUP BY order. ** This might involve two separate loops with an OP_Sort in between, or @@ -160173,7 +160199,9 @@ static Expr *removeUnindexableInClauseTerms( int iField; assert( (pLoop->aLTerm[i]->eOperator & (WO_OR|WO_AND))==0 ); iField = pLoop->aLTerm[i]->u.x.iField - 1; - if( pOrigRhs->a[iField].pExpr==0 ) continue; /* Duplicate PK column */ + if( NEVER(pOrigRhs->a[iField].pExpr==0) ){ + continue; /* Duplicate PK column */ + } pRhs = sqlite3ExprListAppend(pParse, pRhs, pOrigRhs->a[iField].pExpr); pOrigRhs->a[iField].pExpr = 0; if( pRhs ) pRhs->a[pRhs->nExpr-1].u.x.iOrderByCol = iField+1; @@ -160270,7 +160298,7 @@ static SQLITE_NOINLINE void codeINTerm( return; } } - for(i=iEq;inLTerm; i++){ + for(i=iEq; inLTerm; i++){ assert( pLoop->aLTerm[i]!=0 ); if( pLoop->aLTerm[i]->pExpr==pX ) nEq++; } @@ -160279,22 +160307,13 @@ static SQLITE_NOINLINE void codeINTerm( if( !ExprUseXSelect(pX) || pX->x.pSelect->pEList->nExpr==1 ){ eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, 0, &iTab); }else{ - Expr *pExpr = pTerm->pExpr; - if( pExpr->iTable==0 || !ExprHasProperty(pExpr, EP_Subrtn) ){ - sqlite3 *db = pParse->db; - pX = removeUnindexableInClauseTerms(pParse, iEq, pLoop, pX); - if( !db->mallocFailed ){ - aiMap = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int)*nEq); - eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, aiMap,&iTab); - pExpr->iTable = iTab; - } - sqlite3ExprDelete(db, pX); - }else{ - int n = sqlite3ExprVectorSize(pX->pLeft); - aiMap = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int)*MAX(nEq,n)); - eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, aiMap, &iTab); + sqlite3 *db = pParse->db; + Expr *pXMod = removeUnindexableInClauseTerms(pParse, iEq, pLoop, pX); + if( !db->mallocFailed ){ + aiMap = (int*)sqlite3DbMallocZero(db, sizeof(int)*nEq); + eType = sqlite3FindInIndex(pParse, pXMod, IN_INDEX_LOOP, 0, aiMap, &iTab); } - pX = pExpr; + sqlite3ExprDelete(db, pXMod); } if( eType==IN_INDEX_INDEX_DESC ){ @@ -160324,7 +160343,7 @@ static SQLITE_NOINLINE void codeINTerm( if( pIn ){ int iMap = 0; /* Index in aiMap[] */ pIn += i; - for(i=iEq;inLTerm; i++){ + for(i=iEq; inLTerm; i++){ if( pLoop->aLTerm[i]->pExpr==pX ){ int iOut = iTarget + i - iEq; if( eType==IN_INDEX_ROWID ){ @@ -167682,6 +167701,7 @@ static int whereLoopAddBtreeIndex( if( ExprUseXSelect(pExpr) ){ /* "x IN (SELECT ...)": TUNING: the SELECT returns 25 rows */ int i; + int bRedundant = 0; nIn = 46; assert( 46==sqlite3LogEst(25) ); /* The expression may actually be of the form (x, y) IN (SELECT...). @@ -167690,7 +167710,20 @@ static int whereLoopAddBtreeIndex( ** for each such term. The following loop checks that pTerm is the ** first such term in use, and sets nIn back to 0 if it is not. */ for(i=0; inLTerm-1; i++){ - if( pNew->aLTerm[i] && pNew->aLTerm[i]->pExpr==pExpr ) nIn = 0; + if( pNew->aLTerm[i] && pNew->aLTerm[i]->pExpr==pExpr ){ + nIn = 0; + if( pNew->aLTerm[i]->u.x.iField == pTerm->u.x.iField ){ + /* Detect when two or more columns of an index match the same + ** column of a vector IN operater, and avoid adding the column + ** to the WhereLoop more than once. See tag-20250707-01 + ** in test/rowvalue.test */ + bRedundant = 1; + } + } + } + if( bRedundant ){ + pNew->nLTerm--; + continue; } }else if( ALWAYS(pExpr->x.pList && pExpr->x.pList->nExpr) ){ /* "x IN (value, value, ...)" */ @@ -167922,7 +167955,7 @@ static int whereLoopAddBtreeIndex( if( (pNew->wsFlags & WHERE_TOP_LIMIT)==0 && pNew->u.btree.nEqnColumn && (pNew->u.btree.nEqnKeyCol || - (pProbe->idxType!=SQLITE_IDXTYPE_PRIMARYKEY && !pProbe->bIdxRowid)) + pProbe->idxType!=SQLITE_IDXTYPE_PRIMARYKEY) ){ if( pNew->u.btree.nEq>3 ){ sqlite3ProgressCheck(pParse); @@ -168465,6 +168498,7 @@ static int whereLoopAddBtree( pNew->u.btree.nEq = 0; pNew->u.btree.nBtm = 0; pNew->u.btree.nTop = 0; + pNew->u.btree.nDistinctCol = 0; pNew->nSkip = 0; pNew->nLTerm = 0; pNew->iSortIdx = 0; @@ -169533,8 +169567,6 @@ static i8 wherePathSatisfiesOrderBy( obSat = obDone; } break; - }else if( wctrlFlags & WHERE_DISTINCTBY ){ - pLoop->u.btree.nDistinctCol = 0; } iCur = pWInfo->pTabList->a[pLoop->iTab].iCursor; @@ -179897,12 +179929,21 @@ static YYACTIONTYPE yy_reduce( ** expr1 IN () ** expr1 NOT IN () ** - ** simplify to constants 0 (false) and 1 (true), respectively, - ** regardless of the value of expr1. + ** simplify to constants 0 (false) and 1 (true), respectively. + ** + ** Except, do not apply this optimization if expr1 contains a function + ** because that function might be an aggregate (we don't know yet whether + ** it is or not) and if it is an aggregate, that could change the meaning + ** of the whole query. */ - sqlite3ExprUnmapAndDelete(pParse, yymsp[-4].minor.yy590); - yymsp[-4].minor.yy590 = sqlite3Expr(pParse->db, TK_STRING, yymsp[-3].minor.yy502 ? "true" : "false"); - if( yymsp[-4].minor.yy590 ) sqlite3ExprIdToTrueFalse(yymsp[-4].minor.yy590); + Expr *pB = sqlite3Expr(pParse->db, TK_STRING, yymsp[-3].minor.yy502 ? "true" : "false"); + if( pB ) sqlite3ExprIdToTrueFalse(pB); + if( !ExprHasProperty(yymsp[-4].minor.yy590, EP_HasFunc) ){ + sqlite3ExprUnmapAndDelete(pParse, yymsp[-4].minor.yy590); + yymsp[-4].minor.yy590 = pB; + }else{ + yymsp[-4].minor.yy590 = sqlite3PExpr(pParse, yymsp[-3].minor.yy502 ? TK_OR : TK_AND, pB, yymsp[-4].minor.yy590); + } }else{ Expr *pRHS = yymsp[-1].minor.yy402->a[0].pExpr; if( yymsp[-1].minor.yy402->nExpr==1 && sqlite3ExprIsConstant(pParse,pRHS) && yymsp[-4].minor.yy590->op!=TK_VECTOR ){ @@ -181508,7 +181549,7 @@ static int getToken(const unsigned char **pz){ int t; /* Token type to return */ do { z += sqlite3GetToken(z, &t); - }while( t==TK_SPACE ); + }while( t==TK_SPACE || t==TK_COMMENT ); if( t==TK_ID || t==TK_STRING || t==TK_JOIN_KW @@ -246163,9 +246204,9 @@ static void fts5SegIterSetNext(Fts5Index *p, Fts5SegIter *pIter){ ** leave an error in the Fts5Index object. */ static void fts5SegIterAllocTombstone(Fts5Index *p, Fts5SegIter *pIter){ - const int nTomb = pIter->pSeg->nPgTombstone; + const i64 nTomb = (i64)pIter->pSeg->nPgTombstone; if( nTomb>0 ){ - int nByte = SZ_FTS5TOMBSTONEARRAY(nTomb+1); + i64 nByte = SZ_FTS5TOMBSTONEARRAY(nTomb+1); Fts5TombstoneArray *pNew; pNew = (Fts5TombstoneArray*)sqlite3Fts5MallocZero(&p->rc, nByte); if( pNew ){ @@ -257266,7 +257307,7 @@ static void fts5SourceIdFunc( ){ assert( nArg==0 ); UNUSED_PARAM2(nArg, apUnused); - sqlite3_result_text(pCtx, "fts5: 2025-06-28 14:00:48 2af157d77fb1304a74176eaee7fbc7c7e932d946bf25325e9c26c91db19e3079", -1, SQLITE_TRANSIENT); + sqlite3_result_text(pCtx, "fts5: 2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3", -1, SQLITE_TRANSIENT); } /* diff --git a/contrib/sqlite3/sqlite3.h b/contrib/sqlite3/sqlite3.h index f56dd8d86a2d..c2ed750305b2 100644 --- a/contrib/sqlite3/sqlite3.h +++ b/contrib/sqlite3/sqlite3.h @@ -146,9 +146,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.50.2" -#define SQLITE_VERSION_NUMBER 3050002 -#define SQLITE_SOURCE_ID "2025-06-28 14:00:48 2af157d77fb1304a74176eaee7fbc7c7e932d946bf25325e9c26c91db19e3079" +#define SQLITE_VERSION "3.50.4" +#define SQLITE_VERSION_NUMBER 3050004 +#define SQLITE_SOURCE_ID "2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -9058,13 +9058,13 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** [[SQLITE_STMTSTATUS_SORT]]
SQLITE_STMTSTATUS_SORT
**
^This is the number of sort operations that have occurred. ** A non-zero value in this counter may indicate an opportunity to -** improvement performance through careful use of indices.
+** improve performance through careful use of indices. ** ** [[SQLITE_STMTSTATUS_AUTOINDEX]]
SQLITE_STMTSTATUS_AUTOINDEX
**
^This is the number of rows inserted into transient indices that ** were created automatically in order to help joins run faster. ** A non-zero value in this counter may indicate an opportunity to -** improvement performance by adding permanent indices that do not +** improve performance by adding permanent indices that do not ** need to be reinitialized each time the statement is run.
** ** [[SQLITE_STMTSTATUS_VM_STEP]]
SQLITE_STMTSTATUS_VM_STEP
@@ -9073,19 +9073,19 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** to 2147483647. The number of virtual machine operations can be ** used as a proxy for the total work done by the prepared statement. ** If the number of virtual machine operations exceeds 2147483647 -** then the value returned by this statement status code is undefined. +** then the value returned by this statement status code is undefined. ** ** [[SQLITE_STMTSTATUS_REPREPARE]]
SQLITE_STMTSTATUS_REPREPARE
**
^This is the number of times that the prepare statement has been ** automatically regenerated due to schema changes or changes to -** [bound parameters] that might affect the query plan. +** [bound parameters] that might affect the query plan.
** ** [[SQLITE_STMTSTATUS_RUN]]
SQLITE_STMTSTATUS_RUN
**
^This is the number of times that the prepared statement has ** been run. A single "run" for the purposes of this counter is one ** or more calls to [sqlite3_step()] followed by a call to [sqlite3_reset()]. ** The counter is incremented on the first [sqlite3_step()] call of each -** cycle. +** cycle.
** ** [[SQLITE_STMTSTATUS_FILTER_MISS]] ** [[SQLITE_STMTSTATUS_FILTER HIT]] @@ -9095,7 +9095,7 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** step was bypassed because a Bloom filter returned not-found. The ** corresponding SQLITE_STMTSTATUS_FILTER_MISS value is the number of ** times that the Bloom filter returned a find, and thus the join step -** had to be processed as normal. +** had to be processed as normal. ** ** [[SQLITE_STMTSTATUS_MEMUSED]]
SQLITE_STMTSTATUS_MEMUSED
**
^This is the approximate number of bytes of heap memory @@ -9200,9 +9200,9 @@ struct sqlite3_pcache_page { ** SQLite will typically create one cache instance for each open database file, ** though this is not guaranteed. ^The ** first parameter, szPage, is the size in bytes of the pages that must -** be allocated by the cache. ^szPage will always a power of two. ^The +** be allocated by the cache. ^szPage will always be a power of two. ^The ** second parameter szExtra is a number of bytes of extra storage -** associated with each page cache entry. ^The szExtra parameter will +** associated with each page cache entry. ^The szExtra parameter will be ** a number less than 250. SQLite will use the ** extra szExtra bytes on each page to store metadata about the underlying ** database page on disk. The value passed into szExtra depends @@ -9210,17 +9210,17 @@ struct sqlite3_pcache_page { ** ^The third argument to xCreate(), bPurgeable, is true if the cache being ** created will be used to cache database pages of a file stored on disk, or ** false if it is used for an in-memory database. The cache implementation -** does not have to do anything special based with the value of bPurgeable; +** does not have to do anything special based upon the value of bPurgeable; ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will ** never invoke xUnpin() except to deliberately delete a page. ** ^In other words, calls to xUnpin() on a cache with bPurgeable set to ** false will always have the "discard" flag set to true. -** ^Hence, a cache created with bPurgeable false will +** ^Hence, a cache created with bPurgeable set to false will ** never contain any unpinned pages. ** ** [[the xCachesize() page cache method]] ** ^(The xCachesize() method may be called at any time by SQLite to set the -** suggested maximum cache-size (number of pages stored by) the cache +** suggested maximum cache-size (number of pages stored) for the cache ** instance passed as the first argument. This is the value configured using ** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable ** parameter, the implementation is not required to do anything with this @@ -9247,12 +9247,12 @@ struct sqlite3_pcache_page { ** implementation must return a pointer to the page buffer with its content ** intact. If the requested page is not already in the cache, then the ** cache implementation should use the value of the createFlag -** parameter to help it determined what action to take: +** parameter to help it determine what action to take: ** ** **
createFlag Behavior when page is not already in cache **
0 Do not allocate a new page. Return NULL. -**
1 Allocate a new page if it easy and convenient to do so. +**
1 Allocate a new page if it is easy and convenient to do so. ** Otherwise return NULL. **
2 Make every effort to allocate a new page. Only return ** NULL if allocating a new page is effectively impossible. @@ -9269,7 +9269,7 @@ struct sqlite3_pcache_page { ** as its second argument. If the third parameter, discard, is non-zero, ** then the page must be evicted from the cache. ** ^If the discard parameter is -** zero, then the page may be discarded or retained at the discretion of +** zero, then the page may be discarded or retained at the discretion of the ** page cache implementation. ^The page cache implementation ** may choose to evict unpinned pages at any time. ** @@ -9287,7 +9287,7 @@ struct sqlite3_pcache_page { ** When SQLite calls the xTruncate() method, the cache must discard all ** existing cache entries with page numbers (keys) greater than or equal ** to the value of the iLimit parameter passed to xTruncate(). If any -** of these pages are pinned, they are implicitly unpinned, meaning that +** of these pages are pinned, they become implicitly unpinned, meaning that ** they can be safely discarded. ** ** [[the xDestroy() page cache method]] @@ -9586,7 +9586,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** application receives an SQLITE_LOCKED error, it may call the ** sqlite3_unlock_notify() method with the blocked connection handle as ** the first argument to register for a callback that will be invoked -** when the blocking connections current transaction is concluded. ^The +** when the blocking connection's current transaction is concluded. ^The ** callback is invoked from within the [sqlite3_step] or [sqlite3_close] ** call that concludes the blocking connection's transaction. ** @@ -9606,7 +9606,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** blocked connection already has a registered unlock-notify callback, ** then the new callback replaces the old.)^ ^If sqlite3_unlock_notify() is ** called with a NULL pointer as its second argument, then any existing -** unlock-notify callback is canceled. ^The blocked connections +** unlock-notify callback is canceled. ^The blocked connection's ** unlock-notify callback may also be canceled by closing the blocked ** connection using [sqlite3_close()]. ** @@ -10004,7 +10004,7 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...); ** support constraints. In this configuration (which is the default) if ** a call to the [xUpdate] method returns [SQLITE_CONSTRAINT], then the entire ** statement is rolled back as if [ON CONFLICT | OR ABORT] had been -** specified as part of the users SQL statement, regardless of the actual +** specified as part of the user's SQL statement, regardless of the actual ** ON CONFLICT mode specified. ** ** If X is non-zero, then the virtual table implementation guarantees @@ -10038,7 +10038,7 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...); ** [[SQLITE_VTAB_INNOCUOUS]]
SQLITE_VTAB_INNOCUOUS
**
Calls of the form ** [sqlite3_vtab_config](db,SQLITE_VTAB_INNOCUOUS) from within the -** the [xConnect] or [xCreate] methods of a [virtual table] implementation +** [xConnect] or [xCreate] methods of a [virtual table] implementation ** identify that virtual table as being safe to use from within triggers ** and views. Conceptually, the SQLITE_VTAB_INNOCUOUS tag means that the ** virtual table can do no serious harm even if it is controlled by a @@ -10206,7 +10206,7 @@ SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info*,int); **
** ** ^For the purposes of comparing virtual table output values to see if the -** values are same value for sorting purposes, two NULL values are considered +** values are the same value for sorting purposes, two NULL values are considered ** to be the same. In other words, the comparison operator is "IS" ** (or "IS NOT DISTINCT FROM") and not "==". ** @@ -10216,7 +10216,7 @@ SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info*,int); ** ** ^A virtual table implementation is always free to return rows in any order ** it wants, as long as the "orderByConsumed" flag is not set. ^When the -** the "orderByConsumed" flag is unset, the query planner will add extra +** "orderByConsumed" flag is unset, the query planner will add extra ** [bytecode] to ensure that the final results returned by the SQL query are ** ordered correctly. The use of the "orderByConsumed" flag and the ** sqlite3_vtab_distinct() interface is merely an optimization. ^Careful @@ -10313,7 +10313,7 @@ SQLITE_API int sqlite3_vtab_in(sqlite3_index_info*, int iCons, int bHandle); ** sqlite3_vtab_in_next(X,P) should be one of the parameters to the ** xFilter method which invokes these routines, and specifically ** a parameter that was previously selected for all-at-once IN constraint -** processing use the [sqlite3_vtab_in()] interface in the +** processing using the [sqlite3_vtab_in()] interface in the ** [xBestIndex|xBestIndex method]. ^(If the X parameter is not ** an xFilter argument that was selected for all-at-once IN constraint ** processing, then these routines return [SQLITE_ERROR].)^ @@ -10368,7 +10368,7 @@ SQLITE_API int sqlite3_vtab_in_next(sqlite3_value *pVal, sqlite3_value **ppOut); ** and only if *V is set to a value. ^The sqlite3_vtab_rhs_value(P,J,V) ** inteface returns SQLITE_NOTFOUND if the right-hand side of the J-th ** constraint is not available. ^The sqlite3_vtab_rhs_value() interface -** can return an result code other than SQLITE_OK or SQLITE_NOTFOUND if +** can return a result code other than SQLITE_OK or SQLITE_NOTFOUND if ** something goes wrong. ** ** The sqlite3_vtab_rhs_value() interface is usually only successful if @@ -10396,8 +10396,8 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** ** KEYWORDS: {conflict resolution mode} ** ** These constants are returned by [sqlite3_vtab_on_conflict()] to -** inform a [virtual table] implementation what the [ON CONFLICT] mode -** is for the SQL statement being evaluated. +** inform a [virtual table] implementation of the [ON CONFLICT] mode +** for the SQL statement being evaluated. ** ** Note that the [SQLITE_IGNORE] constant is also used as a potential ** return value from the [sqlite3_set_authorizer()] callback and that @@ -10437,39 +10437,39 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** ** [[SQLITE_SCANSTAT_EST]]
SQLITE_SCANSTAT_EST
**
^The "double" variable pointed to by the V parameter will be set to the ** query planner's estimate for the average number of rows output from each -** iteration of the X-th loop. If the query planner's estimates was accurate, +** iteration of the X-th loop. If the query planner's estimate was accurate, ** then this value will approximate the quotient NVISIT/NLOOP and the ** product of this value for all prior loops with the same SELECTID will -** be the NLOOP value for the current loop. +** be the NLOOP value for the current loop.
** ** [[SQLITE_SCANSTAT_NAME]]
SQLITE_SCANSTAT_NAME
**
^The "const char *" variable pointed to by the V parameter will be set ** to a zero-terminated UTF-8 string containing the name of the index or table -** used for the X-th loop. +** used for the X-th loop.
** ** [[SQLITE_SCANSTAT_EXPLAIN]]
SQLITE_SCANSTAT_EXPLAIN
**
^The "const char *" variable pointed to by the V parameter will be set ** to a zero-terminated UTF-8 string containing the [EXPLAIN QUERY PLAN] -** description for the X-th loop. +** description for the X-th loop.
** ** [[SQLITE_SCANSTAT_SELECTID]]
SQLITE_SCANSTAT_SELECTID
**
^The "int" variable pointed to by the V parameter will be set to the ** id for the X-th query plan element. The id value is unique within the ** statement. The select-id is the same value as is output in the first -** column of an [EXPLAIN QUERY PLAN] query. +** column of an [EXPLAIN QUERY PLAN] query.
** ** [[SQLITE_SCANSTAT_PARENTID]]
SQLITE_SCANSTAT_PARENTID
**
The "int" variable pointed to by the V parameter will be set to the -** the id of the parent of the current query element, if applicable, or +** id of the parent of the current query element, if applicable, or ** to zero if the query element has no parent. This is the same value as -** returned in the second column of an [EXPLAIN QUERY PLAN] query. +** returned in the second column of an [EXPLAIN QUERY PLAN] query.
** ** [[SQLITE_SCANSTAT_NCYCLE]]
SQLITE_SCANSTAT_NCYCLE
**
The sqlite3_int64 output value is set to the number of cycles, ** according to the processor time-stamp counter, that elapsed while the ** query element was being processed. This value is not available for ** all query elements - if it is unavailable the output variable is -** set to -1. +** set to -1.
** */ #define SQLITE_SCANSTAT_NLOOP 0 @@ -10510,8 +10510,8 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** ** sqlite3_stmt_scanstatus_v2() with a zeroed flags parameter. ** ** Parameter "idx" identifies the specific query element to retrieve statistics -** for. Query elements are numbered starting from zero. A value of -1 may be -** to query for statistics regarding the entire query. ^If idx is out of range +** for. Query elements are numbered starting from zero. A value of -1 may +** retrieve statistics for the entire query. ^If idx is out of range ** - less than -1 or greater than or equal to the total number of query ** elements used to implement the statement - a non-zero value is returned and ** the variable that pOut points to is unchanged. @@ -10668,8 +10668,8 @@ SQLITE_API int sqlite3_db_cacheflush(sqlite3*); ** triggers; and so forth. ** ** When the [sqlite3_blob_write()] API is used to update a blob column, -** the pre-update hook is invoked with SQLITE_DELETE. This is because the -** in this case the new values are not available. In this case, when a +** the pre-update hook is invoked with SQLITE_DELETE, because +** the new values are not yet available. In this case, when a ** callback made with op==SQLITE_DELETE is actually a write using the ** sqlite3_blob_write() API, the [sqlite3_preupdate_blobwrite()] returns ** the index of the column being written. In other cases, where the @@ -10922,7 +10922,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const c ** For an ordinary on-disk database file, the serialization is just a ** copy of the disk file. For an in-memory database or a "TEMP" database, ** the serialization is the same sequence of bytes which would be written -** to disk if that database where backed up to disk. +** to disk if that database were backed up to disk. ** ** The usual case is that sqlite3_serialize() copies the serialization of ** the database into memory obtained from [sqlite3_malloc64()] and returns @@ -10931,7 +10931,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const c ** contains the SQLITE_SERIALIZE_NOCOPY bit, then no memory allocations ** are made, and the sqlite3_serialize() function will return a pointer ** to the contiguous memory representation of the database that SQLite -** is currently using for that database, or NULL if the no such contiguous +** is currently using for that database, or NULL if no such contiguous ** memory representation of the database exists. A contiguous memory ** representation of the database will usually only exist if there has ** been a prior call to [sqlite3_deserialize(D,S,...)] with the same @@ -11002,7 +11002,7 @@ SQLITE_API unsigned char *sqlite3_serialize( ** database is currently in a read transaction or is involved in a backup ** operation. ** -** It is not possible to deserialized into the TEMP database. If the +** It is not possible to deserialize into the TEMP database. If the ** S argument to sqlite3_deserialize(D,S,P,N,M,F) is "temp" then the ** function returns SQLITE_ERROR. ** @@ -11024,7 +11024,7 @@ SQLITE_API int sqlite3_deserialize( sqlite3 *db, /* The database connection */ const char *zSchema, /* Which DB to reopen with the deserialization */ unsigned char *pData, /* The serialized database content */ - sqlite3_int64 szDb, /* Number bytes in the deserialization */ + sqlite3_int64 szDb, /* Number of bytes in the deserialization */ sqlite3_int64 szBuf, /* Total size of buffer pData[] */ unsigned mFlags /* Zero or more SQLITE_DESERIALIZE_* flags */ ); @@ -11032,7 +11032,7 @@ SQLITE_API int sqlite3_deserialize( /* ** CAPI3REF: Flags for sqlite3_deserialize() ** -** The following are allowed values for 6th argument (the F argument) to +** The following are allowed values for the 6th argument (the F argument) to ** the [sqlite3_deserialize(D,S,P,N,M,F)] interface. ** ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization diff --git a/contrib/sqlite3/sqlite3.pc.in b/contrib/sqlite3/sqlite3.pc.in index a9f941b1e40d..723dd5156390 100644 --- a/contrib/sqlite3/sqlite3.pc.in +++ b/contrib/sqlite3/sqlite3.pc.in @@ -9,5 +9,5 @@ Name: SQLite Description: SQL database engine Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lsqlite3 -Libs.private: @LDFLAGS_MATH@ @LDFLAGS_ZLIB@ @LDFLAGS_ICU@ +Libs.private: @LDFLAGS_MATH@ @LDFLAGS_ZLIB@ @LDFLAGS_DLOPEN@ @LDFLAGS_PTHREAD@ @LDFLAGS_ICU@ Cflags: -I${includedir} diff --git a/contrib/sqlite3/sqlite3rc.h b/contrib/sqlite3/sqlite3rc.h index d412190d370b..42ece488e353 100644 --- a/contrib/sqlite3/sqlite3rc.h +++ b/contrib/sqlite3/sqlite3rc.h @@ -1,3 +1,3 @@ #ifndef SQLITE_RESOURCE_VERSION -#define SQLITE_RESOURCE_VERSION 3,50,2 +#define SQLITE_RESOURCE_VERSION 3,50,4 *** 1 LINES SKIPPED *** From nobody Fri Dec 5 15:09:05 2025 X-Original-To: dev-commits-src-branches@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 4dNFC52RJ2z6HygW for ; Fri, 05 Dec 2025 15:09:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dNFC51Yz5z3txB for ; Fri, 05 Dec 2025 15:09:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764947345; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PtVk9sOFJttiivQbc8zjZHK7z9Jl6TDCRrI7kaLHaDg=; b=SdOri3khm3RW9ffkSXoChTd/ighK6X799u/TSz6LycfR03mr37gyZMlh9QwISWrlyd0pgQ KUXoYGERfbXH4UQHAGAKgIAHIaudg8fyTo9k//qNFJ0OLrjWb0FRCBpE5Ux8n/5Tw1sRFd 5fAVWxT8VGPQbtmSmWtVg7y4JdzN4Vrd2E1rpDrHDhFNAaRyrTO/CwIi5ZHKXQx7ppG65v QkHRKMzzr4R4b3VX/H4yjnPt4yuTVyllyQESYOCazfdts4dMWwC4gLNEN19JmbLNRyzDa3 Q/mrDj6BagOi63KGHgcV7nn0pDILLe/1FGSpPA+ICjnyxK3RpkwCr82qC1BoMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764947345; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PtVk9sOFJttiivQbc8zjZHK7z9Jl6TDCRrI7kaLHaDg=; b=tOlg/dGBYRpXPc7TAp/MX4xagCRt7DbHyQQdld8LlJEukGirbAkVMrP+0jtIa/5UBwppBu 8ueQ9bdCmYguqetMj7rAsHjK4guqqBPm/U2YfGYODB0yL8z7CIctD/AxgbAAeuKB/v7s+A lWcc3qGpIbGAVhxoJzd0uEqJ/tCVR2x4ZbQIoUXgFqEikVewbgRgoZnqlSDOpeW7CvTiBy bNXPGHcRxEWjvoIQTb9fadgFitgKQ1XpGXa+GRpiOAis2VjKjiQLv8eT/KoBOp/t0sE7b7 xUxlL30BRnvhWy+pZWr3RyxmFNLZmpuyBCEESF8fptpRFFCsxAnOLDLmvTtbvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764947345; a=rsa-sha256; cv=none; b=Eb14qzr97I5Yk7fNMjEGddDYzyOgkHl2litMuoSvxRONCQkU4Ajt7GXzuajNrTXAKddFvW HoPWl0aJDTTcOHujFEZrMymFpvcAGzPCJ372bmrd2vSwc/iPkiEFD2/hasq9hbACCGxcoN 1bKYfB2iYqnKnzYTNfYofdNtWhNL/RJMjEg9EvgOBU7LE0UXuJmT02Nt3kGyfDNFCtt77M r+uEj/QSrINNDEYnlkfNI7c6vzCuNtHWXnW35zvhRG2bzgPlZTB7NYUsdPc9thmgnfIi7Z Qn6+WklTXBHGoM1xmsbjg1vAAlmfiZ783R+DcA2fAQaahAHTNVHx/l5FDhjUkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dNFC50vQLzkK for ; Fri, 05 Dec 2025 15:09:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3423c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 05 Dec 2025 15:09:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 844f76c2426d - stable/15 - libc: Simplify __get_locale() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 844f76c2426d079e1fafc1babb0fc087382adfbc Auto-Submitted: auto-generated Date: Fri, 05 Dec 2025 15:09:05 +0000 Message-Id: <6932f591.3423c.42090594@gitrepo.freebsd.org> The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=844f76c2426d079e1fafc1babb0fc087382adfbc commit 844f76c2426d079e1fafc1babb0fc087382adfbc Author: Dag-Erling Smørgrav AuthorDate: 2025-11-26 16:54:52 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-12-05 15:08:55 +0000 libc: Simplify __get_locale() MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: fuz Differential Revision: https://reviews.freebsd.org/D53908 (cherry picked from commit 5af240c54bd2d9548536c904e841499e1651bcc8) --- lib/libc/locale/xlocale_private.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/libc/locale/xlocale_private.h b/lib/libc/locale/xlocale_private.h index ef1a8687a376..4cb323d5fa4c 100644 --- a/lib/libc/locale/xlocale_private.h +++ b/lib/libc/locale/xlocale_private.h @@ -200,11 +200,9 @@ extern _Thread_local locale_t __thread_locale; */ static inline locale_t __get_locale(void) { - - if (!__has_thread_locale) { + if (!__has_thread_locale || __thread_locale == NULL) return (&__xlocale_global_locale); - } - return (__thread_locale ? __thread_locale : &__xlocale_global_locale); + return (__thread_locale); } /** From nobody Fri Dec 5 15:09:06 2025 X-Original-To: dev-commits-src-branches@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 4dNFC6545kz6HyYs for ; Fri, 05 Dec 2025 15:09:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dNFC62cZqz3tvj for ; Fri, 05 Dec 2025 15:09:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764947346; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/qdhW1t5MbkRcIU1GEwqH9IA1v4ch/IVgn44S5Qb2Ms=; b=AFLbp/o7pXBG9XTnBgMRoWqtHscBuSFBPuk514t3cF4H9JdEaPBMsPY3L9J3YoJ1UrR23T nBsL+9jG3XqEqU//QcJzzVV3XAGzrpLHVZQJ0O0otpGyzhDdBCak9q1U2iyT3uM2Lhjl7B k3GTpR4gNop2EBOIM9aFKS745OaLPdQT5BBYZrh52JuWH/4/HU++MPf/y9IhNmeZfrry51 vamMpBwKwqHebnn3KfolOPNyCBgD4YUQX/yJgWXdTAto8Qen6f0wv7UEzit/5tL5BLKORj siHGONObkpc340+Xrh+wzAvEYPCpzv1cmhIQ5Fyg1qp4q3zYLuiQQ/ce9TNYwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764947346; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/qdhW1t5MbkRcIU1GEwqH9IA1v4ch/IVgn44S5Qb2Ms=; b=T6UMUofHVLCwjGy2uX1mQwYVjh142ts4TTETvw0kOj63Hktb1tbNv9nADRRonNkJixgaiV I2O6uiewG9KerwoDk9t453wGro7eSxV7YViNuCh7gL4AfFfnrHdZFIS251tEFwQyW/izag FBfsyfM2DQBfmOaq3T5wvNapJOFCxuUS+dUajiaCIRj+30kGAIAo/erPMo3wJTfLE0o28h uGAw7IqaKIufdmOHH5Tc3tG4RD5/Yw0EC6BYlIKkregxgXCaxsqqe2VgxY0HXOxNE3Goxs kc146xHsjwQEazSo6wMXQoBiZybpJfKzj8TgR6ZabXJbclWGMNjJx8KfwOnybQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764947346; a=rsa-sha256; cv=none; b=TCFE34jijKZA+xQ3SOX1fOrW76MnuIli2c5nfpl8USPcm83J93BQSdz243nXB/ueFzmkJx V8nY174nGLaweD+1NIH+WZYWi56w5OcrR10hS/gR/8LSaV2xPyrqx9zd3y6fjKOu4IQ1B1 ML0+eyruNZqI3iIHd52QFcmUBNhIDGOQZCLCLKnrW+HQuX3IAJbanFNw0JmN9cet9vubUS sn4mIngChxWjika8l5GvCgkrwENub2WIJs3aZlN1XVeeO7TDd9WM+HVTZ035qbdvDfTjka 9P1mnnoyuC/IfqcH539z2uTFvum0fS1Mg/XijpSGJMXQwaSBxYXMoSOdwGHGsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dNFC61pv6zB1 for ; Fri, 05 Dec 2025 15:09:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 327df by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 05 Dec 2025 15:09:06 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 3cbf6473fa1c - stable/15 - bus: Add device_has_children predicate List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 3cbf6473fa1c3ca112d8fea343a0ebd693d10f06 Auto-Submitted: auto-generated Date: Fri, 05 Dec 2025 15:09:06 +0000 Message-Id: <6932f592.327df.3c0f7fd0@gitrepo.freebsd.org> The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=3cbf6473fa1c3ca112d8fea343a0ebd693d10f06 commit 3cbf6473fa1c3ca112d8fea343a0ebd693d10f06 Author: Dag-Erling Smørgrav AuthorDate: 2025-11-28 09:14:31 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-12-05 15:08:55 +0000 bus: Add device_has_children predicate Add a device_has_children() function which can be used to check if a device has children without allocating a list of them which we aren't going to use, or even counting them. Also modify device_get_children() so it can be used to query the count without allocating a list. MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc. Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D53918 (cherry picked from commit 330d4437f2100fc05e576763f4f6a7198080663a) --- share/man/man9/Makefile | 1 + share/man/man9/device_get_children.9 | 47 ++++++++++++++++++++++++++++++------ sys/kern/subr_bus.c | 18 ++++++++++++++ sys/sys/bus.h | 1 + 4 files changed, 59 insertions(+), 8 deletions(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index bdf85363c8e1..11557907d5fe 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1040,6 +1040,7 @@ MLINKS+=devfs_set_cdevpriv.9 devfs_clear_cdevpriv.9 \ MLINKS+=device_add_child.9 device_add_child_ordered.9 MLINKS+=device_enable.9 device_disable.9 \ device_enable.9 device_is_enabled.9 +MLINKS+=device_get_children.9 device_has_children.9 MLINKS+=device_get_ivars.9 device_set_ivars.9 MLINKS+=device_get_name.9 device_get_nameunit.9 MLINKS+=device_get_state.9 device_busy.9 \ diff --git a/share/man/man9/device_get_children.9 b/share/man/man9/device_get_children.9 index f9c36971e9b5..45f8f468531b 100644 --- a/share/man/man9/device_get_children.9 +++ b/share/man/man9/device_get_children.9 @@ -1,6 +1,7 @@ .\" -*- nroff -*- .\" .\" Copyright (c) 1998 Doug Rabson +.\" Copyright (c) 2025 Dag-Erling Smørgrav .\" .\" All rights reserved. .\" @@ -26,21 +27,27 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 23, 2008 +.Dd November 28, 2025 .Dt DEVICE_GET_CHILDREN 9 .Os .Sh NAME -.Nm device_get_children -.Nd get a list of devices connected to a device +.Nm device_get_children , +.Nm device_has_children +.Nd examine devices connected to a device .Sh SYNOPSIS .In sys/param.h .In sys/bus.h .Ft int .Fn device_get_children "device_t dev" "device_t **devlistp" "int *devcountp" +.Ft bool +.Fn device_has_children "device_t dev" .Sh DESCRIPTION -Retrieve a list of all device instances currently connected to -.Pa dev -and return the list in +The +.Nm device_get_children +function retrieves a list of all device instances currently connected +to +.Fa dev . +It returns the list in .Fa *devlistp and the count in .Fa *devcountp . @@ -50,11 +57,35 @@ The memory allocated for the list should be freed using and .Fa devcountp are not changed when an error is returned. +.Pp +As a special case, if +.Fa devlistp +is null, no memory is allocated but the count is still returned in +.Fa *devcountp . +.Pp +The +.Nm device_has_children +function returns +.Dv true +if +.Fa dev +has at least one child and +.Dv false +if it has none. .Sh RETURN VALUES -Zero is returned on success, otherwise an appropriate error is returned. +The +.Nm device_get_children +function returns zero on success and an appropriate error otherwise. +The +.Nm device_has_children +function returns true if the specified device has at least one child +and false otherwise. .Sh SEE ALSO .Xr devclass 9 , .Xr device 9 .Sh AUTHORS +.An -nosplit This manual page was written by -.An Doug Rabson . +.An Doug Rabson Aq Mt dfr@FreeBSD.org +and +.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org . diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index bf5bda7e058d..f75345415265 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -1858,6 +1858,10 @@ device_get_children(device_t dev, device_t **devlistp, int *devcountp) TAILQ_FOREACH(child, &dev->children, link) { count++; } + if (devlistp == NULL) { + *devcountp = count; + return (0); + } if (count == 0) { *devlistp = NULL; *devcountp = 0; @@ -1880,6 +1884,20 @@ device_get_children(device_t dev, device_t **devlistp, int *devcountp) return (0); } +/** + * @brief Check if a device has children + * + * @param dev the device to examine + * + * @rerval true the device has at least one child + * @retval false the device has no children + */ +bool +device_has_children(device_t dev) +{ + return (!TAILQ_EMPTY(&dev->children)); +} + /** * @brief Return the current driver for the device or @c NULL if there * is no driver currently attached diff --git a/sys/sys/bus.h b/sys/sys/bus.h index dda27f4737b2..487d2799221b 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -671,6 +671,7 @@ device_state_t device_get_state(device_t dev); int device_get_unit(device_t dev); struct sysctl_ctx_list *device_get_sysctl_ctx(device_t dev); struct sysctl_oid *device_get_sysctl_tree(device_t dev); +bool device_has_children(device_t dev); int device_has_quiet_children(device_t dev); int device_is_alive(device_t dev); /* did probe succeed? */ int device_is_attached(device_t dev); /* did attach succeed? */ From nobody Fri Dec 5 15:09:07 2025 X-Original-To: dev-commits-src-branches@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 4dNFC759kPz6HyYv for ; Fri, 05 Dec 2025 15:09:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dNFC73hJKz3v6B for ; Fri, 05 Dec 2025 15:09:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764947347; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y3Odj13IbS1AunbGAbBjsfu9BeLIIlTaRo+WIfBZM/c=; b=RX4Ae6L2iHdrSBL18bh79W2i44JUjKb8n22nY13GI4x+K7pKFfvp4oxyk733SqjdSrwSRl rUOyqCKr7dVy6A+a1WBNWvTMQ9lILsQNEiIMPRT7SGtxtIpmQI3pg7s02eJGVwqrNbjXrx 0Q//y4Q97gyEhhYcB6vg9p3kKIPR8DSvu7D+FDW9NtbvgNMUbRIhrg1GE+zHt9wIAzWfwU /NmfK6N3OA+r5yFQxKxTnY+aI/0yO6FOpFzqTcPzX3e0WMlPQRSxX1yC9HDcIkPlcLR+ob SZZHFasaFfNVwYQiPOCZ4nSjPEOOXgec9x7Yx7ci1Vn2+9Ueo/Q/ufxUvHjfbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764947347; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y3Odj13IbS1AunbGAbBjsfu9BeLIIlTaRo+WIfBZM/c=; b=emuk1PvWLFb8ykWb5ijqtGUE7MbKfnhcVb/LvtmomeY8BMdLa73mw2hDdAs5pdvw2LNcLn MpVXt5cybKw2y18JPlvzSOfS5py82pNxIhK4Y4EVifTufWX0I5+JOIvZ2jOE5fnHXubmU2 GJjydcJFm/IuoHjG+ESSlYlVkRLL2QisMLkDrAw+GOwWR3fnFtKvG+vlb3V9IouQiBJ2kg ycGoS6ktuDoO2YNZw5QwlmtMb/2Zi6y7hwdHKK/A0ZykrR80VxUfSQl1txojdFoPmxhKma /E9Z6JSGqDGToyaAQfyNnSaAqn+d5wskvSPX6w8io18IhAlgBZllGnzmP6MndQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764947347; a=rsa-sha256; cv=none; b=VRH1TbDaRMdSVACS7irdv+z8l7n1sTOMOKsRo3cTS6NxvBwh+O/SDgs9o1GV/jUhfPiNbs iQPOruB7cbF2W96K+rmODaYq0/qcDmvHFz/WjMVj1DjVS/YY7Qlm1J32fTwAVIsOWZuSgp X396jMSGmLy+eH3RBssNaUY0bHbjZm1yFxkXQwJl+RN54Pa5rgb781fnnBmoYFPTeHzk+o CtZf7yuvyGgtiAIiJ8yvOs7X5otZurn5+nXKcXSCYgOPb+ln9L1pW5apudpL2Pr4uMLuQo 2TsQ5gG/80nCQr6MJgvxLTt4GkmByPSgj0zVDZMrdK2FsyXUIsfaDknlphCy8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dNFC731NKzsG for ; Fri, 05 Dec 2025 15:09:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 327e3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 05 Dec 2025 15:09:07 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 68c9bf7b2c8a - stable/15 - bus: Apply consistent style to prototypes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 68c9bf7b2c8ab9f0860966d4c4079ecba140fe54 Auto-Submitted: auto-generated Date: Fri, 05 Dec 2025 15:09:07 +0000 Message-Id: <6932f593.327e3.408a2f12@gitrepo.freebsd.org> The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=68c9bf7b2c8ab9f0860966d4c4079ecba140fe54 commit 68c9bf7b2c8ab9f0860966d4c4079ecba140fe54 Author: Dag-Erling Smørgrav AuthorDate: 2025-11-28 09:16:14 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-12-05 15:08:55 +0000 bus: Apply consistent style to prototypes Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc. (cherry picked from commit 6facc476f3056037f8b5cdb5546554ab3a887463) --- sys/sys/bus.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/sys/bus.h b/sys/sys/bus.h index 487d2799221b..40b9e53ba039 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -705,7 +705,7 @@ void device_unbusy(device_t dev); void device_verbose(device_t dev); ssize_t device_get_property(device_t dev, const char *prop, void *val, size_t sz, device_property_type_t type); -bool device_has_property(device_t dev, const char *prop); +bool device_has_property(device_t dev, const char *prop); /* * Access functions for devclass. @@ -818,10 +818,10 @@ int bus_get_pass(void); * Routines to lock / unlock the newbus lock. * Must be taken out to interact with newbus. */ -void bus_topo_lock(void); -void bus_topo_unlock(void); +void bus_topo_lock(void); +void bus_topo_unlock(void); struct mtx * bus_topo_mtx(void); -void bus_topo_assert(void); +void bus_topo_assert(void); /** * Shorthands for constructing method tables. @@ -914,17 +914,17 @@ static __inline void varp ## _set_ ## var(device_t dev, type t) \ struct device_location_cache; typedef struct device_location_cache device_location_cache_t; device_location_cache_t *dev_wired_cache_init(void); -void dev_wired_cache_fini(device_location_cache_t *dcp); -bool dev_wired_cache_match(device_location_cache_t *dcp, device_t dev, const char *at); +void dev_wired_cache_fini(device_location_cache_t *dcp); +bool dev_wired_cache_match(device_location_cache_t *dcp, device_t dev, const char *at); #define DEV_PROP_NAME_IOMMU "iommu-unit" typedef void (*device_prop_dtr_t)(device_t dev, const char *name, void *val, void *dtr_ctx); -int device_set_prop(device_t dev, const char *name, void *val, +int device_set_prop(device_t dev, const char *name, void *val, device_prop_dtr_t dtr, void *dtr_ctx); -int device_get_prop(device_t dev, const char *name, void **valp); -int device_clear_prop(device_t dev, const char *name); -void device_clear_prop_alldev(const char *name); +int device_get_prop(device_t dev, const char *name, void **valp); +int device_clear_prop(device_t dev, const char *name); +void device_clear_prop_alldev(const char *name); /** * Shorthand macros, taking resource argument From nobody Fri Dec 5 15:09:08 2025 X-Original-To: dev-commits-src-branches@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 4dNFC85jlNz6HyW2 for ; Fri, 05 Dec 2025 15:09:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dNFC843cYz3v6M for ; Fri, 05 Dec 2025 15:09:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764947348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6peKZK9MSOSUGMKvKnsvJ2PS1Y6ItxVq/jHgEm6YejI=; b=oBsm7KuczL3sRQajK5j4/PTZ7y4zKg6aphADzqbpd6ACt2UJR4CeY+0XpChFRewBhZUFfr unUhn01Yz6osvT72LGcOIGfZt63ILpKU5JTMkJfCfgR9UErNE4vK+224o/7/GD8xgk525Y 9d2UGc3ay4RLplHuBE3LufZcBeoC/E70N7MGXDIdfeI38iPvNq5yhwwjQ79Fw/07JEg/K5 yIQCyaMtv2UC83en7lKLppRjTeZ+lOidzjKqCkQkXbeNhyysl6seYk05FQZ32GHrxc0AvF LExdS70NZbsjFYnuiXtCkrf9boElrN/y9wHnqcwN1iWIIIB9/PnaZJ5HeASi2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764947348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6peKZK9MSOSUGMKvKnsvJ2PS1Y6ItxVq/jHgEm6YejI=; b=PzCrZfh3qxVpfBB+qZbn//IW4gC8RTbhwiNWUssgsyiZMg4D0a3BAxbmLO1ExkCG86CF9z IfFErA6qEffG1Qu/6++YH/uR1ImV6cFyeaKzgV94TExzPlJgNzu38XrEnmk89rQojwf0GY d7So5j/fsJbyj8UqFpyooeQErBwhnrpLV0wIWDgllsOU0kgRXvv8pgfH61AFR2mRSZGE3W EbJ6p0xFxA1QxpCyg1iljYC9DrrmqSCXi21z+SkKgj1qw1BV4cH4QoLrgYw3P6DN0d5IvV hJ5a98+crRtPAzy7i51nsQBoMkShZRbeBLDzlJGxiWPCKO7RPpW0+Ti54xvC8Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764947348; a=rsa-sha256; cv=none; b=juulfGk8lqzgMoWbwk4spfv2cXTGanIh8sGc/mkB05iAVGszE7eWH5O2NpH1K0zU1LWi4d mxsvNDZ92EgHcjxe9Tksnm7p9LxhtwD97aciUZkUYs0FEVtrhGpAjJMrAE11H3FbAyKdMr nvta+jAYQ7Inh0ctQOFskTl0eTYsxhY+GtD8Ye93aP5bujK87Ar/JqY3yssEdgTye78mqz HIjvSFNmXVE0VsXMNveLU0P3iLyr72oUQ+ISgDSyp9BwYGvUf7ShgdtSfKLBG4HuiqykH7 f6sy1GaQ3bFEMQi1StZ8hz/ZY+kxe86V2i1HwK4p/8+fGMv6OmeF8+2bkceLrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dNFC838vfzPC for ; Fri, 05 Dec 2025 15:09:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 31ddd by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 05 Dec 2025 15:09:08 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 74b10f0b5760 - stable/15 - rtld-elf: Mark LD_SHOW_AUXV insecure List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 74b10f0b57600dffa4eb81eaa40dbbfb8c5c3a1f Auto-Submitted: auto-generated Date: Fri, 05 Dec 2025 15:09:08 +0000 Message-Id: <6932f594.31ddd.4f9efc0a@gitrepo.freebsd.org> The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=74b10f0b57600dffa4eb81eaa40dbbfb8c5c3a1f commit 74b10f0b57600dffa4eb81eaa40dbbfb8c5c3a1f Author: Dag-Erling Smørgrav AuthorDate: 2025-12-03 10:09:31 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-12-05 15:08:55 +0000 rtld-elf: Mark LD_SHOW_AUXV insecure This prevents dumping the memory layout of setugid processes. MFC after: 3 days Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D54033 (cherry picked from commit 5242bcff202fa2a5a39895423c8d8c11c02ad76a) --- libexec/rtld-elf/rtld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index bdfff7361e96..8ac897508870 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -395,7 +395,7 @@ static struct ld_env_var_desc ld_env_vars[] = { LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT1, false), LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT2, false), LD_ENV_DESC(TRACE_LOADED_OBJECTS_ALL, false), - LD_ENV_DESC(SHOW_AUXV, false), + LD_ENV_DESC(SHOW_AUXV, true), LD_ENV_DESC(STATIC_TLS_EXTRA, false), LD_ENV_DESC(NO_DL_ITERATE_PHDR_AFTER_FORK, false), }; From nobody Fri Dec 5 18:28:38 2025 X-Original-To: dev-commits-src-branches@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 4dNKdM1MSVz6JFh8 for ; Fri, 05 Dec 2025 18:28:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dNKdL6Mnwz3SqS for ; Fri, 05 Dec 2025 18:28:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764959318; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A0ELJrZ8QfuvvDW05rf6+l6SlXtu52y1jQsOELZD6fA=; b=g4pDfGvAThKRO4m3hjxD08TqQAbU5PCU30EE6kPDmNAjutAY02IUAjBfgx2uPfXPsde8f5 xA7gzXP7ZVk+9gECaW5m6Y5xp0j8EVZgVPZ4R7vk+6/m991DnhL2kEpP3GpfpDrHP4gwX+ 9t1CPAZOhbFQ8hSX6PciUPs9artymxfwsW090G0OYPf1qNpOKZtqu+n75mpgU5CrIMtObH wmj49ECvZAxYbwyA/CPPeCmhNXBKLpowOejANzU7COhBrGqJo5NR5bla5RMMfCTq4Inaae +xdiRwtuN/rNdMbtnoeuH6b8b6OaxjgbY7QEu6kLqE5TegUuau/LxcJa7t9sOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764959318; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A0ELJrZ8QfuvvDW05rf6+l6SlXtu52y1jQsOELZD6fA=; b=XKrVoOkf5HNXrupsSWpT+YG92rUSr0SIz8CjxL6H2ZjOhR18gejI0Q/oIs1I/L/3Jlrq2M SoFZFl3h8ZDjK0qlrtER2utWUxwiRjs4xXBH3tlDApoEzdWC1Wj0hXv1NJ1gBsV2wAsoOW Sp/3A7UbDGX4MBOf0VsIkxVbtq0hpHjN6VyxrXYUAptEjw7jxPwKSzk/+r/drFRDFqKl0+ pcVmeRfslj88QqgB+cBIfKgvNbDtwAYP+TcRDOEJYLfqmEXsdlQJmaRGk3T8RwQaUimmpC Fx1+EaxU8d8VCudfK5qNDrUFTQ9wEJURvXCAh2pKGZ7daM6iiCHW/gF5vFIS4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764959318; a=rsa-sha256; cv=none; b=bXgwy0jkaWENVP6XntZCphwEAv5T2oALqNN3nNl4gCi3W6BxgM+1y48GHxtgyDBzsBfBwp yTPqKRWXLpbo0boHPKwgYRw9fPqcIWXHf/GgK+fYGZWn9QIsIuj5jr6UuhJCcUk/+Ch8TL /biDWmO9NDEy0K57mIWmiaRC18aFeWp3yqSgTscmcUUzA2WF8Sy1f7YxzzkbVQ2dlpq3P1 N7NEqEx7zjYAZggLk7gkUqdiZlL1au8i6kviq6XOaaC+RgKjeCeAC3Faky0WmwCp6C815+ fyo83ZJxr/NSXQe9N1fvAOwdDFQI0TrA8a4tRPOovUxR7DA3BZHVhF7kkUmrUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dNKdL5Hsxz6BH for ; Fri, 05 Dec 2025 18:28:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id cb7d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 05 Dec 2025 18:28:38 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 8787b699b036 - stable/14 - libc: Simplify __get_locale() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8787b699b036bdd99ee42a98577a7a291da9ab91 Auto-Submitted: auto-generated Date: Fri, 05 Dec 2025 18:28:38 +0000 Message-Id: <69332456.cb7d.4edc73bd@gitrepo.freebsd.org> The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=8787b699b036bdd99ee42a98577a7a291da9ab91 commit 8787b699b036bdd99ee42a98577a7a291da9ab91 Author: Dag-Erling Smørgrav AuthorDate: 2025-11-26 16:54:52 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-12-05 10:58:57 +0000 libc: Simplify __get_locale() MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: fuz Differential Revision: https://reviews.freebsd.org/D53908 (cherry picked from commit 5af240c54bd2d9548536c904e841499e1651bcc8) --- lib/libc/locale/xlocale_private.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/libc/locale/xlocale_private.h b/lib/libc/locale/xlocale_private.h index ef1a8687a376..4cb323d5fa4c 100644 --- a/lib/libc/locale/xlocale_private.h +++ b/lib/libc/locale/xlocale_private.h @@ -200,11 +200,9 @@ extern _Thread_local locale_t __thread_locale; */ static inline locale_t __get_locale(void) { - - if (!__has_thread_locale) { + if (!__has_thread_locale || __thread_locale == NULL) return (&__xlocale_global_locale); - } - return (__thread_locale ? __thread_locale : &__xlocale_global_locale); + return (__thread_locale); } /** From nobody Fri Dec 5 18:28:39 2025 X-Original-To: dev-commits-src-branches@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 4dNKdN13kbz6JFmJ for ; Fri, 05 Dec 2025 18:28:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dNKdM6fwJz3Sng for ; Fri, 05 Dec 2025 18:28:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764959319; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DkWlvLl61AJgfUgwjYAdLmncFzmWJzBLNhFAnEKt3Qs=; b=Yy9FxcE2DX8ZH1+FsS41nHzyvVH43RRqz+TkPfOjAiCJwIxAn4Ho2pkUF7+JttCb6RxJIb GpjEMetFbyGMUezm1ZsWWlIlkKFp0QHHslujrea8eEjYodZDzmLHtePVeMLYMI8ASglxP2 zCJt7WqftCSM05pVLU632IVZr2abJpe7tpqnjQiDntWeASsy4D4tA4HTrOKuDRMzkHJeqg k4DhMHL4CZVks3VXaWNQg+RWNDIgPaMd4nxRVflxTAIvSGqH4pi6nejgDKwvhd8Uu2fuF0 XPFgWV5VCUkEXPcIuMkqt7/3wgpu93ryAHdAFlkrIP65yqDi4biIbOW9S2i6Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764959319; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DkWlvLl61AJgfUgwjYAdLmncFzmWJzBLNhFAnEKt3Qs=; b=AH3evhow5mbLgVAw9ssylKLC3JaQnhSn+wo3vGK7qu3DE10wxywRN9kO5hpSM8lrIx7O5P nqjMWEeumw0iDT7moX/2bYr2sNiQt89jT6K+3Kpytf03TEBNM2ywbkZE/IN/PBvOX7a0qH jSZ54tggbb9fzpaOjIzGY2vxsyY17bkXK8sg7gG1IJQtCIc+uLgW/q4qFPHaXRq8yjx1sq ppDtIXwqzW521T6w3lIU4iuwEDoopB+jBQDbTYpbiziZjdiO2voP9nVKrEP+673WuRtWLb 3XBtA6bx4NVhdcmmiGjrTImVkMN8TMPBQXQMMO9iyYDBBb8W4/b0cQM2O0ukXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764959319; a=rsa-sha256; cv=none; b=XltSMvloN0sJAHVdgYw6vVsA/d9nGyP5Wjx4EiGz2LU7NnLaBTn+YFoHIzWckca4ogBkTd 8F9yuYg7otHLwNg6Aea3EkHoqhr41SIafTJ6J52r11Qz+uWtDlALFGj/ff9voa96NlTwwV X2nZN6FWiW4TgmKoGnj70RwaAypa/UjxnC3z6TE4CgiNNaIfuSL2Cv+6INgVn8bevnnWVt Tyix6QPl/kqNuCRjAXS68YtGXp1FCbcGTxhrdqro0wmImP5rqtBk2aUmftWSOkrzuAjIut v787AW6MM2ihK3onpJ+5XQqyxgP8cOwV8kTbzevTIpALVo56DLuUetCKQGYzLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dNKdM68HFz62b for ; Fri, 05 Dec 2025 18:28:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id f09a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 05 Dec 2025 18:28:39 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: c0aeb34d5044 - stable/14 - bus: Add device_has_children predicate List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c0aeb34d5044f2549572bd3e49468e7df6079d28 Auto-Submitted: auto-generated Date: Fri, 05 Dec 2025 18:28:39 +0000 Message-Id: <69332457.f09a.6482bd0b@gitrepo.freebsd.org> The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=c0aeb34d5044f2549572bd3e49468e7df6079d28 commit c0aeb34d5044f2549572bd3e49468e7df6079d28 Author: Dag-Erling Smørgrav AuthorDate: 2025-11-28 09:14:31 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-12-05 10:58:57 +0000 bus: Add device_has_children predicate Add a device_has_children() function which can be used to check if a device has children without allocating a list of them which we aren't going to use, or even counting them. Also modify device_get_children() so it can be used to query the count without allocating a list. MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc. Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D53918 (cherry picked from commit 330d4437f2100fc05e576763f4f6a7198080663a) --- share/man/man9/Makefile | 1 + share/man/man9/device_get_children.9 | 47 ++++++++++++++++++++++++++++++------ sys/kern/subr_bus.c | 18 ++++++++++++++ sys/sys/bus.h | 1 + 4 files changed, 59 insertions(+), 8 deletions(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 148470e0934f..a0af571a4e9b 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1031,6 +1031,7 @@ MLINKS+=devfs_set_cdevpriv.9 devfs_clear_cdevpriv.9 \ MLINKS+=device_add_child.9 device_add_child_ordered.9 MLINKS+=device_enable.9 device_disable.9 \ device_enable.9 device_is_enabled.9 +MLINKS+=device_get_children.9 device_has_children.9 MLINKS+=device_get_ivars.9 device_set_ivars.9 MLINKS+=device_get_name.9 device_get_nameunit.9 MLINKS+=device_get_state.9 device_busy.9 \ diff --git a/share/man/man9/device_get_children.9 b/share/man/man9/device_get_children.9 index f9c36971e9b5..45f8f468531b 100644 --- a/share/man/man9/device_get_children.9 +++ b/share/man/man9/device_get_children.9 @@ -1,6 +1,7 @@ .\" -*- nroff -*- .\" .\" Copyright (c) 1998 Doug Rabson +.\" Copyright (c) 2025 Dag-Erling Smørgrav .\" .\" All rights reserved. .\" @@ -26,21 +27,27 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 23, 2008 +.Dd November 28, 2025 .Dt DEVICE_GET_CHILDREN 9 .Os .Sh NAME -.Nm device_get_children -.Nd get a list of devices connected to a device +.Nm device_get_children , +.Nm device_has_children +.Nd examine devices connected to a device .Sh SYNOPSIS .In sys/param.h .In sys/bus.h .Ft int .Fn device_get_children "device_t dev" "device_t **devlistp" "int *devcountp" +.Ft bool +.Fn device_has_children "device_t dev" .Sh DESCRIPTION -Retrieve a list of all device instances currently connected to -.Pa dev -and return the list in +The +.Nm device_get_children +function retrieves a list of all device instances currently connected +to +.Fa dev . +It returns the list in .Fa *devlistp and the count in .Fa *devcountp . @@ -50,11 +57,35 @@ The memory allocated for the list should be freed using and .Fa devcountp are not changed when an error is returned. +.Pp +As a special case, if +.Fa devlistp +is null, no memory is allocated but the count is still returned in +.Fa *devcountp . +.Pp +The +.Nm device_has_children +function returns +.Dv true +if +.Fa dev +has at least one child and +.Dv false +if it has none. .Sh RETURN VALUES -Zero is returned on success, otherwise an appropriate error is returned. +The +.Nm device_get_children +function returns zero on success and an appropriate error otherwise. +The +.Nm device_has_children +function returns true if the specified device has at least one child +and false otherwise. .Sh SEE ALSO .Xr devclass 9 , .Xr device 9 .Sh AUTHORS +.An -nosplit This manual page was written by -.An Doug Rabson . +.An Doug Rabson Aq Mt dfr@FreeBSD.org +and +.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org . diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 28d37ad8d450..ce7209e5f852 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -1855,6 +1855,10 @@ device_get_children(device_t dev, device_t **devlistp, int *devcountp) TAILQ_FOREACH(child, &dev->children, link) { count++; } + if (devlistp == NULL) { + *devcountp = count; + return (0); + } if (count == 0) { *devlistp = NULL; *devcountp = 0; @@ -1877,6 +1881,20 @@ device_get_children(device_t dev, device_t **devlistp, int *devcountp) return (0); } +/** + * @brief Check if a device has children + * + * @param dev the device to examine + * + * @rerval true the device has at least one child + * @retval false the device has no children + */ +bool +device_has_children(device_t dev) +{ + return (!TAILQ_EMPTY(&dev->children)); +} + /** * @brief Return the current driver for the device or @c NULL if there * is no driver currently attached diff --git a/sys/sys/bus.h b/sys/sys/bus.h index 91a54b93a1db..c6ed86dc2545 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -684,6 +684,7 @@ device_state_t device_get_state(device_t dev); int device_get_unit(device_t dev); struct sysctl_ctx_list *device_get_sysctl_ctx(device_t dev); struct sysctl_oid *device_get_sysctl_tree(device_t dev); +bool device_has_children(device_t dev); int device_has_quiet_children(device_t dev); int device_is_alive(device_t dev); /* did probe succeed? */ int device_is_attached(device_t dev); /* did attach succeed? */ From nobody Fri Dec 5 18:28:40 2025 X-Original-To: dev-commits-src-branches@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 4dNKdP403rz6JFpn for ; Fri, 05 Dec 2025 18:28:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dNKdP0vcdz3Snp for ; Fri, 05 Dec 2025 18:28:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764959321; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XXFhnT53qZ5oK7FP+NNsFKwUbgwFaxpgqG4Ff+uajec=; b=Q33mnvAVNhipjKPkQh7vlsEiIY+Yj+GLMygeCPMQKuUBjouoWE8JKX40WIcTNmHqfxQ/t9 Sb8yMGw8+EiztB+VmXLoJf7ve2hazEP/zT2wVVeHKA/0ck429iFIUE/SaafHWrzoqHVBG/ uwwt3FwyszFTsRc26z0hdk3wl6b6z8Xr+19VBkPYA7uHqEBhLVGPYVLN1k6U75Ng/JIsPI De9ci41F7J5pxGyxfdY9OcLRC9AbbX6YyfBPjO5aPW354o3xBbkbmVLGei4ARIF2U/qYE6 fHzLL8ATNNVlGyQrtYnwSHLfqRqr+8zH4qIM2/yG1Y8jVYil9szrr05IeBewSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764959321; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XXFhnT53qZ5oK7FP+NNsFKwUbgwFaxpgqG4Ff+uajec=; b=pHEw8NDIQD6rbfX82aJ7BCj/WqnHwURgefsDIajOQiIPgc3iJs5uaXV9MCH+Spwr7BrJyG qzciK6BpfAOlsdSHGNvFLqWtzMwPx/RnJ9PLFDm5ortoktCm7/S93CG8N1l0aToisKDWqJ reqelOdiBrw1tXPKtijhIFjLHU+0X8+JfneSM6DQGlKLONL8ylktiVhHVaIDLS1qms1gK5 4SZFNOKpcI55VnX+PHPIXQvEumQX5LNvT8RS34QuHZaiVM5X1ndsxMr73xFi/rlaDpI3qr Ts0XuaYc6mPGwAjzX2Vvbx2Kl/Upi9Du8KZZFyQ8EQNbXWxoe1fpH/VggTJZbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764959321; a=rsa-sha256; cv=none; b=OPOrAZ24tM9n/GEZKmzZU5SIVTLYH9sA2TulDRivotY3R/z5JP0nAer9U/zAxTaTwy2Jcn uQokdpOT8wEw2jTrrX3zk1yGQzl8EhARM9g2skuMBv8/Ax3VaJw0vu0AherPClDEYHC00C tRV1b/ZXNxz1WIqzr8cpjiYIv4N2XIlL6n66zMopoBQgd1fmstKc2fHFynSgPUTlW7eu3F WTHVMSEhzXHX6q3Pk9ZaFHKdXz3I38/A6GOyjL7dSDyfhfAgHhSW/M7M8DfSrorshTonLe GeK4b+Gx0lzj0c5iuoxYl6Zc9tc2kXTrEcx+h+QSJZOXs1f4KnAnGwG2WlL2Pg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dNKdN6xPPz68F for ; Fri, 05 Dec 2025 18:28:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id dadb by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 05 Dec 2025 18:28:40 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 07f9d9cb9a2f - stable/14 - bus: Apply consistent style to prototypes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 07f9d9cb9a2f6ed94bb1db067e2ab94056b2af81 Auto-Submitted: auto-generated Date: Fri, 05 Dec 2025 18:28:40 +0000 Message-Id: <69332458.dadb.1e702c8c@gitrepo.freebsd.org> The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=07f9d9cb9a2f6ed94bb1db067e2ab94056b2af81 commit 07f9d9cb9a2f6ed94bb1db067e2ab94056b2af81 Author: Dag-Erling Smørgrav AuthorDate: 2025-11-28 09:16:14 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-12-05 10:58:57 +0000 bus: Apply consistent style to prototypes Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc. (cherry picked from commit 6facc476f3056037f8b5cdb5546554ab3a887463) --- sys/sys/bus.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/sys/bus.h b/sys/sys/bus.h index c6ed86dc2545..90db267d4bb2 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -718,7 +718,7 @@ void device_unbusy(device_t dev); void device_verbose(device_t dev); ssize_t device_get_property(device_t dev, const char *prop, void *val, size_t sz, device_property_type_t type); -bool device_has_property(device_t dev, const char *prop); +bool device_has_property(device_t dev, const char *prop); /* * Access functions for devclass. @@ -833,10 +833,10 @@ void bus_set_pass(int pass); * Routines to lock / unlock the newbus lock. * Must be taken out to interact with newbus. */ -void bus_topo_lock(void); -void bus_topo_unlock(void); +void bus_topo_lock(void); +void bus_topo_unlock(void); struct mtx * bus_topo_mtx(void); -void bus_topo_assert(void); +void bus_topo_assert(void); /** * Shorthands for constructing method tables. @@ -928,17 +928,17 @@ static __inline void varp ## _set_ ## var(device_t dev, type t) \ struct device_location_cache; typedef struct device_location_cache device_location_cache_t; device_location_cache_t *dev_wired_cache_init(void); -void dev_wired_cache_fini(device_location_cache_t *dcp); -bool dev_wired_cache_match(device_location_cache_t *dcp, device_t dev, const char *at); +void dev_wired_cache_fini(device_location_cache_t *dcp); +bool dev_wired_cache_match(device_location_cache_t *dcp, device_t dev, const char *at); #define DEV_PROP_NAME_IOMMU "iommu-unit" typedef void (*device_prop_dtr_t)(device_t dev, const char *name, void *val, void *dtr_ctx); -int device_set_prop(device_t dev, const char *name, void *val, +int device_set_prop(device_t dev, const char *name, void *val, device_prop_dtr_t dtr, void *dtr_ctx); -int device_get_prop(device_t dev, const char *name, void **valp); -int device_clear_prop(device_t dev, const char *name); -void device_clear_prop_alldev(const char *name); +int device_get_prop(device_t dev, const char *name, void **valp); +int device_clear_prop(device_t dev, const char *name); +void device_clear_prop_alldev(const char *name); /** * Shorthand macros, taking resource argument From nobody Fri Dec 5 18:28:42 2025 X-Original-To: dev-commits-src-branches@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 4dNKdQ4pVpz6JFhH for ; Fri, 05 Dec 2025 18:28:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dNKdQ1B1Fz3Sft for ; Fri, 05 Dec 2025 18:28:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764959322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VRXCHzCvFvMGZ+zhkrlymTfMcEOexjIYbf3VnaovArA=; b=KOQaHA/t5oyKr72kQSSSDnoGufNdUw4Wr/xARo5E5+pyqCZsMvcnWvFaA73x0MhrSc2dYM 7HK8gVBPhSnmZmMZp4jnNI1Zj4beVxJVWC77u+Bp3Bf9qZjgK/J7O8b1xLuMf2aoaGS1+m Mk9/89TFsZLz5O+Yg4f4iUh/V1jxpMeqIOV8pkmoWEzSgRhw0VYxinA6XYYu3REOM0lff3 COMk2aHtnGTRxbbde4O6T3NdX/VJpWHJygoEl67T780Bm0FKMM2kp3Harm9/IyHQVlSrri HDAGDGrMoQ3wriAzIh1DM+FiWYnipzmbDtOOCLGngfOb72YJX1R4KHCE1mWsug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764959322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VRXCHzCvFvMGZ+zhkrlymTfMcEOexjIYbf3VnaovArA=; b=wtBXjGIQv4olmuATnu8/+N7xOjjBHQG6RkoS97yxvYK0HGBeMSmEdoWIFyI1eEQB1xXLie Z3vvkHsm5dArOpoZVJ5BniTW0jPtI6tkDlQm1kqBOnEt1ORJ37YwzV9gg+YndMExJIfktO I+AY4DYlFnmBT/IzwU/3f18RHmXM78+WlEd8GkbiA5tRe2W46dXHf6CFF6rH8/O1rG8L+4 iQiCXN/Zs0051SUiq1mvNXyj19gtzI8wA1L0qxlgLgzgOqqp/N2yEDx86h0i15b2xsuG4g zP0S9llonbM5AGQuqpZnNp/bKZVruafYDZMzTiSKDhmg/PI9SbLAZndYsXsMoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764959322; a=rsa-sha256; cv=none; b=Pgm95wM/949WPpKJnAXSnWmGGpJ1hXi1HFBd8g2GNR3d4N23FfYABs9dGPRoHE9dubN1SZ xNsF+qd3RtS5j2bmiKET6Z9XjvSAfydqdvL6FnBPWpK/el7vDvUY89ee4a1BppfRJ80KJ3 iUDVKJu4P83dOAWHEowBfY3RJPeryUZLhddqz3N7vfDPhw1mrxD34TCTI0pIadbgCdgDVe sZM/yTstFFBH1NrgE2bc3zb6Qc8MCMKLJhW5HZb/b7KSl47AZs5sCKBei4HZesDs9HjIbw eHTVr6WqUOo6KirkDB3j4YZXlyvokbL7JXzAbAlQYo9f3TI+HshjdFJ1G3rx3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dNKdQ0jz4z5X5 for ; Fri, 05 Dec 2025 18:28:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id dd3a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 05 Dec 2025 18:28:42 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 307a6241d05a - stable/14 - rtld-elf: Mark LD_SHOW_AUXV insecure List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 307a6241d05ab8280a821767261b2ff194662b3b Auto-Submitted: auto-generated Date: Fri, 05 Dec 2025 18:28:42 +0000 Message-Id: <6933245a.dd3a.3f86627c@gitrepo.freebsd.org> The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=307a6241d05ab8280a821767261b2ff194662b3b commit 307a6241d05ab8280a821767261b2ff194662b3b Author: Dag-Erling Smørgrav AuthorDate: 2025-12-03 10:09:31 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-12-05 10:58:57 +0000 rtld-elf: Mark LD_SHOW_AUXV insecure This prevents dumping the memory layout of setugid processes. MFC after: 3 days Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D54033 (cherry picked from commit 5242bcff202fa2a5a39895423c8d8c11c02ad76a) --- libexec/rtld-elf/rtld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 7120cc176b04..a49d2a6301d2 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -387,7 +387,7 @@ static struct ld_env_var_desc ld_env_vars[] = { LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT1, false), LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT2, false), LD_ENV_DESC(TRACE_LOADED_OBJECTS_ALL, false), - LD_ENV_DESC(SHOW_AUXV, false), + LD_ENV_DESC(SHOW_AUXV, true), LD_ENV_DESC(STATIC_TLS_EXTRA, false), LD_ENV_DESC(NO_DL_ITERATE_PHDR_AFTER_FORK, false), }; From nobody Fri Dec 5 18:28:49 2025 X-Original-To: dev-commits-src-branches@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 4dNKdY3r2zz6JFhM for ; Fri, 05 Dec 2025 18:28:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dNKdY2QPCz3T87 for ; Fri, 05 Dec 2025 18:28:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764959329; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TloI32dBivhkuZuKdbXTeif0gZ05t7XsiuopUGeqE2Q=; b=phgfEv8pmUcXe95/r/8ZnSZIKSrKofsUwRBdvmX4tQGCiCXjJGzuH1o8O0RN0u/aUm5pDY LCuceFcfST+MTqY6xPiN5tf0S8I2G7/b3hrtQljK+ZlWYGTAuGcbg9/zAK0Wjavj17etCd yXNhdPd82JSbwZOqpqMiLTnOWVZBh5VrSbViJhW9HpuM8eTnpJixZBr4ZW9WxzY7K6MOlk rYxEEZ6ZyaEfYSrQlWz6RsQWyzozOKfyeZfDz/tMLeBslURPtpiVSYoWC/bn8hBk7O5gSE vymPpIrOfozwnhfUBHU4i+J1e/eqMgYemKfKjnh2EKj9EIVvb7GEX1iV2jaw3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764959329; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TloI32dBivhkuZuKdbXTeif0gZ05t7XsiuopUGeqE2Q=; b=J2tBlgmJZ9hykCeKojYFsBBJpZZu35e9xrA3KfvJsMfZUDbGOl5vahiqquE9ZVzZy39+YF edEIGePO0QF1GNbkaI5ztZFe0/m4qXMYNY4VclEwjwPoVrWuexpy2nHD4hYbgW7QCTRfRJ tUziodNew7lCurRmHIOPASRNsYMHuTcvhBO8EoG4aOEwnbUXYaKu0M2esJJW9zi1w9tnNZ 73nvj/586G1KsLiUHAtF07lDvRU/VXqP0NBP5diVt8hxMeDGMLUUzoyxaIE/I+U36Ctbhv GW6dcAFkkUtjxtIjFc68TJ+mKMF5BsImg5ZG9EbW5baaW04eLrhzZDcZyrQemw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764959329; a=rsa-sha256; cv=none; b=diGkuENZ9YHsd+/n2busDEk3OhO4nm4aQ4Z73ZHjE/N1nkc+hkhjLbd4Se6r94zPldsv0U u21gZ0ri7wEd6qAv1yuQuWFh46QnYtTCGjxL0ECHlqZ0vC02/t44PP0Q8UVgnML4/s8zLf qpZu9ynfTEwRBWOvQfS5gXcfxrwWFeQoL4/4JIqztO+8NNGwk6a/kTB1hLXAQwSi/8rkR7 hyAXQClLcc8Fh/bSS2b0zx0Oyf1yMTX9uKOeIZRBzyD3Rf/O1YBiMvSnCElf8d7PFLD9qP 9mHCtNcyxV0jwnGtNdCgvtTuG78TutDs+F9eTdglqgDzjdd10dIr0bxdGd+k/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dNKdY1rSFz5mY for ; Fri, 05 Dec 2025 18:28:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id dcc1 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 05 Dec 2025 18:28:49 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: ef8a5af2a3ec - stable/13 - rtld-elf: Mark LD_SHOW_AUXV insecure List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ef8a5af2a3ec6ae1ade610ce0c33298eb6cd3bae Auto-Submitted: auto-generated Date: Fri, 05 Dec 2025 18:28:49 +0000 Message-Id: <69332461.dcc1.6b04a35f@gitrepo.freebsd.org> The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=ef8a5af2a3ec6ae1ade610ce0c33298eb6cd3bae commit ef8a5af2a3ec6ae1ade610ce0c33298eb6cd3bae Author: Dag-Erling Smørgrav AuthorDate: 2025-12-03 10:09:31 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-12-05 18:28:45 +0000 rtld-elf: Mark LD_SHOW_AUXV insecure This prevents dumping the memory layout of setugid processes. MFC after: 3 days Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D54033 (cherry picked from commit 5242bcff202fa2a5a39895423c8d8c11c02ad76a) --- libexec/rtld-elf/rtld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 7110ba6c4c1a..cbf4baa1aee9 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -400,7 +400,7 @@ static struct ld_env_var_desc ld_env_vars[] = { LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT1, false), LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT2, false), LD_ENV_DESC(TRACE_LOADED_OBJECTS_ALL, false), - LD_ENV_DESC(SHOW_AUXV, false), + LD_ENV_DESC(SHOW_AUXV, true), LD_ENV_DESC(STATIC_TLS_EXTRA, false), }; From nobody Sat Dec 6 13:36:24 2025 X-Original-To: dev-commits-src-branches@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 4dNq5j3PBJz6KjfR for ; Sat, 06 Dec 2025 13:36:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dNq5h6cjgz3l6H for ; Sat, 06 Dec 2025 13:36:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765028184; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ay3aDdw8T3fJd/q2Uh6KoTzOO5K5DGJkHf3YDpVcBcw=; b=fbCC0ZjqCRoujBj7Mj7dzHY++c0fQt72ipWznJ/MoxaTrUOzZn1Va1jq2cp6vauK88jWnN fnaYYRSmfo6gxnu/f7dxo6lDO+7fwnbjSa/gZ1TH4SsyuGJO6aJnXbeA4qHL8fpEY+gEkk bjp8O2X741+FdG89/alciH57q6uCd7noht+cxnStqq/0Iwh37KNH+AqZPXG5HF7yKbiO7v kvkE5aIk56SuJo8zEXCf9g97wSu6eNyAYLv1xSGULOInUET5qXKMuyaVwhFum2nH+XFKGI l6C4AtM1r4evPWgQcdYDj3w2RuyhhQ4PlBXb7aV0FBkZm6bjgZ1bHHiyzgdGnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765028184; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ay3aDdw8T3fJd/q2Uh6KoTzOO5K5DGJkHf3YDpVcBcw=; b=YWGD/Y4E+Oj4JdI4GTQk8UTgbirPvn8n8e2uHyox+JzPXrpVZ7JixzKFXsOb7gwElUZbH0 SxZRV2A9J4xzo6JfLxAc1GiyqUmMKEzGMbsmmWJ0GklDAR7CGOz4RoOlA2LKePHelBIMaz bSpfFbBqSlSf6TqWKzetoqeYPInlHBM2Ma7vFKGNgmWM/B6xih4gZhmafda72+u9EyHKgh aWr1yPucVdQMaMrcQoUKTxs+ifEdxskLVT2oHp6K1SoixrkrObVdBYVefk3d6vTUO4skMu BhqfuvbqpY077IVZEv5fnPbeyw1GvbnDluEtpKjriJU0Ow63412iu4WoR5+X+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765028184; a=rsa-sha256; cv=none; b=EVCM59u8ojV8ZTyAEbVSd3xSG4NtWEkZVddtCzWFhAF91mIYTFAmRL6g6zWrwNpTidE/9q 9kknPpLcGdWmLs7dNp+4+ZC4HJLKhkzYuZsktRgSG7v00fVRTDwSje1GigL/h/20xmX9yX o3ut5tFy/CQ+i7ew5Tuji0KcBqWYuQY3k3hpIV1fgXKmlbV4LC5l6cRnxVcDQg0E28W7BZ NEWKB3wxQrfmhyeYrdZ8j73IS+KZRrzwyqYPc0DZwQzhECI/Fsg6V/nOPCxJNVd2p1ApG/ MWCKeHzQr6/94/F2o/VgOeIgT+/H23yt1u6zDpFN1NEBRwqssQVs4Y4p65xrew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dNq5h5pRWzyWv for ; Sat, 06 Dec 2025 13:36:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2541a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 06 Dec 2025 13:36:24 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 26365bf2516f - stable/15 - sound: Retire snd_mixer->busy List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 26365bf2516f7c7936b6d5034901b158f07f1f17 Auto-Submitted: auto-generated Date: Sat, 06 Dec 2025 13:36:24 +0000 Message-Id: <69343158.2541a.18465fe6@gitrepo.freebsd.org> The branch stable/15 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=26365bf2516f7c7936b6d5034901b158f07f1f17 commit 26365bf2516f7c7936b6d5034901b158f07f1f17 Author: Christos Margiolis AuthorDate: 2025-11-28 14:35:56 +0000 Commit: Christos Margiolis CommitDate: 2025-12-06 13:36:18 +0000 sound: Retire snd_mixer->busy Does not really serve any real purpose. It gets set on mixer_open() and unset on mixer_close(), so it essentially tells us whether the mixer is open or not. mixer_close() uses it to return EBADF in case the mixer is not busied, as in, the mixer has not been open()'d yet. This is redundant. The other place where this is used is to decide whether to serve an ioctl issued by userland, in which case it won't if, again, the mixer has not been busied (i.e., opened). Again, seems redundant. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D53859 (cherry picked from commit e5d50a679aa1a72a7cbcb0281b9420aad4a7dc7a) --- sys/dev/sound/pci/es137x.c | 4 ---- sys/dev/sound/pcm/mixer.c | 30 +----------------------------- sys/dev/sound/pcm/mixer.h | 2 -- 3 files changed, 1 insertion(+), 35 deletions(-) diff --git a/sys/dev/sound/pci/es137x.c b/sys/dev/sound/pci/es137x.c index cc51005309b0..4e8c7911e95e 100644 --- a/sys/dev/sound/pci/es137x.c +++ b/sys/dev/sound/pci/es137x.c @@ -1540,10 +1540,6 @@ sysctl_es137x_single_pcm_mixer(SYSCTL_HANDLER_ARGS) PCM_RELEASE_QUICK(d); return (ENODEV); } - if (mixer_busy(m) != 0) { - PCM_RELEASE_QUICK(d); - return (EBUSY); - } level = mix_get(m, SOUND_MIXER_PCM); recsrc = mix_getrecsrc(m); if (level < 0 || recsrc < 0) { diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c index 55ce9596dde9..f6eb669010b5 100644 --- a/sys/dev/sound/pcm/mixer.c +++ b/sys/dev/sound/pcm/mixer.c @@ -48,7 +48,6 @@ SYSCTL_INT(_hw_snd, OID_AUTO, vpc_mixer_bypass, CTLFLAG_RWTUN, struct snd_mixer { KOBJ_FIELDS; void *devinfo; - int busy; int hwvol_mixer; int hwvol_step; int type; @@ -651,7 +650,6 @@ mixer_obj_create(device_t dev, kobj_class_t cls, void *devinfo, "primary pcm mixer" : "secondary pcm mixer", MTX_DEF); m->type = type; m->devinfo = devinfo; - m->busy = 0; m->dev = dev; for (i = 0; i < nitems(m->parent); i++) { m->parent[i] = SOUND_MIXER_NONE; @@ -947,14 +945,6 @@ mixer_hwvol_step(device_t dev, int left_step, int right_step) mtx_unlock(&m->lock); } -int -mixer_busy(struct snd_mixer *m) -{ - KASSERT(m != NULL, ("NULL snd_mixer")); - - return (m->busy); -} - int mix_set(struct snd_mixer *m, u_int dev, u_int left, u_int right) { @@ -1035,12 +1025,6 @@ mixer_open(struct cdev *i_dev, int flags, int mode, struct thread *td) if (!PCM_REGISTERED(d)) return (EBADF); - /* XXX Need Giant magic entry ??? */ - - mtx_lock(&m->lock); - m->busy = 1; - mtx_unlock(&m->lock); - return (0); } @@ -1049,7 +1033,6 @@ mixer_close(struct cdev *i_dev, int flags, int mode, struct thread *td) { struct snddev_info *d; struct snd_mixer *m; - int ret; if (i_dev == NULL || i_dev->si_drv1 == NULL) return (EBADF); @@ -1059,14 +1042,7 @@ mixer_close(struct cdev *i_dev, int flags, int mode, struct thread *td) if (!PCM_REGISTERED(d)) return (EBADF); - /* XXX Need Giant magic entry ??? */ - - mtx_lock(&m->lock); - ret = (m->busy == 0) ? EBADF : 0; - m->busy = 0; - mtx_unlock(&m->lock); - - return (ret); + return (0); } static int @@ -1262,10 +1238,6 @@ mixer_ioctl_cmd(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, return (EBADF); mtx_lock(&m->lock); - if (from == MIXER_CMD_CDEV && !m->busy) { - mtx_unlock(&m->lock); - return (EBADF); - } switch (cmd) { case SNDCTL_DSP_GET_RECSRC_NAMES: bcopy((void *)&m->enuminfo, arg, sizeof(oss_mixer_enuminfo)); diff --git a/sys/dev/sound/pcm/mixer.h b/sys/dev/sound/pcm/mixer.h index c47247ab570d..3ce8a4f5adee 100644 --- a/sys/dev/sound/pcm/mixer.h +++ b/sys/dev/sound/pcm/mixer.h @@ -45,8 +45,6 @@ void mixer_hwvol_mute(device_t dev); void mixer_hwvol_step_locked(struct snd_mixer *m, int l_step, int r_step); void mixer_hwvol_step(device_t dev, int left_step, int right_step); -int mixer_busy(struct snd_mixer *m); - int mix_set(struct snd_mixer *m, u_int dev, u_int left, u_int right); int mix_get(struct snd_mixer *m, u_int dev); int mix_setrecsrc(struct snd_mixer *m, u_int32_t src);