From owner-svn-src-stable-11@freebsd.org Sun Jul 12 07:25:03 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0ABD935ACCA; Sun, 12 Jul 2020 07:25:03 +0000 (UTC) (envelope-from zeising@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B4JFp6GFjz4Dmp; Sun, 12 Jul 2020 07:25:02 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B642C20E87; Sun, 12 Jul 2020 07:25:02 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06C7P2LX036210; Sun, 12 Jul 2020 07:25:02 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06C7P2gD036209; Sun, 12 Jul 2020 07:25:02 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <202007120725.06C7P2gD036209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Sun, 12 Jul 2020 07:25:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r363120 - in stable: 11/sbin/shutdown 12/sbin/shutdown X-SVN-Group: stable-11 X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: in stable: 11/sbin/shutdown 12/sbin/shutdown X-SVN-Commit-Revision: 363120 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jul 2020 07:25:03 -0000 Author: zeising (doc,ports committer) Date: Sun Jul 12 07:25:02 2020 New Revision: 363120 URL: https://svnweb.freebsd.org/changeset/base/363120 Log: MFC r362942: shutdown.8: Fix typo Fix a typo in shutdown.8, use ',' instead of '.' when listing items. Modified: stable/11/sbin/shutdown/shutdown.8 Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sbin/shutdown/shutdown.8 Directory Properties: stable/12/ (props changed) Modified: stable/11/sbin/shutdown/shutdown.8 ============================================================================== --- stable/11/sbin/shutdown/shutdown.8 Sun Jul 12 04:29:39 2020 (r363119) +++ stable/11/sbin/shutdown/shutdown.8 Sun Jul 12 07:25:02 2020 (r363120) @@ -124,7 +124,7 @@ suffix: .Dq Li s , .Dq Li sec , .Dq Li m , -.Dq Li min . +.Dq Li min , .Dq Li h , .Dq Li hour . .It Ar warning-message From owner-svn-src-stable-11@freebsd.org Sun Jul 12 19:39:57 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 426CA36C560; Sun, 12 Jul 2020 19:39:57 +0000 (UTC) (envelope-from 0mp@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B4cYn11KWz3gCw; Sun, 12 Jul 2020 19:39:57 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 060F39722; Sun, 12 Jul 2020 19:39:57 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06CJdumv084744; Sun, 12 Jul 2020 19:39:56 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06CJdu56084742; Sun, 12 Jul 2020 19:39:56 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202007121939.06CJdu56084742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Sun, 12 Jul 2020 19:39:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r363135 - in stable/11: crypto/heimdal/lib/krb5 sbin/rcorder X-SVN-Group: stable-11 X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: in stable/11: crypto/heimdal/lib/krb5 sbin/rcorder X-SVN-Commit-Revision: 363135 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jul 2020 19:39:57 -0000 Author: 0mp (doc,ports committer) Date: Sun Jul 12 19:39:56 2020 New Revision: 363135 URL: https://svnweb.freebsd.org/changeset/base/363135 Log: MFC 362491: Improve the rcorder manual page - Fix formatting issues such as: - Use Ql instead of Dq Li as Li is deprecated - Address some mandoc warnings - Add arguments missing from the list of options (i.e., document "-k keep" instead of just "-k"). - Document that -k and -s can be specified multiple times - Use sshd instead of named for the example in the BUGS section, as named is not in the base system. Also, use Nm instead of Xr there as it is not the sshd binary that is required to be running, but the service. - Use Sy instead of Cm for KEYWORDS. Cm is reserved for command-line modifiers of the CLI. - Add an EXAMPLES section - Cross-reference service(8). Modified: stable/11/crypto/heimdal/lib/krb5/krb5.conf.5 stable/11/sbin/rcorder/rcorder.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/crypto/heimdal/lib/krb5/krb5.conf.5 ============================================================================== --- stable/11/crypto/heimdal/lib/krb5/krb5.conf.5 Sun Jul 12 19:39:17 2020 (r363134) +++ stable/11/crypto/heimdal/lib/krb5/krb5.conf.5 Sun Jul 12 19:39:56 2020 (r363135) @@ -257,7 +257,7 @@ Setting this flag to make it store the MIT way, this is default for Heimdal 0.7. .It Li check-rd-req-server If set to "ignore", the framework will ignore any the server input to -.Xr krb5_rd_req 3, +.Xr krb5_rd_req 3 , this is very useful when the GSS-API server input the wrong server name into the gss_accept_sec_context call. .El Modified: stable/11/sbin/rcorder/rcorder.8 ============================================================================== --- stable/11/sbin/rcorder/rcorder.8 Sun Jul 12 19:39:17 2020 (r363134) +++ stable/11/sbin/rcorder/rcorder.8 Sun Jul 12 19:39:56 2020 (r363135) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 27, 2018 +.Dd June 22, 2020 .Dt RCORDER 8 .Os .Sh NAME @@ -62,30 +62,30 @@ and which indicate, for each file, which may be expected to be filled by that file. .Pp Within each file, a block containing a series of -.Dq Li REQUIRE , -.Dq Li PROVIDE , -.Dq Li BEFORE +.Ql REQUIRE , +.Ql PROVIDE , +.Ql BEFORE and -.Dq Li KEYWORD +.Ql KEYWORD lines must appear. The format of the lines is rigid. Each line must begin with a single .Ql # , followed by a single space, followed by -.Dq Li PROVIDE: , -.Dq Li REQUIRE: , -.Dq Li BEFORE: , +.Ql PROVIDE\&: , +.Ql REQUIRE\&: , +.Ql BEFORE\&: , or -.Dq Li KEYWORD: . +.Ql KEYWORD\&: . No deviation is permitted. Each dependency line is then followed by a series of conditions, separated by whitespace. Multiple -.Dq Li PROVIDE , -.Dq Li REQUIRE , -.Dq Li BEFORE +.Ql PROVIDE , +.Ql REQUIRE , +.Ql BEFORE and -.Dq Li KEYWORD +.Ql KEYWORD lines may appear, but all such lines must appear in a sequence without any intervening lines, as once a line that does not follow the format is reached, parsing stops. @@ -94,19 +94,21 @@ is reached, parsing stops. .\" that they can be deprecated at some point in the future. .Pp The options are as follows: -.Bl -tag -width indent -.It Fl k +.Bl -tag -width "-k keep" +.It Fl k Ar keep Add the specified keyword to the .Dq "keep list" . If any .Fl k option is given, only those files containing the matching keyword are listed. -.It Fl s +This option can be specified multiple times. +.It Fl s Ar skip Add the specified keyword to the .Dq "skip list" . If any .Fl s option is given, files containing the matching keyword are not listed. +This option can be specified multiple times. .El .Pp An example block follows: @@ -117,20 +119,20 @@ An example block follows: .Ed .Pp This block states that the file in which it appears depends upon the -.Dq Li networking , -.Dq Li syslog , +.Ql networking , +.Ql syslog , and -.Dq Li usr +.Ql usr conditions, and provides the -.Dq Li dns +.Ql dns and -.Dq Li nscd +.Ql nscd conditions. .Pp A file may contain zero -.Dq Li PROVIDE +.Ql PROVIDE lines, in which case it provides no conditions, and may contain zero -.Dq Li REQUIRE +.Ql REQUIRE lines, in which case it has no dependencies. There must be at least one file with no dependencies in the set of arguments passed to @@ -140,19 +142,36 @@ in order for it to find a starting place in the depend There are several .Em KEYWORDs in use: -.Bl -tag -width ".Cm shutdown" -offset indent -.It Cm firstboot, nojail, nojailvnet, nostart +.Bl -tag -width "shutdown" -offset indent +.It Sy firstboot , nojail , nojailvnet , nostart Used by .Xr rc 8 . -.It Cm resume +.It Sy resume Used by .Nm /etc/rc.resume (see .Xr acpiconf 8 ) -.It Cm shutdown +.It Sy shutdown Used by .Xr rc.shutdown 8 . .El +.Sh EXAMPLES +Print the dependency ordering of the services from the base system and +.Xr ports 7 : +.Bd -literal -offset indent +$ rcorder /etc/rc.d/* /usr/local/etc/rc.d/* +.Ed +.Pp +Count the number of services in the base system, which specify the +.Sy shutdown +keyword, while skipping those with +.Sy firstboot +and +.Sy nojailvnet : +.Bd -literal -offset indent +$ rcorder -k nostart -s firstboot -s nojailvnet /etc/rc.d/* | wc -l + 3 +.Ed .Sh DIAGNOSTICS The .Nm @@ -161,9 +180,9 @@ status if it encounters an error while processing the .Bl -diag .It "Requirement %s has no providers, aborting." No file has a -.Dq Li PROVIDE +.Ql PROVIDE line corresponding to a condition present in a -.Dq Li REQUIRE +.Ql REQUIRE line in another file. .It "Circular dependency on provision %s, aborting." A set of files has a circular dependency which was detected while @@ -175,7 +194,8 @@ processing the stated file. .Sh SEE ALSO .Xr acpiconf 8 , .Xr rc 8 , -.Xr rc.shutdown 8 +.Xr rc.shutdown 8 , +.Xr service 8 .Sh HISTORY The .Nm @@ -192,7 +212,7 @@ and .An Matthew R. Green Aq Mt mrg@eterna.com.au . .Sh BUGS The -.Dq Li REQUIRE +.Ql REQUIRE keyword is misleading: It does not describe which daemons have to be running before a script will be started. @@ -200,12 +220,12 @@ It describes which scripts must be placed before it in the dependency ordering. For example, if your script has a -.Dq Li REQUIRE +.Ql REQUIRE on -.Dq Li named , +.Ql sshd , it means the script must be placed after the -.Dq Li named +.Ql sshd script in the dependency ordering, not necessarily that it requires -.Xr named 8 +.Nm sshd to be started or enabled. From owner-svn-src-stable-11@freebsd.org Mon Jul 13 15:29:12 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 28FD236714C; Mon, 13 Jul 2020 15:29:12 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B56y00Jnqz4567; Mon, 13 Jul 2020 15:29:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E38D3175A4; Mon, 13 Jul 2020 15:29:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06DFTBG5015013; Mon, 13 Jul 2020 15:29:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06DFTBbO015012; Mon, 13 Jul 2020 15:29:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202007131529.06DFTBbO015012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 13 Jul 2020 15:29:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r363149 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 363149 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jul 2020 15:29:12 -0000 Author: hselasky Date: Mon Jul 13 15:29:11 2020 New Revision: 363149 URL: https://svnweb.freebsd.org/changeset/base/363149 Log: MFC r362946: Fix include file order in io.h in the LinuxKPI. Make sure sys/types.h is included before machine/vm.h. PR: 247775 Submitted by: pkubaj@ Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/io.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/io.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/io.h Mon Jul 13 15:28:06 2020 (r363148) +++ stable/11/sys/compat/linuxkpi/common/include/linux/io.h Mon Jul 13 15:29:11 2020 (r363149) @@ -31,9 +31,10 @@ #ifndef _LINUX_IO_H_ #define _LINUX_IO_H_ -#include #include #include + +#include #include #include From owner-svn-src-stable-11@freebsd.org Mon Jul 13 15:34:51 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B2A2836734E; Mon, 13 Jul 2020 15:34:51 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B574W4M1rz45cL; Mon, 13 Jul 2020 15:34:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E1F8178A7; Mon, 13 Jul 2020 15:34:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06DFYp9K021233; Mon, 13 Jul 2020 15:34:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06DFYlDS021215; Mon, 13 Jul 2020 15:34:47 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202007131534.06DFYlDS021215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 13 Jul 2020 15:34:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r363151 - in stable/11/sys: dev/mlx4/mlx4_core dev/mlx4/mlx4_en dev/mlx4/mlx4_ib dev/mlx5/mlx5_core dev/mlx5/mlx5_en dev/mlx5/mlx5_fpga_tools dev/mlx5/mlx5_ib dev/mthca ofed/drivers/inf... X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys: dev/mlx4/mlx4_core dev/mlx4/mlx4_en dev/mlx4/mlx4_ib dev/mlx5/mlx5_core dev/mlx5/mlx5_en dev/mlx5/mlx5_fpga_tools dev/mlx5/mlx5_ib dev/mthca ofed/drivers/infiniband/core ofed/drivers... X-SVN-Commit-Revision: 363151 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jul 2020 15:34:51 -0000 Author: hselasky Date: Mon Jul 13 15:34:47 2020 New Revision: 363151 URL: https://svnweb.freebsd.org/changeset/base/363151 Log: MFC r362953: Infiniband clients must be attached and detached in a specific order in ibcore. Currently the linking order of the infiniband, IB, modules decide in which order the clients are attached and detached. For example one IB client may use resources from another IB client. This can lead to a potential deadlock at shutdown. For example if the ipoib is unregistered after the ib_multicast client is detached, then if ipoib is using multicast addresses a deadlock may happen, because ib_multicast will wait for all its resources to be freed before returning from the remove method. Fix this by using module_xxx_order() instead of module_xxx(). Differential Revision: https://reviews.freebsd.org/D23973 Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx4/mlx4_core/mlx4_main.c stable/11/sys/dev/mlx4/mlx4_en/mlx4_en_main.c stable/11/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/11/sys/dev/mlx5/mlx5_fpga_tools/mlx5fpga_tools_main.c stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c stable/11/sys/dev/mthca/mthca_main.c stable/11/sys/ofed/drivers/infiniband/core/ib_cm.c stable/11/sys/ofed/drivers/infiniband/core/ib_cma.c stable/11/sys/ofed/drivers/infiniband/core/ib_device.c stable/11/sys/ofed/drivers/infiniband/core/ib_iwcm.c stable/11/sys/ofed/drivers/infiniband/core/ib_ucm.c stable/11/sys/ofed/drivers/infiniband/core/ib_ucma.c stable/11/sys/ofed/drivers/infiniband/core/ib_user_mad.c stable/11/sys/ofed/drivers/infiniband/core/ib_uverbs_main.c stable/11/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c stable/11/sys/ofed/drivers/infiniband/util/madeye.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx4/mlx4_core/mlx4_main.c ============================================================================== --- stable/11/sys/dev/mlx4/mlx4_core/mlx4_main.c Mon Jul 13 15:33:06 2020 (r363150) +++ stable/11/sys/dev/mlx4/mlx4_core/mlx4_main.c Mon Jul 13 15:34:47 2020 (r363151) @@ -4217,8 +4217,8 @@ static void __exit mlx4_cleanup(void) destroy_workqueue(mlx4_wq); } -module_init(mlx4_init); -module_exit(mlx4_cleanup); +module_init_order(mlx4_init, SI_ORDER_FIRST); +module_exit_order(mlx4_cleanup, SI_ORDER_FIRST); static int mlx4_evhand(module_t mod, int event, void *arg) Modified: stable/11/sys/dev/mlx4/mlx4_en/mlx4_en_main.c ============================================================================== --- stable/11/sys/dev/mlx4/mlx4_en/mlx4_en_main.c Mon Jul 13 15:33:06 2020 (r363150) +++ stable/11/sys/dev/mlx4/mlx4_en/mlx4_en_main.c Mon Jul 13 15:34:47 2020 (r363151) @@ -304,8 +304,8 @@ static void __exit mlx4_en_cleanup(void) mlx4_unregister_interface(&mlx4_en_interface); } -module_init(mlx4_en_init); -module_exit(mlx4_en_cleanup); +module_init_order(mlx4_en_init, SI_ORDER_SIXTH); +module_exit_order(mlx4_en_cleanup, SI_ORDER_SIXTH); static int mlx4en_evhand(module_t mod, int event, void *arg) Modified: stable/11/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c ============================================================================== --- stable/11/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c Mon Jul 13 15:33:06 2020 (r363150) +++ stable/11/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c Mon Jul 13 15:34:47 2020 (r363151) @@ -3320,8 +3320,8 @@ static void __exit mlx4_ib_cleanup(void) destroy_workqueue(wq); } -module_init_order(mlx4_ib_init, SI_ORDER_THIRD); -module_exit(mlx4_ib_cleanup); +module_init_order(mlx4_ib_init, SI_ORDER_SEVENTH); +module_exit_order(mlx4_ib_cleanup, SI_ORDER_SEVENTH); static int mlx4ib_evhand(module_t mod, int event, void *arg) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Jul 13 15:33:06 2020 (r363150) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Jul 13 15:34:47 2020 (r363151) @@ -2007,5 +2007,5 @@ static void __exit cleanup(void) pci_unregister_driver(&mlx5_core_driver); } -module_init(init); -module_exit(cleanup); +module_init_order(init, SI_ORDER_FIRST); +module_exit_order(cleanup, SI_ORDER_FIRST); Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jul 13 15:33:06 2020 (r363150) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jul 13 15:34:47 2020 (r363151) @@ -4193,8 +4193,8 @@ mlx5e_show_version(void __unused *arg) } SYSINIT(mlx5e_show_version, SI_SUB_DRIVERS, SI_ORDER_ANY, mlx5e_show_version, NULL); -module_init_order(mlx5e_init, SI_ORDER_THIRD); -module_exit_order(mlx5e_cleanup, SI_ORDER_THIRD); +module_init_order(mlx5e_init, SI_ORDER_SIXTH); +module_exit_order(mlx5e_cleanup, SI_ORDER_SIXTH); #if (__FreeBSD_version >= 1100000) MODULE_DEPEND(mlx5en, linuxkpi, 1, 1, 1); Modified: stable/11/sys/dev/mlx5/mlx5_fpga_tools/mlx5fpga_tools_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_fpga_tools/mlx5fpga_tools_main.c Mon Jul 13 15:33:06 2020 (r363150) +++ stable/11/sys/dev/mlx5/mlx5_fpga_tools/mlx5fpga_tools_main.c Mon Jul 13 15:34:47 2020 (r363151) @@ -139,5 +139,5 @@ static void __exit mlx5_fpga_tools_exit(void) mlx5_fpga_tools_char_deinit(); } -module_init(mlx5_fpga_tools_init); -module_exit(mlx5_fpga_tools_exit); +module_init_order(mlx5_fpga_tools_init, SI_ORDER_SECOND); +module_exit_order(mlx5_fpga_tools_exit, SI_ORDER_SECOND); Modified: stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Mon Jul 13 15:33:06 2020 (r363150) +++ stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Mon Jul 13 15:34:47 2020 (r363151) @@ -3399,5 +3399,5 @@ mlx5_ib_show_version(void __unused *arg) } SYSINIT(mlx5_ib_show_version, SI_SUB_DRIVERS, SI_ORDER_ANY, mlx5_ib_show_version, NULL); -module_init_order(mlx5_ib_init, SI_ORDER_THIRD); -module_exit_order(mlx5_ib_cleanup, SI_ORDER_THIRD); +module_init_order(mlx5_ib_init, SI_ORDER_SEVENTH); +module_exit_order(mlx5_ib_cleanup, SI_ORDER_SEVENTH); Modified: stable/11/sys/dev/mthca/mthca_main.c ============================================================================== --- stable/11/sys/dev/mthca/mthca_main.c Mon Jul 13 15:33:06 2020 (r363150) +++ stable/11/sys/dev/mthca/mthca_main.c Mon Jul 13 15:34:47 2020 (r363151) @@ -1271,8 +1271,8 @@ static void __exit mthca_cleanup(void) mthca_catas_cleanup(); } -module_init_order(mthca_init, SI_ORDER_THIRD); -module_exit(mthca_cleanup); +module_init_order(mthca_init, SI_ORDER_SEVENTH); +module_exit_order(mthca_cleanup, SI_ORDER_SEVENTH); MODULE_VERSION(mthca, 1); MODULE_DEPEND(mthca, ibcore, 1, 1, 1); Modified: stable/11/sys/ofed/drivers/infiniband/core/ib_cm.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/core/ib_cm.c Mon Jul 13 15:33:06 2020 (r363150) +++ stable/11/sys/ofed/drivers/infiniband/core/ib_cm.c Mon Jul 13 15:34:47 2020 (r363151) @@ -4180,5 +4180,5 @@ static void __exit ib_cm_cleanup(void) } module_init_order(ib_cm_init, SI_ORDER_SECOND); -module_exit_order(ib_cm_cleanup, SI_ORDER_FIRST); +module_exit_order(ib_cm_cleanup, SI_ORDER_SECOND); Modified: stable/11/sys/ofed/drivers/infiniband/core/ib_cma.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/core/ib_cma.c Mon Jul 13 15:33:06 2020 (r363150) +++ stable/11/sys/ofed/drivers/infiniband/core/ib_cma.c Mon Jul 13 15:34:47 2020 (r363151) @@ -4433,5 +4433,5 @@ static void __exit cma_cleanup(void) destroy_workqueue(cma_wq); } -module_init(cma_init); -module_exit(cma_cleanup); +module_init_order(cma_init, SI_ORDER_FOURTH); +module_exit_order(cma_cleanup, SI_ORDER_FOURTH); Modified: stable/11/sys/ofed/drivers/infiniband/core/ib_device.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/core/ib_device.c Mon Jul 13 15:33:06 2020 (r363150) +++ stable/11/sys/ofed/drivers/infiniband/core/ib_device.c Mon Jul 13 15:34:47 2020 (r363151) @@ -1060,8 +1060,25 @@ static void __exit ib_core_cleanup(void) destroy_workqueue(ib_wq); } -module_init(ib_core_init); -module_exit(ib_core_cleanup); +/* + * Typical loading and unloading order values and their use: + * + * SI_ORDER_FIRST (default for module_init): + * Core modules (PCI, infiniband) + * SI_ORDER_SECOND (default for module_exit): + * Infiniband core modules (CM) + * SI_ORDER_THIRD: + * SI_ORDER_FOURTH: + * Infiniband core modules (CMA) + * SI_ORDER_FIFTH: + * Infiniband user-space modules (UCM,UCMA,UMAD,UVERBS,IPOIB) + * SI_ORDER_SIXTH: + * Network HW driver modules + * SI_ORDER_SEVENTH: + * Infiniband HW driver modules + */ +module_init_order(ib_core_init, SI_ORDER_FIRST); +module_exit_order(ib_core_cleanup, SI_ORDER_FIRST); MODULE_VERSION(ibcore, 1); MODULE_DEPEND(ibcore, linuxkpi, 1, 1, 1); Modified: stable/11/sys/ofed/drivers/infiniband/core/ib_iwcm.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/core/ib_iwcm.c Mon Jul 13 15:33:06 2020 (r363150) +++ stable/11/sys/ofed/drivers/infiniband/core/ib_iwcm.c Mon Jul 13 15:34:47 2020 (r363151) @@ -1052,5 +1052,5 @@ static void __exit iw_cm_cleanup(void) destroy_workqueue(iwcm_wq); } -module_init(iw_cm_init); -module_exit(iw_cm_cleanup); +module_init_order(iw_cm_init, SI_ORDER_FIRST); +module_exit_order(iw_cm_cleanup, SI_ORDER_FIRST); Modified: stable/11/sys/ofed/drivers/infiniband/core/ib_ucm.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/core/ib_ucm.c Mon Jul 13 15:33:06 2020 (r363150) +++ stable/11/sys/ofed/drivers/infiniband/core/ib_ucm.c Mon Jul 13 15:34:47 2020 (r363151) @@ -1371,5 +1371,5 @@ static void __exit ib_ucm_cleanup(void) idr_destroy(&ctx_id_table); } -module_init_order(ib_ucm_init, SI_ORDER_THIRD); -module_exit(ib_ucm_cleanup); +module_init_order(ib_ucm_init, SI_ORDER_FIFTH); +module_exit_order(ib_ucm_cleanup, SI_ORDER_FIFTH); Modified: stable/11/sys/ofed/drivers/infiniband/core/ib_ucma.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/core/ib_ucma.c Mon Jul 13 15:33:06 2020 (r363150) +++ stable/11/sys/ofed/drivers/infiniband/core/ib_ucma.c Mon Jul 13 15:34:47 2020 (r363151) @@ -1782,5 +1782,5 @@ static void __exit ucma_cleanup(void) idr_destroy(&multicast_idr); } -module_init(ucma_init); -module_exit(ucma_cleanup); +module_init_order(ucma_init, SI_ORDER_FIFTH); +module_exit_order(ucma_cleanup, SI_ORDER_FIFTH); Modified: stable/11/sys/ofed/drivers/infiniband/core/ib_user_mad.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/core/ib_user_mad.c Mon Jul 13 15:33:06 2020 (r363150) +++ stable/11/sys/ofed/drivers/infiniband/core/ib_user_mad.c Mon Jul 13 15:34:47 2020 (r363151) @@ -1405,5 +1405,5 @@ static void __exit ib_umad_cleanup(void) unregister_chrdev_region(overflow_maj, IB_UMAD_MAX_PORTS * 2); } -module_init_order(ib_umad_init, SI_ORDER_THIRD); -module_exit(ib_umad_cleanup); +module_init_order(ib_umad_init, SI_ORDER_FIFTH); +module_exit_order(ib_umad_cleanup, SI_ORDER_FIFTH); Modified: stable/11/sys/ofed/drivers/infiniband/core/ib_uverbs_main.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/core/ib_uverbs_main.c Mon Jul 13 15:33:06 2020 (r363150) +++ stable/11/sys/ofed/drivers/infiniband/core/ib_uverbs_main.c Mon Jul 13 15:34:47 2020 (r363151) @@ -1431,5 +1431,5 @@ static void __exit ib_uverbs_cleanup(void) idr_destroy(&ib_uverbs_srq_idr); } -module_init_order(ib_uverbs_init, SI_ORDER_THIRD); -module_exit(ib_uverbs_cleanup); +module_init_order(ib_uverbs_init, SI_ORDER_FIFTH); +module_exit_order(ib_uverbs_cleanup, SI_ORDER_FIFTH); Modified: stable/11/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Mon Jul 13 15:33:06 2020 (r363150) +++ stable/11/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Mon Jul 13 15:34:47 2020 (r363151) @@ -1735,8 +1735,8 @@ ipoib_resolvemulti(struct ifnet *ifp, struct sockaddr } } -module_init(ipoib_init_module); -module_exit(ipoib_cleanup_module); +module_init_order(ipoib_init_module, SI_ORDER_FIFTH); +module_exit_order(ipoib_cleanup_module, SI_ORDER_FIFTH); static int ipoib_evhand(module_t mod, int event, void *arg) Modified: stable/11/sys/ofed/drivers/infiniband/util/madeye.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/util/madeye.c Mon Jul 13 15:33:06 2020 (r363150) +++ stable/11/sys/ofed/drivers/infiniband/util/madeye.c Mon Jul 13 15:34:47 2020 (r363151) @@ -592,5 +592,5 @@ static void __exit ib_madeye_cleanup(void) ib_unregister_client(&madeye_client); } -module_init(ib_madeye_init); -module_exit(ib_madeye_cleanup); +module_init_order(ib_madeye_init, SI_ORDER_THIRD); +module_exit_order(ib_madeye_cleanup, SI_ORDER_THIRD); From owner-svn-src-stable-11@freebsd.org Mon Jul 13 15:37:59 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D91EE36781A; Mon, 13 Jul 2020 15:37:59 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B57875R6hz460y; Mon, 13 Jul 2020 15:37:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E779176C9; Mon, 13 Jul 2020 15:37:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06DFbxLQ021507; Mon, 13 Jul 2020 15:37:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06DFbxx3021506; Mon, 13 Jul 2020 15:37:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202007131537.06DFbxx3021506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 13 Jul 2020 15:37:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r363153 - stable/11/sys/compat/linuxkpi/common/src X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 363153 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jul 2020 15:37:59 -0000 Author: hselasky Date: Mon Jul 13 15:37:59 2020 New Revision: 363153 URL: https://svnweb.freebsd.org/changeset/base/363153 Log: MFC r362829: The "pid" field in the LinuxKPI task struct is typically set to the thread ID and not the process ID. Make sure the linux_task_exiting() function uses tdfind() to lookup the BSD procedure structure pointer by the "pid" field, and only fallback to pfind() when no match is found! This makes linux_task_exiting() in line with the rest of the code. Differential Revision: https://reviews.freebsd.org/D25509 Submitted by: Greg V Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/src/linux_current.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/src/linux_current.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_current.c Mon Jul 13 15:36:57 2020 (r363152) +++ stable/11/sys/compat/linuxkpi/common/src/linux_current.c Mon Jul 13 15:37:59 2020 (r363153) @@ -218,11 +218,21 @@ linux_get_pid_task(pid_t pid) bool linux_task_exiting(struct task_struct *task) { + struct thread *td; struct proc *p; bool ret; ret = false; - p = pfind(task->pid); + + /* try to find corresponding thread */ + td = tdfind(task->pid, -1); + if (td != NULL) { + p = td->td_proc; + } else { + /* try to find corresponding procedure */ + p = pfind(task->pid); + } + if (p != NULL) { if ((p->p_flag & P_WEXIT) != 0) ret = true; From owner-svn-src-stable-11@freebsd.org Mon Jul 13 15:41:55 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC872367A81; Mon, 13 Jul 2020 15:41:55 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B57Dg4fB4z46JV; Mon, 13 Jul 2020 15:41:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83BE3176E5; Mon, 13 Jul 2020 15:41:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06DFftqr026015; Mon, 13 Jul 2020 15:41:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06DFftSL025950; Mon, 13 Jul 2020 15:41:55 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202007131541.06DFftSL025950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 13 Jul 2020 15:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r363155 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 363155 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jul 2020 15:41:55 -0000 Author: hselasky Date: Mon Jul 13 15:41:55 2020 New Revision: 363155 URL: https://svnweb.freebsd.org/changeset/base/363155 Log: MFC r362781 and r362794: Implement is_signed(), type_max() and type_min() function macros in the LinuxKPI. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Mon Jul 13 15:40:55 2020 (r363154) +++ stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Mon Jul 13 15:41:55 2020 (r363155) @@ -536,4 +536,33 @@ linux_ratelimited(linux_ratelimit_t *rl) #define __is_constexpr(x) \ __builtin_constant_p(x) +/* + * The is_signed() macro below returns true if the passed data type is + * signed. Else false is returned. + */ +#define is_signed(datatype) (((datatype)-1 / (datatype)2) == (datatype)0) + +/* + * The type_max() macro below returns the maxium positive value the + * passed data type can hold. + */ +#define type_max(datatype) ( \ + (sizeof(datatype) >= 8) ? (is_signed(datatype) ? INT64_MAX : UINT64_MAX) : \ + (sizeof(datatype) >= 4) ? (is_signed(datatype) ? INT32_MAX : UINT32_MAX) : \ + (sizeof(datatype) >= 2) ? (is_signed(datatype) ? INT16_MAX : UINT16_MAX) : \ + (is_signed(datatype) ? INT8_MAX : UINT8_MAX) \ +) + +/* + * The type_min() macro below returns the minimum value the passed + * data type can hold. For unsigned types the minimum value is always + * zero. For signed types it may vary. + */ +#define type_min(datatype) ( \ + (sizeof(datatype) >= 8) ? (is_signed(datatype) ? INT64_MIN : 0) : \ + (sizeof(datatype) >= 4) ? (is_signed(datatype) ? INT32_MIN : 0) : \ + (sizeof(datatype) >= 2) ? (is_signed(datatype) ? INT16_MIN : 0) : \ + (is_signed(datatype) ? INT8_MIN : 0) \ +) + #endif /* _LINUX_KERNEL_H_ */ From owner-svn-src-stable-11@freebsd.org Tue Jul 14 13:21:26 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 826A0362702; Tue, 14 Jul 2020 13:21:26 +0000 (UTC) (envelope-from cy@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B5h462gRYz4Jfs; Tue, 14 Jul 2020 13:21:26 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2FD3F269F3; Tue, 14 Jul 2020 13:21:26 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06EDLQ8L025002; Tue, 14 Jul 2020 13:21:26 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06EDL9i6024982; Tue, 14 Jul 2020 13:21:09 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202007141321.06EDL9i6024982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 14 Jul 2020 13:21:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r363179 - in stable: 11/contrib/sqlite3 11/contrib/sqlite3/tea 12/contrib/sqlite3 12/contrib/sqlite3/tea X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/sqlite3 11/contrib/sqlite3/tea 12/contrib/sqlite3 12/contrib/sqlite3/tea X-SVN-Commit-Revision: 363179 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jul 2020 13:21:26 -0000 Author: cy Date: Tue Jul 14 13:21:09 2020 New Revision: 363179 URL: https://svnweb.freebsd.org/changeset/base/363179 Log: MFC r362997: Update sqlite to 3.32.3 (3320300). Release Announcement: https://www.sqlite.org/releaselog/3_32_3.html See also: ports r541414 PR: 247819 Reported by: Pavel Volkov Modified: stable/11/contrib/sqlite3/configure stable/11/contrib/sqlite3/configure.ac stable/11/contrib/sqlite3/sqlite3.c stable/11/contrib/sqlite3/sqlite3.h stable/11/contrib/sqlite3/tea/configure stable/11/contrib/sqlite3/tea/configure.ac Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/sqlite3/configure stable/12/contrib/sqlite3/configure.ac stable/12/contrib/sqlite3/sqlite3.c stable/12/contrib/sqlite3/sqlite3.h stable/12/contrib/sqlite3/tea/configure stable/12/contrib/sqlite3/tea/configure.ac Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/sqlite3/configure ============================================================================== --- stable/11/contrib/sqlite3/configure Tue Jul 14 12:02:30 2020 (r363178) +++ stable/11/contrib/sqlite3/configure Tue Jul 14 13:21:09 2020 (r363179) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.32.2. +# Generated by GNU Autoconf 2.69 for sqlite 3.32.3. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.32.2' -PACKAGE_STRING='sqlite 3.32.2' +PACKAGE_VERSION='3.32.3' +PACKAGE_STRING='sqlite 3.32.3' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.32.2 to adapt to many kinds of systems. +\`configure' configures sqlite 3.32.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1412,7 +1412,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.32.2:";; + short | recursive ) echo "Configuration of sqlite 3.32.3:";; esac cat <<\_ACEOF @@ -1537,7 +1537,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.32.2 +sqlite configure 3.32.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.32.2, which was +It was created by sqlite $as_me 3.32.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2818,7 +2818,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.32.2' + VERSION='3.32.3' cat >>confdefs.h <<_ACEOF @@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.32.2, which was +This file was extended by sqlite $as_me 3.32.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14495,7 +14495,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.32.2 +sqlite config.status 3.32.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/11/contrib/sqlite3/configure.ac ============================================================================== --- stable/11/contrib/sqlite3/configure.ac Tue Jul 14 12:02:30 2020 (r363178) +++ stable/11/contrib/sqlite3/configure.ac Tue Jul 14 13:21:09 2020 (r363179) @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.32.2, http://www.sqlite.org) +AC_INIT(sqlite, 3.32.3, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) Modified: stable/11/contrib/sqlite3/sqlite3.c ============================================================================== --- stable/11/contrib/sqlite3/sqlite3.c Tue Jul 14 12:02:30 2020 (r363178) +++ stable/11/contrib/sqlite3/sqlite3.c Tue Jul 14 13:21:09 2020 (r363179) @@ -1,6 +1,6 @@ /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.32.2. By combining all the individual C code files into this +** version 3.32.3. 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 @@ -1162,9 +1162,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.32.2" -#define SQLITE_VERSION_NUMBER 3032002 -#define SQLITE_SOURCE_ID "2020-06-04 12:58:43 ec02243ea6ce33b090870ae55ab8aa2534b54d216d45c4aa2fdbb00e86861e8c" +#define SQLITE_VERSION "3.32.3" +#define SQLITE_VERSION_NUMBER 3032003 +#define SQLITE_SOURCE_ID "2020-06-18 14:00:33 7ebdfa80be8e8e73324b8d66b3460222eb74c7e9dfd655b48d6ca7e1933cc8fd" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -17863,11 +17863,11 @@ struct AggInfo { ExprList *pGroupBy; /* The group by clause */ struct AggInfo_col { /* For each column used in source tables */ Table *pTab; /* Source table */ + Expr *pExpr; /* The original expression */ int iTable; /* Cursor number of the source table */ - int iColumn; /* Column number within the source table */ - int iSorterColumn; /* Column number in the sorting index */ int iMem; /* Memory location that acts as accumulator */ - Expr *pExpr; /* The original expression */ + i16 iColumn; /* Column number within the source table */ + i16 iSorterColumn; /* Column number in the sorting index */ } *aCol; int nColumn; /* Number of used entries in aCol[] */ int nAccumulator; /* Number of columns that show through to the output. @@ -17880,9 +17880,18 @@ struct AggInfo { int iDistinct; /* Ephemeral table used to enforce DISTINCT */ } *aFunc; int nFunc; /* Number of entries in aFunc[] */ +#ifdef SQLITE_DEBUG + int iAggMagic; /* Magic number when valid */ +#endif + AggInfo *pNext; /* Next in list of them all */ }; /* +** Value for AggInfo.iAggMagic when the structure is valid +*/ +#define AggInfoMagic 0x2059e99e + +/* ** The datatype ynVar is a signed integer, either 16-bit or 32-bit. ** Usually it is 16-bits. But if SQLITE_MAX_VARIABLE_NUMBER is greater ** than 32767 we have to make it 32-bit. 16-bit is preferred because @@ -18462,6 +18471,7 @@ struct Select { #define SF_WhereBegin 0x0080000 /* Really a WhereBegin() call. Debug Only */ #define SF_WinRewrite 0x0100000 /* Window function rewrite accomplished */ #define SF_View 0x0200000 /* SELECT statement is a view */ +#define SF_NoopOrderBy 0x0400000 /* ORDER BY is ignored for this query */ /* ** The results of a SELECT can be distributed in several ways, as defined @@ -18678,6 +18688,7 @@ struct Parse { Parse *pToplevel; /* Parse structure for main program (or NULL) */ Table *pTriggerTab; /* Table triggers are being coded for */ Parse *pParentParse; /* Parent parser if this parser is nested */ + AggInfo *pAggList; /* List of all AggInfo objects */ int addrCrTab; /* Address of OP_CreateBtree opcode on CREATE TABLE */ u32 nQueryLoop; /* Est number of iterations of a query (10*log2(N)) */ u32 oldmask; /* Mask of old.* columns referenced */ @@ -19644,6 +19655,7 @@ SQLITE_PRIVATE int sqlite3ExprCompareSkip(Expr*, Expr* SQLITE_PRIVATE int sqlite3ExprListCompare(ExprList*, ExprList*, int); SQLITE_PRIVATE int sqlite3ExprImpliesExpr(Parse*,Expr*, Expr*, int); SQLITE_PRIVATE int sqlite3ExprImpliesNonNullRow(Expr*,int); +SQLITE_PRIVATE void sqlite3AggInfoPersistWalkerInit(Walker*,Parse*); SQLITE_PRIVATE void sqlite3ExprAnalyzeAggregates(NameContext*, Expr*); SQLITE_PRIVATE void sqlite3ExprAnalyzeAggList(NameContext*,ExprList*); SQLITE_PRIVATE int sqlite3ExprCoveredByIndex(Expr*, int iCur, Index *pIdx); @@ -64526,16 +64538,18 @@ static int hasSharedCacheTableLock( ** table. */ if( isIndex ){ HashElem *p; + int bSeen = 0; for(p=sqliteHashFirst(&pSchema->idxHash); p; p=sqliteHashNext(p)){ Index *pIdx = (Index *)sqliteHashData(p); if( pIdx->tnum==(int)iRoot ){ - if( iTab ){ + if( bSeen ){ /* Two or more indexes share the same root page. There must ** be imposter tables. So just return true. The assert is not ** useful in that case. */ return 1; } iTab = pIdx->pTable->tnum; + bSeen = 1; } } }else{ @@ -66077,7 +66091,7 @@ static int freeSpace(MemPage *pPage, u16 iStart, u16 i nFrag = iFreeBlk - iEnd; if( iEnd>iFreeBlk ) return SQLITE_CORRUPT_PAGE(pPage); iEnd = iFreeBlk + get2byte(&data[iFreeBlk+2]); - if( NEVER(iEnd > pPage->pBt->usableSize) ){ + if( iEnd > pPage->pBt->usableSize ){ return SQLITE_CORRUPT_PAGE(pPage); } iSize = iEnd - iStart; @@ -87194,7 +87208,7 @@ case OP_Ge: { /* same as TK_GE, jump, in1, if( (flags1 | flags3)&MEM_Str ){ if( (flags1 & (MEM_Int|MEM_IntReal|MEM_Real|MEM_Str))==MEM_Str ){ applyNumericAffinity(pIn1,0); - assert( flags3==pIn3->flags ); + testcase( flags3==pIn3->flags ); flags3 = pIn3->flags; } if( (flags3 & (MEM_Int|MEM_IntReal|MEM_Real|MEM_Str))==MEM_Str ){ @@ -99536,7 +99550,12 @@ SQLITE_PRIVATE char sqlite3ExprAffinity(const Expr *pE op = pExpr->op; if( op==TK_SELECT ){ assert( pExpr->flags&EP_xIsSelect ); - return sqlite3ExprAffinity(pExpr->x.pSelect->pEList->a[0].pExpr); + if( ALWAYS(pExpr->x.pSelect) + && pExpr->x.pSelect->pEList + && ALWAYS(pExpr->x.pSelect->pEList->a[0].pExpr) + ){ + return sqlite3ExprAffinity(pExpr->x.pSelect->pEList->a[0].pExpr); + } } if( op==TK_REGISTER ) op = pExpr->op2; #ifndef SQLITE_OMIT_CAST @@ -101527,8 +101546,10 @@ static int exprNodeIsConstant(Walker *pWalker, Expr *p /* Fall through */ case TK_IF_NULL_ROW: case TK_REGISTER: + case TK_DOT: testcase( pExpr->op==TK_REGISTER ); testcase( pExpr->op==TK_IF_NULL_ROW ); + testcase( pExpr->op==TK_DOT ); pWalker->eCode = 0; return WRC_Abort; case TK_VARIABLE: @@ -105134,11 +105155,26 @@ SQLITE_PRIVATE int sqlite3ExprCoveredByIndex( */ struct SrcCount { SrcList *pSrc; /* One particular FROM clause in a nested query */ + int iSrcInner; /* Smallest cursor number in this context */ int nThis; /* Number of references to columns in pSrcList */ int nOther; /* Number of references to columns in other FROM clauses */ }; /* +** xSelect callback for sqlite3FunctionUsesThisSrc(). If this is the first +** SELECT with a FROM clause encountered during this iteration, set +** SrcCount.iSrcInner to the cursor number of the leftmost object in +** the FROM cause. +*/ +static int selectSrcCount(Walker *pWalker, Select *pSel){ + struct SrcCount *p = pWalker->u.pSrcCount; + if( p->iSrcInner==0x7FFFFFFF && ALWAYS(pSel->pSrc) && pSel->pSrc->nSrc ){ + pWalker->u.pSrcCount->iSrcInner = pSel->pSrc->a[0].iCursor; + } + return WRC_Continue; +} + +/* ** Count the number of references to columns. */ static int exprSrcCount(Walker *pWalker, Expr *pExpr){ @@ -105158,7 +105194,7 @@ static int exprSrcCount(Walker *pWalker, Expr *pExpr){ } if( inThis++; - }else if( nSrc==0 || pExpr->iTablea[0].iCursor ){ + }else if( pExpr->iTableiSrcInner ){ /* In a well-formed parse tree (no name resolution errors), ** TK_COLUMN nodes with smaller Expr.iTable values are in an ** outer context. Those are the only ones to count as "other" */ @@ -105180,9 +105216,10 @@ SQLITE_PRIVATE int sqlite3FunctionUsesThisSrc(Expr *pE assert( pExpr->op==TK_AGG_FUNCTION ); memset(&w, 0, sizeof(w)); w.xExprCallback = exprSrcCount; - w.xSelectCallback = sqlite3SelectWalkNoop; + w.xSelectCallback = selectSrcCount; w.u.pSrcCount = &cnt; cnt.pSrc = pSrcList; + cnt.iSrcInner = (pSrcList&&pSrcList->nSrc)?pSrcList->a[0].iCursor:0x7FFFFFFF; cnt.nThis = 0; cnt.nOther = 0; sqlite3WalkExprList(&w, pExpr->x.pList); @@ -105195,6 +105232,64 @@ SQLITE_PRIVATE int sqlite3FunctionUsesThisSrc(Expr *pE } /* +** This is a Walker expression node callback. +** +** For Expr nodes that contain pAggInfo pointers, make sure the AggInfo +** object that is referenced does not refer directly to the Expr. If +** it does, make a copy. This is done because the pExpr argument is +** subject to change. +** +** The copy is stored on pParse->pConstExpr with a register number of 0. +** This will cause the expression to be deleted automatically when the +** Parse object is destroyed, but the zero register number means that it +** will not generate any code in the preamble. +*/ +static int agginfoPersistExprCb(Walker *pWalker, Expr *pExpr){ + if( ALWAYS(!ExprHasProperty(pExpr, EP_TokenOnly|EP_Reduced)) + && pExpr->pAggInfo!=0 + ){ + AggInfo *pAggInfo = pExpr->pAggInfo; + int iAgg = pExpr->iAgg; + Parse *pParse = pWalker->pParse; + sqlite3 *db = pParse->db; + assert( pExpr->op==TK_AGG_COLUMN || pExpr->op==TK_AGG_FUNCTION ); + if( pExpr->op==TK_AGG_COLUMN ){ + assert( iAgg>=0 && iAggnColumn ); + if( pAggInfo->aCol[iAgg].pExpr==pExpr ){ + pExpr = sqlite3ExprDup(db, pExpr, 0); + if( pExpr ){ + pAggInfo->aCol[iAgg].pExpr = pExpr; + pParse->pConstExpr = + sqlite3ExprListAppend(pParse, pParse->pConstExpr, pExpr); + } + } + }else{ + assert( iAgg>=0 && iAggnFunc ); + if( pAggInfo->aFunc[iAgg].pExpr==pExpr ){ + pExpr = sqlite3ExprDup(db, pExpr, 0); + if( pExpr ){ + pAggInfo->aFunc[iAgg].pExpr = pExpr; + pParse->pConstExpr = + sqlite3ExprListAppend(pParse, pParse->pConstExpr, pExpr); + } + } + } + } + return WRC_Continue; +} + +/* +** Initialize a Walker object so that will persist AggInfo entries referenced +** by the tree that is walked. +*/ +SQLITE_PRIVATE void sqlite3AggInfoPersistWalkerInit(Walker *pWalker, Parse *pParse){ + memset(pWalker, 0, sizeof(*pWalker)); + pWalker->pParse = pParse; + pWalker->xExprCallback = agginfoPersistExprCb; + pWalker->xSelectCallback = sqlite3SelectWalkNoop; +} + +/* ** Add a new element to the pAggInfo->aCol[] array. Return the index of ** the new element. Return a negative number if malloc fails. */ @@ -105224,7 +105319,7 @@ static int addAggInfoFunc(sqlite3 *db, AggInfo *pInfo) &i ); return i; -} +} /* ** This is the xExprCallback for a tree walker. It is used to @@ -110255,12 +110350,21 @@ SQLITE_PRIVATE void sqlite3FinishCoding(Parse *pParse) */ sqlite3AutoincrementBegin(pParse); - /* Code constant expressions that where factored out of inner loops */ + /* Code constant expressions that where factored out of inner loops. + ** + ** The pConstExpr list might also contain expressions that we simply + ** want to keep around until the Parse object is deleted. Such + ** expressions have iConstExprReg==0. Do not generate code for + ** those expressions, of course. + */ if( pParse->pConstExpr ){ ExprList *pEL = pParse->pConstExpr; pParse->okConstFactor = 0; for(i=0; inExpr; i++){ - sqlite3ExprCode(pParse, pEL->a[i].pExpr, pEL->a[i].u.iConstExprReg); + int iReg = pEL->a[i].u.iConstExprReg; + if( iReg>0 ){ + sqlite3ExprCode(pParse, pEL->a[i].pExpr, iReg); + } } } @@ -128435,10 +128539,25 @@ SQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, S } /* +** Deallocate a single AggInfo object +*/ +static void agginfoFree(sqlite3 *db, AggInfo *p){ + sqlite3DbFree(db, p->aCol); + sqlite3DbFree(db, p->aFunc); + sqlite3DbFree(db, p); +} + +/* ** Free all memory allocations in the pParse object */ SQLITE_PRIVATE void sqlite3ParserReset(Parse *pParse){ sqlite3 *db = pParse->db; + AggInfo *pThis = pParse->pAggList; + while( pThis ){ + AggInfo *pNext = pThis->pNext; + agginfoFree(db, pThis); + pThis = pNext; + } sqlite3DbFree(db, pParse->aLabel); sqlite3ExprListDelete(db, pParse->pConstExpr); if( db ){ @@ -131553,9 +131672,7 @@ static int multiSelect( selectOpName(p->op))); rc = sqlite3Select(pParse, p, &uniondest); testcase( rc!=SQLITE_OK ); - /* Query flattening in sqlite3Select() might refill p->pOrderBy. - ** Be sure to delete p->pOrderBy, therefore, to avoid a memory leak. */ - sqlite3ExprListDelete(db, p->pOrderBy); + assert( p->pOrderBy==0 ); pDelete = p->pPrior; p->pPrior = pPrior; p->pOrderBy = 0; @@ -132628,6 +132745,7 @@ static int flattenSubquery( Expr *pWhere; /* The WHERE clause */ struct SrcList_item *pSubitem; /* The subquery */ sqlite3 *db = pParse->db; + Walker w; /* Walker to persist agginfo data */ /* Check to see if flattening is permitted. Return 0 if not. */ @@ -132941,7 +133059,7 @@ static int flattenSubquery( ** We look at every expression in the outer query and every place we see ** "a" we substitute "x*3" and every place we see "b" we substitute "y+10". */ - if( pSub->pOrderBy ){ + if( pSub->pOrderBy && (pParent->selFlags & SF_NoopOrderBy)==0 ){ /* At this point, any non-zero iOrderByCol values indicate that the ** ORDER BY column expression is identical to the iOrderByCol'th ** expression returned by SELECT statement pSub. Since these values @@ -132965,7 +133083,13 @@ static int flattenSubquery( if( isLeftJoin>0 ){ sqlite3SetJoinExpr(pWhere, iNewParent); } - pParent->pWhere = sqlite3ExprAnd(pParse, pWhere, pParent->pWhere); + if( pWhere ){ + if( pParent->pWhere ){ + pParent->pWhere = sqlite3PExpr(pParse, TK_AND, pWhere, pParent->pWhere); + }else{ + pParent->pWhere = pWhere; + } + } if( db->mallocFailed==0 ){ SubstContext x; x.pParse = pParse; @@ -133002,6 +133126,8 @@ static int flattenSubquery( /* Finially, delete what is left of the subquery and return ** success. */ + sqlite3AggInfoPersistWalkerInit(&w, pParse); + sqlite3WalkSelect(&w,pSub1); sqlite3SelectDelete(db, pSub1); #if SELECTTRACE_ENABLED @@ -133262,11 +133388,14 @@ static int pushDownWhereTerms( ){ Expr *pNew; int nChng = 0; + Select *pSel; if( pWhere==0 ) return 0; if( pSubq->selFlags & SF_Recursive ) return 0; /* restriction (2) */ #ifndef SQLITE_OMIT_WINDOWFUNC - if( pSubq->pWin ) return 0; /* restriction (6) */ + for(pSel=pSubq; pSel; pSel=pSel->pPrior){ + if( pSel->pWin ) return 0; /* restriction (6) */ + } #endif #ifdef SQLITE_DEBUG @@ -133466,6 +133595,14 @@ static int convertCompoundSelectToSubquery(Walker *pWa for(pX=p; pX && (pX->op==TK_ALL || pX->op==TK_SELECT); pX=pX->pPrior){} if( pX==0 ) return WRC_Continue; a = p->pOrderBy->a; +#ifndef SQLITE_OMIT_WINDOWFUNC + /* If iOrderByCol is already non-zero, then it has already been matched + ** to a result column of the SELECT statement. This occurs when the + ** SELECT is rewritten for window-functions processing and then passed + ** to sqlite3SelectPrep() and similar a second time. The rewriting done + ** by this function is not required in this case. */ + if( a[0].u.x.iOrderByCol ) return WRC_Continue; +#endif for(i=p->pOrderBy->nExpr-1; i>=0; i--){ if( a[i].pExpr->flags & EP_Collate ) break; } @@ -134586,10 +134723,10 @@ SQLITE_PRIVATE int sqlite3Select( Expr *pWhere; /* The WHERE clause. May be NULL */ ExprList *pGroupBy; /* The GROUP BY clause. May be NULL */ Expr *pHaving; /* The HAVING clause. May be NULL */ + AggInfo *pAggInfo = 0; /* Aggregate information */ int rc = 1; /* Value to return from this function */ DistinctCtx sDistinct; /* Info on how to code the DISTINCT keyword */ SortCtx sSort; /* Info on how to code the ORDER BY clause */ - AggInfo sAggInfo; /* Information used by aggregate queries */ int iEnd; /* Address of the end of the query */ sqlite3 *db; /* The database connection */ ExprList *pMinMaxOrderBy = 0; /* Added ORDER BY for min/max queries */ @@ -134601,7 +134738,6 @@ SQLITE_PRIVATE int sqlite3Select( return 1; } if( sqlite3AuthCheck(pParse, SQLITE_SELECT, 0, 0, 0) ) return 1; - memset(&sAggInfo, 0, sizeof(sAggInfo)); #if SELECTTRACE_ENABLED SELECTTRACE(1,pParse,p, ("begin processing:\n", pParse->addrExplain)); if( sqlite3SelectTrace & 0x100 ){ @@ -134623,6 +134759,7 @@ SQLITE_PRIVATE int sqlite3Select( sqlite3ExprListDelete(db, p->pOrderBy); p->pOrderBy = 0; p->selFlags &= ~SF_Distinct; + p->selFlags |= SF_NoopOrderBy; } sqlite3SelectPrep(pParse, p, 0); if( pParse->nErr || db->mallocFailed ){ @@ -135191,14 +135328,20 @@ SQLITE_PRIVATE int sqlite3Select( ** sAggInfo for all TK_AGG_FUNCTION nodes in expressions of the ** SELECT statement. */ + pAggInfo = sqlite3DbMallocZero(db, sizeof(*pAggInfo) ); + if( pAggInfo==0 ){ + goto select_end; + } + pAggInfo->pNext = pParse->pAggList; + pParse->pAggList = pAggInfo; memset(&sNC, 0, sizeof(sNC)); sNC.pParse = pParse; sNC.pSrcList = pTabList; - sNC.uNC.pAggInfo = &sAggInfo; + sNC.uNC.pAggInfo = pAggInfo; VVA_ONLY( sNC.ncFlags = NC_UAggInfo; ) - sAggInfo.mnReg = pParse->nMem+1; - sAggInfo.nSortingColumn = pGroupBy ? pGroupBy->nExpr : 0; - sAggInfo.pGroupBy = pGroupBy; + pAggInfo->mnReg = pParse->nMem+1; + pAggInfo->nSortingColumn = pGroupBy ? pGroupBy->nExpr : 0; + pAggInfo->pGroupBy = pGroupBy; sqlite3ExprAnalyzeAggList(&sNC, pEList); sqlite3ExprAnalyzeAggList(&sNC, sSort.pOrderBy); if( pHaving ){ @@ -135211,14 +135354,14 @@ SQLITE_PRIVATE int sqlite3Select( } sqlite3ExprAnalyzeAggregates(&sNC, pHaving); } - sAggInfo.nAccumulator = sAggInfo.nColumn; - if( p->pGroupBy==0 && p->pHaving==0 && sAggInfo.nFunc==1 ){ - minMaxFlag = minMaxQuery(db, sAggInfo.aFunc[0].pExpr, &pMinMaxOrderBy); + pAggInfo->nAccumulator = pAggInfo->nColumn; + if( p->pGroupBy==0 && p->pHaving==0 && pAggInfo->nFunc==1 ){ + minMaxFlag = minMaxQuery(db, pAggInfo->aFunc[0].pExpr, &pMinMaxOrderBy); }else{ minMaxFlag = WHERE_ORDERBY_NORMAL; } - for(i=0; inFunc; i++){ + Expr *pExpr = pAggInfo->aFunc[i].pExpr; assert( !ExprHasProperty(pExpr, EP_xIsSelect) ); sNC.ncFlags |= NC_InAggFunc; sqlite3ExprAnalyzeAggList(&sNC, pExpr->x.pList); @@ -135230,22 +135373,22 @@ SQLITE_PRIVATE int sqlite3Select( #endif sNC.ncFlags &= ~NC_InAggFunc; } - sAggInfo.mxReg = pParse->nMem; + pAggInfo->mxReg = pParse->nMem; if( db->mallocFailed ) goto select_end; #if SELECTTRACE_ENABLED if( sqlite3SelectTrace & 0x400 ){ int ii; - SELECTTRACE(0x400,pParse,p,("After aggregate analysis %p:\n", &sAggInfo)); + SELECTTRACE(0x400,pParse,p,("After aggregate analysis %p:\n", pAggInfo)); sqlite3TreeViewSelect(0, p, 0); - for(ii=0; iinColumn; ii++){ sqlite3DebugPrintf("agg-column[%d] iMem=%d\n", - ii, sAggInfo.aCol[ii].iMem); - sqlite3TreeViewExpr(0, sAggInfo.aCol[ii].pExpr, 0); + ii, pAggInfo->aCol[ii].iMem); + sqlite3TreeViewExpr(0, pAggInfo->aCol[ii].pExpr, 0); } - for(ii=0; iinFunc; ii++){ sqlite3DebugPrintf("agg-func[%d]: iMem=%d\n", - ii, sAggInfo.aFunc[ii].iMem); - sqlite3TreeViewExpr(0, sAggInfo.aFunc[ii].pExpr, 0); + ii, pAggInfo->aFunc[ii].iMem); + sqlite3TreeViewExpr(0, pAggInfo->aFunc[ii].pExpr, 0); } } #endif @@ -135270,10 +135413,11 @@ SQLITE_PRIVATE int sqlite3Select( ** that we do not need it after all, the OP_SorterOpen instruction ** will be converted into a Noop. */ - sAggInfo.sortingIdx = pParse->nTab++; - pKeyInfo = sqlite3KeyInfoFromExprList(pParse,pGroupBy,0,sAggInfo.nColumn); + pAggInfo->sortingIdx = pParse->nTab++; + pKeyInfo = sqlite3KeyInfoFromExprList(pParse, pGroupBy, + 0, pAggInfo->nColumn); addrSortingIdx = sqlite3VdbeAddOp4(v, OP_SorterOpen, - sAggInfo.sortingIdx, sAggInfo.nSortingColumn, + pAggInfo->sortingIdx, pAggInfo->nSortingColumn, 0, (char*)pKeyInfo, P4_KEYINFO); /* Initialize memory locations used by GROUP BY aggregate processing @@ -135328,8 +135472,8 @@ SQLITE_PRIVATE int sqlite3Select( nGroupBy = pGroupBy->nExpr; nCol = nGroupBy; j = nGroupBy; - for(i=0; i=j ){ + for(i=0; inColumn; i++){ + if( pAggInfo->aCol[i].iSorterColumn>=j ){ nCol++; j++; } @@ -135337,8 +135481,8 @@ SQLITE_PRIVATE int sqlite3Select( regBase = sqlite3GetTempRange(pParse, nCol); sqlite3ExprCodeExprList(pParse, pGroupBy, regBase, 0, 0); j = nGroupBy; - for(i=0; inColumn; i++){ + struct AggInfo_col *pCol = &pAggInfo->aCol[i]; if( pCol->iSorterColumn>=j ){ int r1 = j + regBase; sqlite3ExprCodeGetColumnOfTable(v, @@ -135348,16 +135492,16 @@ SQLITE_PRIVATE int sqlite3Select( } regRecord = sqlite3GetTempReg(pParse); sqlite3VdbeAddOp3(v, OP_MakeRecord, regBase, nCol, regRecord); - sqlite3VdbeAddOp2(v, OP_SorterInsert, sAggInfo.sortingIdx, regRecord); + sqlite3VdbeAddOp2(v, OP_SorterInsert, pAggInfo->sortingIdx, regRecord); sqlite3ReleaseTempReg(pParse, regRecord); sqlite3ReleaseTempRange(pParse, regBase, nCol); sqlite3WhereEnd(pWInfo); - sAggInfo.sortingIdxPTab = sortPTab = pParse->nTab++; + pAggInfo->sortingIdxPTab = sortPTab = pParse->nTab++; sortOut = sqlite3GetTempReg(pParse); sqlite3VdbeAddOp3(v, OP_OpenPseudo, sortPTab, sortOut, nCol); - sqlite3VdbeAddOp2(v, OP_SorterSort, sAggInfo.sortingIdx, addrEnd); + sqlite3VdbeAddOp2(v, OP_SorterSort, pAggInfo->sortingIdx, addrEnd); VdbeComment((v, "GROUP BY sort")); VdbeCoverage(v); - sAggInfo.useSortingIdx = 1; + pAggInfo->useSortingIdx = 1; } /* If the index or temporary table used by the GROUP BY sort @@ -135381,14 +135525,14 @@ SQLITE_PRIVATE int sqlite3Select( */ addrTopOfLoop = sqlite3VdbeCurrentAddr(v); if( groupBySort ){ - sqlite3VdbeAddOp3(v, OP_SorterData, sAggInfo.sortingIdx, + sqlite3VdbeAddOp3(v, OP_SorterData, pAggInfo->sortingIdx, sortOut, sortPTab); } for(j=0; jnExpr; j++){ if( groupBySort ){ sqlite3VdbeAddOp3(v, OP_Column, sortPTab, j, iBMem+j); }else{ - sAggInfo.directMode = 1; + pAggInfo->directMode = 1; sqlite3ExprCode(pParse, pGroupBy->a[j].pExpr, iBMem+j); } } @@ -135418,14 +135562,14 @@ SQLITE_PRIVATE int sqlite3Select( ** the current row */ sqlite3VdbeJumpHere(v, addr1); - updateAccumulator(pParse, iUseFlag, &sAggInfo); + updateAccumulator(pParse, iUseFlag, pAggInfo); sqlite3VdbeAddOp2(v, OP_Integer, 1, iUseFlag); VdbeComment((v, "indicate data in accumulator")); /* End of the loop */ if( groupBySort ){ - sqlite3VdbeAddOp2(v, OP_SorterNext, sAggInfo.sortingIdx, addrTopOfLoop); + sqlite3VdbeAddOp2(v, OP_SorterNext, pAggInfo->sortingIdx, addrTopOfLoop); VdbeCoverage(v); }else{ sqlite3WhereEnd(pWInfo); @@ -135458,7 +135602,7 @@ SQLITE_PRIVATE int sqlite3Select( VdbeCoverage(v); VdbeComment((v, "Groupby result generator entry point")); sqlite3VdbeAddOp1(v, OP_Return, regOutputRow); - finalizeAggFunctions(pParse, &sAggInfo); + finalizeAggFunctions(pParse, pAggInfo); sqlite3ExprIfFalse(pParse, pHaving, addrOutputRow+1, SQLITE_JUMPIFNULL); selectInnerLoop(pParse, p, -1, &sSort, &sDistinct, pDest, @@ -135469,7 +135613,7 @@ SQLITE_PRIVATE int sqlite3Select( /* Generate a subroutine that will reset the group-by accumulator */ sqlite3VdbeResolveLabel(v, addrReset); - resetAccumulator(pParse, &sAggInfo); + resetAccumulator(pParse, pAggInfo); sqlite3VdbeAddOp2(v, OP_Integer, 0, iUseFlag); VdbeComment((v, "indicate accumulator empty")); sqlite3VdbeAddOp1(v, OP_Return, regReset); @@ -135477,7 +135621,7 @@ SQLITE_PRIVATE int sqlite3Select( } /* endif pGroupBy. Begin aggregate queries without GROUP BY: */ else { Table *pTab; - if( (pTab = isSimpleCount(p, &sAggInfo))!=0 ){ + if( (pTab = isSimpleCount(p, pAggInfo))!=0 ){ /* If isSimpleCount() returns a pointer to a Table structure, then ** the SQL statement is of the form: ** @@ -135532,7 +135676,7 @@ SQLITE_PRIVATE int sqlite3Select( if( pKeyInfo ){ sqlite3VdbeChangeP4(v, -1, (char *)pKeyInfo, P4_KEYINFO); } - sqlite3VdbeAddOp2(v, OP_Count, iCsr, sAggInfo.aFunc[0].iMem); + sqlite3VdbeAddOp2(v, OP_Count, iCsr, pAggInfo->aFunc[0].iMem); sqlite3VdbeAddOp1(v, OP_Close, iCsr); explainSimpleCount(pParse, pTab, pBest); }else{ @@ -135547,12 +135691,16 @@ SQLITE_PRIVATE int sqlite3Select( ** first row visited by the aggregate, so that they are updated at ** least once even if the FILTER clause means the min() or max() ** function visits zero rows. */ - if( sAggInfo.nAccumulator ){ - for(i=0; ifuncFlags&SQLITE_FUNC_NEEDCOLL ) break; + if( pAggInfo->nAccumulator ){ + for(i=0; inFunc; i++){ + if( ExprHasProperty(pAggInfo->aFunc[i].pExpr, EP_WinFunc) ){ + continue; + } + if( pAggInfo->aFunc[i].pFunc->funcFlags&SQLITE_FUNC_NEEDCOLL ){ + break; + } } - if( i==sAggInfo.nFunc ){ + if( i==pAggInfo->nFunc ){ regAcc = ++pParse->nMem; sqlite3VdbeAddOp2(v, OP_Integer, 0, regAcc); } @@ -135563,7 +135711,7 @@ SQLITE_PRIVATE int sqlite3Select( ** of output. */ assert( p->pGroupBy==0 ); - resetAccumulator(pParse, &sAggInfo); + resetAccumulator(pParse, pAggInfo); /* If this query is a candidate for the min/max optimization, then ** minMaxFlag will have been previously set to either @@ -135579,7 +135727,7 @@ SQLITE_PRIVATE int sqlite3Select( if( pWInfo==0 ){ goto select_end; } - updateAccumulator(pParse, regAcc, &sAggInfo); + updateAccumulator(pParse, regAcc, pAggInfo); if( regAcc ) sqlite3VdbeAddOp2(v, OP_Integer, 1, regAcc); if( sqlite3WhereIsOrdered(pWInfo)>0 ){ sqlite3VdbeGoto(v, sqlite3WhereBreakLabel(pWInfo)); @@ -135587,7 +135735,7 @@ SQLITE_PRIVATE int sqlite3Select( (minMaxFlag==WHERE_ORDERBY_MIN?"min":"max"))); } sqlite3WhereEnd(pWInfo); - finalizeAggFunctions(pParse, &sAggInfo); + finalizeAggFunctions(pParse, pAggInfo); } sSort.pOrderBy = 0; @@ -135626,8 +135774,25 @@ SQLITE_PRIVATE int sqlite3Select( */ select_end: sqlite3ExprListDelete(db, pMinMaxOrderBy); - sqlite3DbFree(db, sAggInfo.aCol); - sqlite3DbFree(db, sAggInfo.aFunc); +#ifdef SQLITE_DEBUG + if( pAggInfo && !db->mallocFailed ){ + for(i=0; inColumn; i++){ + Expr *pExpr = pAggInfo->aCol[i].pExpr; + assert( pExpr!=0 || db->mallocFailed ); + if( pExpr==0 ) continue; + assert( pExpr->pAggInfo==pAggInfo ); + assert( pExpr->iAgg==i ); + } + for(i=0; inFunc; i++){ + Expr *pExpr = pAggInfo->aFunc[i].pExpr; + assert( pExpr!=0 || db->mallocFailed ); + if( pExpr==0 ) continue; + assert( pExpr->pAggInfo==pAggInfo ); + assert( pExpr->iAgg==i ); + } + } +#endif + #if SELECTTRACE_ENABLED SELECTTRACE(0x1,pParse,p,("end processing\n")); if( (sqlite3SelectTrace & 0x2000)!=0 && ExplainQueryPlanParent(pParse)==0 ){ @@ -151319,12 +151484,16 @@ SQLITE_PRIVATE int sqlite3WindowRewrite(Parse *pParse, Window *pMWin = p->pWin; /* Master window object */ Window *pWin; /* Window object iterator */ Table *pTab; + Walker w; + u32 selFlags = p->selFlags; pTab = sqlite3DbMallocZero(db, sizeof(Table)); if( pTab==0 ){ return sqlite3ErrorToParser(db, SQLITE_NOMEM); } + sqlite3AggInfoPersistWalkerInit(&w, pParse); + sqlite3WalkSelect(&w, p); p->pSrc = 0; p->pWhere = 0; @@ -151405,7 +151574,6 @@ SQLITE_PRIVATE int sqlite3WindowRewrite(Parse *pParse, p->pSrc = sqlite3SrcListAppend(pParse, 0, 0, 0); if( p->pSrc ){ Table *pTab2; - Walker w; p->pSrc->a[0].pSelect = pSub; sqlite3SrcListAssignCursors(pParse, p->pSrc); pSub->selFlags |= SF_Expanded; @@ -168302,6 +168470,9 @@ static int fts3PoslistMerge( */ fts3GetDeltaVarint(&p1, &i1); fts3GetDeltaVarint(&p2, &i2); + if( i1<2 || i2<2 ){ + break; + } do { fts3PutDeltaVarint(&p, &iPrev, (i10 ); assert( *pbEof==0 ); - assert( p || *piDocid==0 ); + assert_fts3_nc( p || *piDocid==0 ); assert( !p || (p>=aDoclist && p<=&aDoclist[nDoclist]) ); if( p==0 ){ @@ -171205,7 +171376,7 @@ static void fts3EvalInvalidatePoslist(Fts3Phrase *pPhr ** ** Parameter nNear is passed the NEAR distance of the expression (5 in ** the example above). When this function is called, *paPoslist points to -** the position list, and *pnToken is the number of phrase tokens in, the +** the position list, and *pnToken is the number of phrase tokens in the ** phrase on the other side of the NEAR operator to pPhrase. For example, ** if pPhrase refers to the "def ghi" phrase, then *paPoslist points to ** the position list associated with phrase "abc". @@ -224824,7 +224995,7 @@ static void fts5SourceIdFunc( ){ assert( nArg==0 ); UNUSED_PARAM2(nArg, apUnused); - sqlite3_result_text(pCtx, "fts5: 2020-06-04 12:58:43 ec02243ea6ce33b090870ae55ab8aa2534b54d216d45c4aa2fdbb00e86861e8c", -1, SQLITE_TRANSIENT); + sqlite3_result_text(pCtx, "fts5: 2020-06-18 14:00:33 7ebdfa80be8e8e73324b8d66b3460222eb74c7e9dfd655b48d6ca7e1933cc8fd", -1, SQLITE_TRANSIENT); } /* @@ -229607,9 +229778,9 @@ SQLITE_API int sqlite3_stmt_init( #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */ /************** End of stmt.c ************************************************/ -#if __LINE__!=229610 +#if __LINE__!=229781 #undef SQLITE_SOURCE_ID -#define SQLITE_SOURCE_ID "2020-06-04 12:58:43 ec02243ea6ce33b090870ae55ab8aa2534b54d216d45c4aa2fdbb00e8686alt2" +#define SQLITE_SOURCE_ID "2020-06-18 14:00:33 7ebdfa80be8e8e73324b8d66b3460222eb74c7e9dfd655b48d6ca7e1933calt2" #endif /* Return the source-id for this library */ SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } Modified: stable/11/contrib/sqlite3/sqlite3.h ============================================================================== --- stable/11/contrib/sqlite3/sqlite3.h Tue Jul 14 12:02:30 2020 (r363178) +++ stable/11/contrib/sqlite3/sqlite3.h Tue Jul 14 13:21:09 2020 (r363179) @@ -123,9 +123,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.32.2" -#define SQLITE_VERSION_NUMBER 3032002 -#define SQLITE_SOURCE_ID "2020-06-04 12:58:43 ec02243ea6ce33b090870ae55ab8aa2534b54d216d45c4aa2fdbb00e86861e8c" +#define SQLITE_VERSION "3.32.3" +#define SQLITE_VERSION_NUMBER 3032003 +#define SQLITE_SOURCE_ID "2020-06-18 14:00:33 7ebdfa80be8e8e73324b8d66b3460222eb74c7e9dfd655b48d6ca7e1933cc8fd" /* ** CAPI3REF: Run-Time Library Version Numbers Modified: stable/11/contrib/sqlite3/tea/configure ============================================================================== --- stable/11/contrib/sqlite3/tea/configure Tue Jul 14 12:02:30 2020 (r363178) +++ stable/11/contrib/sqlite3/tea/configure Tue Jul 14 13:21:09 2020 (r363179) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.32.2. +# Generated by GNU Autoconf 2.69 for sqlite 3.32.3. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -577,8 +577,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.32.2' -PACKAGE_STRING='sqlite 3.32.2' +PACKAGE_VERSION='3.32.3' +PACKAGE_STRING='sqlite 3.32.3' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1303,7 +1303,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.32.2 to adapt to many kinds of systems. +\`configure' configures sqlite 3.32.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1365,7 +1365,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.32.2:";; + short | recursive ) echo "Configuration of sqlite 3.32.3:";; esac cat <<\_ACEOF @@ -1467,7 +1467,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.32.2 +sqlite configure 3.32.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1878,7 +1878,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.32.2, which was +It was created by sqlite $as_me 3.32.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -9373,7 +9373,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.32.2, which was +This file was extended by sqlite $as_me 3.32.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -9426,7 +9426,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.32.2 +sqlite config.status 3.32.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/11/contrib/sqlite3/tea/configure.ac ============================================================================== --- stable/11/contrib/sqlite3/tea/configure.ac Tue Jul 14 12:02:30 2020 (r363178) +++ stable/11/contrib/sqlite3/tea/configure.ac Tue Jul 14 13:21:09 2020 (r363179) @@ -19,7 +19,7 @@ dnl to configure the system for the local environment. # so you can encode the package version directly into the source files. #----------------------------------------------------------------------- -AC_INIT([sqlite], [3.32.2]) +AC_INIT([sqlite], [3.32.3]) #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. From owner-svn-src-stable-11@freebsd.org Tue Jul 14 17:46:41 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3966136A238; Tue, 14 Jul 2020 17:46:41 +0000 (UTC) (envelope-from gonzo@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B5ny872tHz3Slr; Tue, 14 Jul 2020 17:46:40 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F7A99F51; Tue, 14 Jul 2020 17:46:40 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06EHkeHB091576; Tue, 14 Jul 2020 17:46:40 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06EHkeBU091575; Tue, 14 Jul 2020 17:46:40 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <202007141746.06EHkeBU091575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 14 Jul 2020 17:46:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r363186 - stable/11/contrib/ldns/drill X-SVN-Group: stable-11 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/11/contrib/ldns/drill X-SVN-Commit-Revision: 363186 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jul 2020 17:46:41 -0000 Author: gonzo Date: Tue Jul 14 17:46:40 2020 New Revision: 363186 URL: https://svnweb.freebsd.org/changeset/base/363186 Log: MFC r362516: Fix crash in drill(1) when IP has two subsequent dots Cherry-pick crash fix from the upstream repo PR: 226575 Reported by: Goran Mekić Obtained from: https://git.nlnetlabs.nl/ldns/commit/?id=98291475 Modified: stable/11/contrib/ldns/drill/drill.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/ldns/drill/drill.c ============================================================================== --- stable/11/contrib/ldns/drill/drill.c Tue Jul 14 17:23:25 2020 (r363185) +++ stable/11/contrib/ldns/drill/drill.c Tue Jul 14 17:46:40 2020 (r363186) @@ -747,15 +747,17 @@ main(int argc, char *argv[]) free(name2); } else { qname = ldns_dname_new_frm_str(name); - qname_tmp = ldns_dname_reverse(qname); - ldns_rdf_deep_free(qname); - qname = qname_tmp; - qname_tmp = ldns_dname_new_frm_str("in-addr.arpa."); - status = ldns_dname_cat(qname, qname_tmp); - if (status != LDNS_STATUS_OK) { - error("%s", "could not create reverse address for ip4: %s\n", ldns_get_errorstr_by_id(status)); + if (qname) { + qname_tmp = ldns_dname_reverse(qname); + ldns_rdf_deep_free(qname); + qname = qname_tmp; + qname_tmp = ldns_dname_new_frm_str("in-addr.arpa."); + status = ldns_dname_cat(qname, qname_tmp); + if (status != LDNS_STATUS_OK) { + error("%s", "could not create reverse address for ip4: %s\n", ldns_get_errorstr_by_id(status)); + } + ldns_rdf_deep_free(qname_tmp); } - ldns_rdf_deep_free(qname_tmp); } if (!qname) { error("%s", "-x implies an ip address"); From owner-svn-src-stable-11@freebsd.org Tue Jul 14 18:31:16 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6CF7236BB5D; Tue, 14 Jul 2020 18:31:16 +0000 (UTC) (envelope-from gonzo@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B5pxc2LcFz3RsR; Tue, 14 Jul 2020 18:31:16 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35279A7B2; Tue, 14 Jul 2020 18:31:16 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06EIVG76021390; Tue, 14 Jul 2020 18:31:16 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06EIVGTQ021389; Tue, 14 Jul 2020 18:31:16 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <202007141831.06EIVGTQ021389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 14 Jul 2020 18:31:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r363190 - stable/11/usr.bin/mkimg X-SVN-Group: stable-11 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/11/usr.bin/mkimg X-SVN-Commit-Revision: 363190 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jul 2020 18:31:16 -0000 Author: gonzo Date: Tue Jul 14 18:31:15 2020 New Revision: 363190 URL: https://svnweb.freebsd.org/changeset/base/363190 Log: MFC r363140: Fix invalid VHDX generation for image larger than 4Gb - Part of BAT payload location was lost due to invalid BAT entry encoding type (32 bits instead of 64 bits) - The sequence of PB/SB entries in BAT was broken due to off-by-one index check. It worked for smaller than 4Gb because there were no SB entries in BAT. Modified: stable/11/usr.bin/mkimg/vhdx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/mkimg/vhdx.c ============================================================================== --- stable/11/usr.bin/mkimg/vhdx.c Tue Jul 14 18:31:00 2020 (r363189) +++ stable/11/usr.bin/mkimg/vhdx.c Tue Jul 14 18:31:15 2020 (r363190) @@ -430,7 +430,7 @@ vhdx_write_bat(int fd, uint64_t image_size) payload_offset = 3 + (bat_size / SIZE_1MB); bat_ptr = 0; for (idx = 0; idx < data_block_count; idx++) { - le32enc(bat + bat_ptr, + le64enc(bat + bat_ptr, BAT_ENTRY(payload_offset, PAYLOAD_BLOCK_FULLY_PRESENT)); bat_ptr += 8; payload_offset += (PAYLOAD_BLOCK_SIZE / SIZE_1MB); @@ -446,9 +446,9 @@ vhdx_write_bat(int fd, uint64_t image_size) bat_ptr = 0; } - if ((idx % chunk_ratio) == 0 && - (idx > 0) && (idx != data_block_count - 1)) { - le32enc(bat + bat_ptr, + if (((idx + 1) % chunk_ratio) == 0 && + (idx != data_block_count - 1)) { + le64enc(bat + bat_ptr, BAT_ENTRY(0, SB_BLOCK_NOT_PRESENT)); bat_ptr += 8; From owner-svn-src-stable-11@freebsd.org Wed Jul 15 22:42:51 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6F6C2372592; Wed, 15 Jul 2020 22:42:51 +0000 (UTC) (envelope-from eugen@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B6XTR27F0z4cFj; Wed, 15 Jul 2020 22:42:51 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D9321E69F; Wed, 15 Jul 2020 22:42:51 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06FMgo6K074870; Wed, 15 Jul 2020 22:42:50 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06FMgoKE074869; Wed, 15 Jul 2020 22:42:50 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <202007152242.06FMgoKE074869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Wed, 15 Jul 2020 22:42:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r363238 - stable/11/usr.sbin/newsyslog X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/usr.sbin/newsyslog X-SVN-Commit-Revision: 363238 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jul 2020 22:42:51 -0000 Author: eugen Date: Wed Jul 15 22:42:50 2020 New Revision: 363238 URL: https://svnweb.freebsd.org/changeset/base/363238 Log: MFC r362233: newsyslog(8): make configuration parser more robust. Modified: stable/11/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/11/usr.sbin/newsyslog/newsyslog.c Wed Jul 15 22:41:58 2020 (r363237) +++ stable/11/usr.sbin/newsyslog/newsyslog.c Wed Jul 15 22:42:50 2020 (r363238) @@ -1085,9 +1085,11 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl q = parse = missing_field(sob(line), errline); parse = son(line); - if (!*parse) - errx(1, "malformed line (missing fields):\n%s", + if (!*parse) { + warnx("malformed line (missing fields):\n%s", errline); + continue; + } *parse = '\0'; /* @@ -1139,22 +1141,24 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl continue; } +#define badline(msg, ...) do { \ + warnx(msg, __VA_ARGS__); \ + goto cleanup; \ +} while (0) + special = 0; working = init_entry(q, NULL); if (strcasecmp(DEFAULT_MARKER, q) == 0) { special = 1; - if (*defconf_p != NULL) { - warnx("Ignoring duplicate entry for %s!", q); - free_entry(working); - continue; - } + if (*defconf_p != NULL) + badline("Ignoring duplicate entry for %s!", q); *defconf_p = working; } q = parse = missing_field(sob(parse + 1), errline); parse = son(parse); if (!*parse) - errx(1, "malformed line (missing fields):\n%s", + badline("malformed line (missing fields):\n%s", errline); *parse = '\0'; if ((group = strchr(q, ':')) != NULL || @@ -1163,7 +1167,7 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl if (*q) { if (!(isnumberstr(q))) { if ((pwd = getpwnam(q)) == NULL) - errx(1, + badline( "error in config file; unknown user:\n%s", errline); working->uid = pwd->pw_uid; @@ -1176,7 +1180,7 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl if (*q) { if (!(isnumberstr(q))) { if ((grp = getgrnam(q)) == NULL) - errx(1, + badline( "error in config file; unknown group:\n%s", errline); working->gid = grp->gr_gid; @@ -1188,7 +1192,7 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl q = parse = missing_field(sob(parse + 1), errline); parse = son(parse); if (!*parse) - errx(1, "malformed line (missing fields):\n%s", + badline("malformed line (missing fields):\n%s", errline); *parse = '\0'; } else { @@ -1197,23 +1201,23 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl } if (!sscanf(q, "%o", &working->permissions)) - errx(1, "error in config file; bad permissions:\n%s", + badline("error in config file; bad permissions:\n%s", errline); q = parse = missing_field(sob(parse + 1), errline); parse = son(parse); if (!*parse) - errx(1, "malformed line (missing fields):\n%s", + badline("malformed line (missing fields):\n%s", errline); *parse = '\0'; if (!sscanf(q, "%d", &working->numlogs) || working->numlogs < 0) - errx(1, "error in config file; bad value for count of logs to save:\n%s", + badline("error in config file; bad value for count of logs to save:\n%s", errline); q = parse = missing_field(sob(parse + 1), errline); parse = son(parse); if (!*parse) - errx(1, "malformed line (missing fields):\n%s", + badline("malformed line (missing fields):\n%s", errline); *parse = '\0'; if (isdigitch(*q)) @@ -1242,14 +1246,14 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl else if (*ep == '*') working->hours = -1; else if (ul > INT_MAX) - errx(1, "interval is too large:\n%s", errline); + badline("interval is too large:\n%s", errline); else working->hours = ul; if (*ep == '\0' || strcmp(ep, "*") == 0) goto no_trimat; if (*ep != '@' && *ep != '$') - errx(1, "malformed interval/at:\n%s", errline); + badline("malformed interval/at:\n%s", errline); working->flags |= CE_TRIMAT; working->trim_at = ptime_init(NULL); @@ -1260,10 +1264,10 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl res = ptime_relparse(working->trim_at, ptm_opts, ptimeget_secs(timenow), ep + 1); if (res == -2) - errx(1, "nonexistent time for 'at' value:\n%s", + badline("nonexistent time for 'at' value:\n%s", errline); else if (res < 0) - errx(1, "malformed 'at' value:\n%s", errline); + badline("malformed 'at' value:\n%s", errline); } no_trimat: @@ -1323,7 +1327,7 @@ no_trimat: case 'f': /* Used by OpenBSD for "CE_FOLLOW" */ case 'm': /* Used by OpenBSD for "CE_MONITOR" */ default: - errx(1, "illegal flag in config file -- %c", + badline("illegal flag in config file -- %c", *q); } } @@ -1345,7 +1349,7 @@ no_trimat: else if (isalnum(*q)) goto got_sig; else { - errx(1, + badline( "illegal pid file or signal in config file:\n%s", errline); } @@ -1363,7 +1367,7 @@ no_trimat: got_sig: working->sig = parse_signal(q); if (working->sig < 1 || working->sig >= sys_nsig) { - errx(1, + badline( "illegal signal in config file:\n%s", errline); } @@ -1414,7 +1418,11 @@ got_sig: } else { STAILQ_INSERT_TAIL(work_p, working, cf_nextp); } - } + continue; +cleanup: + free_entry(working); +#undef badline + } /* while (fgets(line, BUFSIZ, cf)) */ if (errline != NULL) free(errline); } From owner-svn-src-stable-11@freebsd.org Fri Jul 17 06:53:04 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38F2935AB80; Fri, 17 Jul 2020 06:53:04 +0000 (UTC) (envelope-from eugen@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B7MJc0ng4z4dJf; Fri, 17 Jul 2020 06:53:04 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F28121554B; Fri, 17 Jul 2020 06:53:03 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06H6r3GA068034; Fri, 17 Jul 2020 06:53:03 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06H6r3YN068033; Fri, 17 Jul 2020 06:53:03 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <202007170653.06H6r3YN068033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Fri, 17 Jul 2020 06:53:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r363270 - stable/11/usr.bin/xinstall/tests X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/usr.bin/xinstall/tests X-SVN-Commit-Revision: 363270 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jul 2020 06:53:04 -0000 Author: eugen Date: Fri Jul 17 06:53:03 2020 New Revision: 363270 URL: https://svnweb.freebsd.org/changeset/base/363270 Log: MFC r363088: fix tests for install(1): add support for STRIPBIN's -o option. Modified: stable/11/usr.bin/xinstall/tests/install_test.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/xinstall/tests/install_test.sh ============================================================================== --- stable/11/usr.bin/xinstall/tests/install_test.sh Fri Jul 17 06:52:03 2020 (r363269) +++ stable/11/usr.bin/xinstall/tests/install_test.sh Fri Jul 17 06:53:03 2020 (r363270) @@ -186,8 +186,12 @@ overwrite_backup_safe_comparing_body() { setup_stripbin() { cat <<\STRIPBIN >stripbin #!/bin/sh -tr z @ <"$1" >"$1.new" && mv -- "$1.new" "$1" +[ "$1" = "-o" ] && dst="$2" && shift 2 +[ "$1" = "--" ] && shift +[ -z "$dst" ] && dst="$1" STRIPBIN + [ "$1" = "true" ] && cmd="cat" || cmd="tr z @" + echo $cmd '<"$1" >"$1.new" && mv -- "$1.new" "$dst"' >>stripbin chmod 755 stripbin export STRIPBIN="$PWD/stripbin" } @@ -253,7 +257,7 @@ strip_changing_overwrite_eq_comparing_body() { atf_test_case strip_noop strip_noop_body() { - export STRIPBIN=true + setup_stripbin true printf 'test\n123\r456\r\n789\0z' >testf atf_check install -s testf copyf [ ! testf -nt copyf ] || atf_fail "bad timestamp" From owner-svn-src-stable-11@freebsd.org Fri Jul 17 22:07:20 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B25A337061F; Fri, 17 Jul 2020 22:07:20 +0000 (UTC) (envelope-from joerg@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B7lbX3Zcvz4c4D; Fri, 17 Jul 2020 22:07:20 +0000 (UTC) (envelope-from joerg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55B0620230; Fri, 17 Jul 2020 22:07:20 +0000 (UTC) (envelope-from joerg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06HM7KWn025849; Fri, 17 Jul 2020 22:07:20 GMT (envelope-from joerg@FreeBSD.org) Received: (from joerg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06HM7Kru025848; Fri, 17 Jul 2020 22:07:20 GMT (envelope-from joerg@FreeBSD.org) Message-Id: <202007172207.06HM7Kru025848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: joerg set sender to joerg@FreeBSD.org using -f From: Joerg Wunsch Date: Fri, 17 Jul 2020 22:07:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r363290 - stable/11/lib/libc/locale X-SVN-Group: stable-11 X-SVN-Commit-Author: joerg X-SVN-Commit-Paths: stable/11/lib/libc/locale X-SVN-Commit-Revision: 363290 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jul 2020 22:07:20 -0000 Author: joerg Date: Fri Jul 17 22:07:19 2020 New Revision: 363290 URL: https://svnweb.freebsd.org/changeset/base/363290 Log: MFC r362708 Explain how to learn about possible recognized locale names Modified: stable/11/lib/libc/locale/setlocale.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/locale/setlocale.3 ============================================================================== --- stable/11/lib/libc/locale/setlocale.3 Fri Jul 17 22:04:58 2020 (r363289) +++ stable/11/lib/libc/locale/setlocale.3 Fri Jul 17 22:07:19 2020 (r363290) @@ -115,9 +115,24 @@ argument of causes .Fn setlocale to return the current locale. +.Pp +The option +.Fl a +to the +.Xr locale 1 +command can be used to display all further possible names for the +.Fa locale +argument that are recognized. +Specifying any unrecognized value for +.Fa locale +makes +.Fn setlocale +fail. +.Pp By default, C programs start in the .Li \&"C" locale. +.Pp The only function in the library that sets the locale is .Fn setlocale ; the locale is never changed as a side effect of some other routine. @@ -150,6 +165,7 @@ and the category .Sh ERRORS No errors are defined. .Sh SEE ALSO +.Xr locale 1 , .Xr localedef 1 , .Xr catopen 3 , .Xr ctype 3 , From owner-svn-src-stable-11@freebsd.org Sat Jul 18 23:11:41 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8335937617E; Sat, 18 Jul 2020 23:11:41 +0000 (UTC) (envelope-from delphij@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8NzK2lK8z3cm8; Sat, 18 Jul 2020 23:11:41 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 417F61238C; Sat, 18 Jul 2020 23:11:41 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06INBf6A061920; Sat, 18 Jul 2020 23:11:41 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06INBfPs061919; Sat, 18 Jul 2020 23:11:41 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202007182311.06INBfPs061919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 18 Jul 2020 23:11:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r363314 - stable/11/sbin/newfs_msdos X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/sbin/newfs_msdos X-SVN-Commit-Revision: 363314 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jul 2020 23:11:41 -0000 Author: delphij Date: Sat Jul 18 23:11:40 2020 New Revision: 363314 URL: https://svnweb.freebsd.org/changeset/base/363314 Log: MFC r362936: Gather writes to larger chunks (MAXPHYS) instead of issuing them in sectors. Modified: stable/11/sbin/newfs_msdos/mkfs_msdos.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/newfs_msdos/mkfs_msdos.c ============================================================================== --- stable/11/sbin/newfs_msdos/mkfs_msdos.c Sat Jul 18 23:05:16 2020 (r363313) +++ stable/11/sbin/newfs_msdos/mkfs_msdos.c Sat Jul 18 23:11:40 2020 (r363314) @@ -59,6 +59,7 @@ static const char rcsid[] = #define DOSMAGIC 0xaa55 /* DOS magic number */ #define MINBPS 512 /* minimum bytes per sector */ +#define MAXBPS 4096 /* maximum bytes per sector */ #define MAXSPC 128 /* maximum sectors per cluster */ #define MAXNFT 16 /* maximum number of FATs */ #define DEFBLK 4096 /* default block size */ @@ -72,6 +73,25 @@ static const char rcsid[] = #define MAXCLS16 0xfff4U /* maximum FAT16 clusters */ #define MAXCLS32 0xffffff4U /* maximum FAT32 clusters */ +#ifndef CTASSERT +#define CTASSERT(x) _CTASSERT(x, __LINE__) +#define _CTASSERT(x, y) __CTASSERT(x, y) +#define __CTASSERT(x, y) typedef char __assert_ ## y [(x) ? 1 : -1] +#endif + +/* + * For better performance, we want to write larger chunks instead of + * individual sectors (the size can only be 512, 1024, 2048 or 4096 + * bytes). Assert that MAXPHYS can always hold an integer number of + * sectors by asserting that both are power of two numbers and the + * MAXPHYS is greater than MAXBPS. + */ +CTASSERT(powerof2(MAXPHYS)); +CTASSERT(powerof2(MAXBPS)); +CTASSERT(MAXPHYS > MAXBPS); + +const static ssize_t chunksize = MAXPHYS; + #define mincls(fat) ((fat) == 12 ? MINCLS12 : \ (fat) == 16 ? MINCLS16 : \ MINCLS32) @@ -238,6 +258,7 @@ mkfs_msdos(const char *fname, const char *dtype, const struct bsx *bsx; struct de *de; u_int8_t *img; + u_int8_t *physbuf, *physbuf_end; const char *bname; ssize_t n; time_t now; @@ -247,7 +268,7 @@ mkfs_msdos(const char *fname, const char *dtype, const int fd, fd1, rv; struct msdos_options o = *op; - img = NULL; + physbuf = NULL; rv = -1; fd = fd1 = -1; @@ -332,15 +353,13 @@ mkfs_msdos(const char *fname, const char *dtype, const bpb.bpbSecPerClust = 64; /* otherwise 32k */ } } - if (!powerof2(bpb.bpbBytesPerSec)) { - warnx("bytes/sector (%u) is not a power of 2", bpb.bpbBytesPerSec); + if (bpb.bpbBytesPerSec < MINBPS || + bpb.bpbBytesPerSec > MAXBPS || + !powerof2(bpb.bpbBytesPerSec)) { + warnx("Invalid bytes/sector (%u): must be 512, 1024, 2048 or 4096", + bpb.bpbBytesPerSec); goto done; } - if (bpb.bpbBytesPerSec < MINBPS) { - warnx("bytes/sector (%u) is too small; minimum is %u", - bpb.bpbBytesPerSec, MINBPS); - goto done; - } if (o.volume_label && !oklabel(o.volume_label)) { warnx("%s: bad volume label", o.volume_label); @@ -610,11 +629,14 @@ mkfs_msdos(const char *fname, const char *dtype, const tm = localtime(&now); } - - if (!(img = malloc(bpb.bpbBytesPerSec))) { + physbuf = malloc(chunksize); + if (physbuf == NULL) { warn(NULL); goto done; } + physbuf_end = physbuf + chunksize; + img = physbuf; + dir = bpb.bpbResSectors + (bpb.bpbFATsecs ? bpb.bpbFATsecs : bpb.bpbBigFATsecs) * bpb.bpbFATs; memset(&si_sa, 0, sizeof(si_sa)); @@ -737,19 +759,37 @@ mkfs_msdos(const char *fname, const char *dtype, const (u_int)tm->tm_mday; mk2(de->deMDate, x); } - if ((n = write(fd, img, bpb.bpbBytesPerSec)) == -1) { - warn("%s", fname); - goto done; + /* + * Issue a write of chunksize once we have collected + * enough sectors. + */ + img += bpb.bpbBytesPerSec; + if (img >= physbuf_end) { + n = write(fd, physbuf, chunksize); + if (n != chunksize) { + warnx("%s: can't write sector %u", fname, lsn); + goto done; + } + img = physbuf; } - if ((unsigned)n != bpb.bpbBytesPerSec) { - warnx("%s: can't write sector %u", fname, lsn); - goto done; - } } + /* + * Write remaining sectors, if the last write didn't end + * up filling a whole chunk. + */ + if (img != physbuf) { + ssize_t tailsize = img - physbuf; + + n = write(fd, physbuf, tailsize); + if (n != tailsize) { + warnx("%s: can't write sector %u", fname, lsn); + goto done; + } + } } rv = 0; done: - free(img); + free(physbuf); if (fd != -1) close(fd); if (fd1 != -1)