From owner-svn-src-head@freebsd.org Tue Jan 23 22:13:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98C1CECA9CE; Tue, 23 Jan 2018 22:13:40 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 621B971C48; Tue, 23 Jan 2018 22:13:40 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 7CC5612318; Tue, 23 Jan 2018 22:13:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 54907A873; Tue, 23 Jan 2018 22:13:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id Ph04X4kMLLCx; Tue, 23 Jan 2018 22:13:35 +0000 (UTC) Subject: Re: svn commit: r328218 - in head/sys: amd64/amd64 arm/xscale/ixp425 arm64/arm64 cam cam/ctl compat/ndis dev/aacraid dev/advansys dev/ath dev/beri/virtio dev/bnxt dev/bwn dev/ciss dev/cxgbe/crypto dev/... DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 4E39FA86E To: Pedro Giffuni , cem@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801211542.w0LFgbsp005980@repo.freebsd.org> <51ff8aef-5660-7857-e4d5-12cdc77bc071@FreeBSD.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <695a7cbd-f341-690c-5ad7-2551941bbf1e@FreeBSD.org> Date: Tue, 23 Jan 2018 14:13:28 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <51ff8aef-5660-7857-e4d5-12cdc77bc071@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zCsDlM2lBvcxTewW18WyCGNfFjbD8MJ1p" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jan 2018 22:13:40 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --zCsDlM2lBvcxTewW18WyCGNfFjbD8MJ1p Content-Type: multipart/mixed; boundary="CfZEnEbbyRw4887uRhmAq9qhs11PgUpD2"; protected-headers="v1" From: Bryan Drewery To: Pedro Giffuni , cem@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <695a7cbd-f341-690c-5ad7-2551941bbf1e@FreeBSD.org> Subject: Re: svn commit: r328218 - in head/sys: amd64/amd64 arm/xscale/ixp425 arm64/arm64 cam cam/ctl compat/ndis dev/aacraid dev/advansys dev/ath dev/beri/virtio dev/bnxt dev/bwn dev/ciss dev/cxgbe/crypto dev/... References: <201801211542.w0LFgbsp005980@repo.freebsd.org> <51ff8aef-5660-7857-e4d5-12cdc77bc071@FreeBSD.org> In-Reply-To: <51ff8aef-5660-7857-e4d5-12cdc77bc071@FreeBSD.org> --CfZEnEbbyRw4887uRhmAq9qhs11PgUpD2 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 1/23/2018 11:40 AM, Pedro Giffuni wrote: > Hi; >=20 >=20 > On 23/01/2018 14:08, Conrad Meyer wrote: >> Hi Pedro, >> >> On Sun, Jan 21, 2018 at 7:42 AM, Pedro F. Giffuni >> wrote: >>> Author: pfg >>> Date: Sun Jan 21 15:42:36 2018 >>> New Revision: 328218 >>> URL: https://svnweb.freebsd.org/changeset/base/328218 >>> >>> Log: >>> =C2=A0=C2=A0 Revert r327828, r327949, r327953, r328016-r328026, r3280= 41: >>> =C2=A0=C2=A0 Uses of mallocarray(9). >>> >>> =C2=A0=C2=A0 The use of mallocarray(9) has rocketed the required swap= to build >>> FreeBSD. >>> =C2=A0=C2=A0 This is likely caused by the allocation size attributes = which put >>> extra pressure >>> =C2=A0=C2=A0 on the compiler. >> I'm confused about this change.=C2=A0 Wouldn't it be better to remove = the >> annotation/attributes from mallocarray() than to remove the protection= >> against overflow? >=20 > Not in my opinion: it would be better to detect such overflows at > compile time (or through a static analyzer) than to have late > notification though panics. The blind use of mallocarray(9) is probably= > a mistake also: we shouldn't use it unless there is some real risk of > overflow. >=20 >> =C2=A0=C2=A0 (If the compiler is fixed in the future to not use >> excessive memory with these attributes, they can be conditionalized on= >> compiler version, of course.) >=20 > All in all, the compiler is not provably wrong: it's just using more > swap space, which is rather inconvenient for small platforms but not > necessarily wrong. >=20 > Pedro. >=20 >=20 I haven't dug into this to understand it all, but if mallocarray() is causing this sort of compilation problem then isn't the problem the compiler? Why keep a "dangerous" function around and not actually fix it? Is there a bug somewhere to fix the compilation load? --=20 Regards, Bryan Drewery --CfZEnEbbyRw4887uRhmAq9qhs11PgUpD2-- --zCsDlM2lBvcxTewW18WyCGNfFjbD8MJ1p Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJaZ7OOAAoJEDXXcbtuRpfPfqkH/ArQUS55QlJ/9qS+Y4rQLFEe IqqRlNGYBDJOZN60WIi8A7c/sMWKRvarbR3GXdEtv3YiiBKpuhy8VvO3VDrzevNP 0tLpkMRPAAFbl1z7OoED1uix1YtZawYubuSJspZxBNVr08E2B5uqxIVa+e0qnXS+ CVlQrmtXFBUZ9TG943Y1ATmBHG1sqjuMPW0i3PUywEqKSMod2PltsHuxN162DF9u 1UT6G1vjAvEGynIEYc7ySEd4l5jDmgv+Jfjxz0Iaog2/biDOCNF6C8CffpzFL8Fj N+BELJ33U9x/+RNXbTZvtu0hAfXbj/Su5bSHFE3pwERID4me6us4DiSp/1tFtHw= =RgiW -----END PGP SIGNATURE----- --zCsDlM2lBvcxTewW18WyCGNfFjbD8MJ1p--