From owner-svn-src-head@freebsd.org Tue Sep 17 09:05:36 2019 Return-Path: Delivered-To: svn-src-head@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 E8979FC671 for ; Tue, 17 Sep 2019 09:05:36 +0000 (UTC) (envelope-from tsoome@me.com) Received: from pv50p00im-hyfv10011601.me.com (pv50p00im-hyfv10011601.me.com [17.58.6.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46Xcdr18Z5z3FZl for ; Tue, 17 Sep 2019 09:05:36 +0000 (UTC) (envelope-from tsoome@me.com) Received: from [192.168.150.41] (148-52-235-80.sta.estpak.ee [80.235.52.148]) by pv50p00im-hyfv10011601.me.com (Postfix) with ESMTPSA id 6319F380397; Tue, 17 Sep 2019 09:05:31 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r352421 - head/stand/libsa From: Toomas Soome In-Reply-To: <20190917085641.GY2559@kib.kiev.ua> Date: Tue, 17 Sep 2019 12:05:26 +0300 Cc: Toomas Soome , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <6762A429-F17F-46D1-A55B-BD9C627D6903@me.com> References: <201909162028.x8GKS9jK064079@repo.freebsd.org> <20190917085641.GY2559@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.3445.104.11) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-09-17_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=476 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1909170097 X-Rspamd-Queue-Id: 46Xcdr18Z5z3FZl X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.20 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[me.com]; R_SPF_ALLOW(-0.20)[+ip4:17.58.0.0/16]; MV_CASE(0.50)[]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_IN_DNSWL_MED(-0.20)[43.6.58.17.list.dnswl.org : 127.0.5.2]; DKIM_TRACE(0.00)[me.com:+]; DMARC_POLICY_ALLOW(-0.50)[me.com,quarantine]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.00)[ip: (-5.74), ipnet: 17.58.0.0/20(-3.33), asn: 714(-2.91), country: US(-0.05)]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[me.com]; ASN(0.00)[asn:714, ipnet:17.58.0.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[me.com:s=1a1hai]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE_FREEMAIL(0.00)[]; DWL_DNSWL_LOW(-1.00)[me.com.dwl.dnswl.org : 127.0.5.1]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 17 Sep 2019 09:05:37 -0000 > On 17 Sep 2019, at 11:56, Konstantin Belousov = wrote: >=20 > On Mon, Sep 16, 2019 at 08:28:09PM +0000, Toomas Soome wrote: >> Author: tsoome >> Date: Mon Sep 16 20:28:08 2019 >> New Revision: 352421 >> URL: https://svnweb.freebsd.org/changeset/base/352421 >>=20 >> Log: >> loader: Malloc(0) should return NULL. >>=20 >> We really should not allocate anything with size 0. > Why ? This is quite unexpected from other environments, where > malloc(0) returns unique object. >=20 Hiding bugs. And, we are not getting unique object, we are getting chunk = of memory with payload length of 0 and the memory content depends on if = head and tail guards are used - the chunk is with size at least = MALLOCALIGN (16 or 64 bytes) and the chunk is from random location of = heap. rgds, toomas=