From owner-svn-src-all@freebsd.org Tue Jan 23 19:40:18 2018 Return-Path: Delivered-To: svn-src-all@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 AE0ADEC29EE for ; Tue, 23 Jan 2018 19:40:18 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic305-17.consmr.mail.bf2.yahoo.com (sonic305-17.consmr.mail.bf2.yahoo.com [74.6.133.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C190E6B3CB for ; Tue, 23 Jan 2018 19:40:17 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1516736410; bh=L2Y/OTSjRny7LAh63OBcwa7ZkgvnVVhs533gvjKqZjU=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=sE3a1u3nGX7qgcrUPEzlNyLsx4HR3ArJhV5Scob7pB5efIpk5e/Uwp2ZaaW7mhk8vwEWKxDZ6agauVomj3chERk0g8okwnNwcrhPQKt/0n7xvYjgCIAoEjHKCB/SAHXdmZcgE0pZTqKCIpp0FKcikGWyWx4biLzWXqebgUu0cQ0J9TyiZ23a9nJDSreASuoGBXToBTK0t8aeJkMst3KF+XUaFchwoDluddU9DXcSHWG5zNSt1A7/mUnfCKg6aFBlMwHcDL6m1YV+phJz6Wzzp+uzZZoXcoZFzva3FeiklPvHUYUcVMffphHDmTHKqRNZ/hGtAsaXmGI+WaM5PXc9TQ== X-YMail-OSG: THUMT7oVM1luqzSYo9tznwZ5wBesyi1RAKpAoF1WW.g5J.Fhw6sIR.RHXv2a9Et LfJk1yySoD1VBiMbIcbS2.5f68LuNo9Joe1v7ZVLCHtfRzxcQIneIHwGm.9g4YwjSfuJ6buwtw65 99_BrITXtl73_5DENGmIK44LC6TlEOEsvKxNknryAJeh8AHxyuCX6EEXeowovTmYQAOa89_mEyWw 43_RercKy5rth6cRpho9O8xdzPSGTfNyPq5sv9Q4udxQLPrmVZWnfvIxRea2PXWq8c1ztRmD71dj NWfEN60rL07zSv5x2DU1aI_0AKU9jDdKze9BufL89dMoEXhgQntPkyr5huKG84qFPZhH5_MBGjWL M7xQhHZW4rEhv_ukjTwLsAWuvn_J.7PghwT33xGGuYitDPliGeh0kJLYY.fnhRXJAOAYXn_RC4Ke .OfmKkQdmrF4WxTKVp_REbdXf50FOdZnlkdIbOlMmBYMXOqmlxCjwwHwpMYERp6hkTReVJMd4Ub1 OXUaQyYLNiQ-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.bf2.yahoo.com with HTTP; Tue, 23 Jan 2018 19:40:10 +0000 Received: from smtp106.rhel.mail.bf1.yahoo.com (EHLO [192.168.0.8]) ([98.139.231.40]) by smtp401.mail.bf1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID e30219802c78c8c7b2dd33cc494aea19; Tue, 23 Jan 2018 19:40:07 +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/... To: cem@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801211542.w0LFgbsp005980@repo.freebsd.org> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: <51ff8aef-5660-7857-e4d5-12cdc77bc071@FreeBSD.org> Date: Tue, 23 Jan 2018 14:40:05 -0500 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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jan 2018 19:40:19 -0000 Hi; 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: >> Revert r327828, r327949, r327953, r328016-r328026, r328041: >> Uses of mallocarray(9). >> >> The use of mallocarray(9) has rocketed the required swap to build FreeBSD. >> This is likely caused by the allocation size attributes which put extra pressure >> on the compiler. > I'm confused about this change. Wouldn't it be better to remove the > annotation/attributes from mallocarray() than to remove the protection > against overflow? 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. > (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.) 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. Pedro.