From owner-svn-src-all@FreeBSD.ORG Wed Jul 23 19:42:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EC5D4D05 for ; Wed, 23 Jul 2014 19:42:03 +0000 (UTC) Received: from nm9-vm0.bullet.mail.bf1.yahoo.com (nm9-vm0.bullet.mail.bf1.yahoo.com [98.139.213.154]) (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 9C3F8227F for ; Wed, 23 Jul 2014 19:42:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1406144515; bh=N8woO0UbTFbchTGYRGdH6Zoen50JiD7Ln2OydLQoSt4=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Message-Id:References:To:X-Mailer; b=Am8YmhmBtgZ8oH8EiKhIcDj16fnQ3SooCC7OKgVaTfnEAJcWbhssKjRlGmRoYORp04+CYA9WXG71HngzdRAvVvguNPJ9NVIc5d92GeltxVsSfIv+KPJlsZKEkj/kqQ6L+GwjzLFAEj5ZIGRnI6DPb4fZMkyHBbchFvZcdjglp3s/xBxCG28zoC88TMa+zq/U9t0nNv5MZ8iNBCWTf19m3tVHkgAsqYfBfKNgU6tQ7crOLSG6rQXHehF25E3paqHcNqn8HJgjEgQMA650he8Ju90o/zx2ZHPdQtnG2tW3439RDbB0kReX/bA/5D5ZQ5rqfgbljeL3daF8orsW5dWakA== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=oeKuh0Jvi8gHsZAc8208bkXuiFWYbCF370QHIm+yhRbK2Wn2SJyctuQceQKa9UymVz3ILQna2Ygj4fKMwhSyeYmo3AU4DRnYBMD3mPVQd4cwXFOiVLYF9oYQPUL035i7kVGY6zGtYog5yEaY31MGUG3GuivvwOZ2zSZGEmF8UfLUrT+8v/5UEYwhKll4XPKeXuthDORNoNTFQtakWTM0ysO/GHr0OC/S+8Mp7KH5JjdF/G377iTDnlJfNrWMzHiP3i4h2CmmA/VzWdZaAOhWBeVyWvhjTx8NajWCgy0CjHTJkQOXUzL5AuFulARZ/toOW2hOTqDq904fZnX2iu8ICw==; Received: from [66.196.81.170] by nm9.bullet.mail.bf1.yahoo.com with NNFMP; 23 Jul 2014 19:41:55 -0000 Received: from [98.139.211.204] by tm16.bullet.mail.bf1.yahoo.com with NNFMP; 23 Jul 2014 19:41:55 -0000 Received: from [127.0.0.1] by smtp213.mail.bf1.yahoo.com with NNFMP; 23 Jul 2014 19:41:55 -0000 X-Yahoo-Newman-Id: 219336.47473.bm@smtp213.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: eh0dzPEVM1mi9rCq_sR96C8xS77PQJrTXoEH.AD228n5Dg3 9YNJ4UGi763CcnadhjT6On1qfkwQXXc8pQQO0N1iw1ZYS8MANW9jkc5fy1cu b2JPL1GVr.yEz31kEipfswZzk8uHxPSsllQPyXv5bWB6tBnZe4D__hzPn.fy oqGHm0tYMW6SELJSx.4orq8k3cqGDVAm8lkXXHcliPcWzdHCKqk7ndRomral I1avbpwmfe_hDMCBTBxb2rMYzTuwQnfDyVbgwNQ7FxgJ6ABkKQuu_nk3bY2i Ji4Gy8GJMcmkXaw5jyVyE6qSmdQlR56Iw4whDBjUtE8tw.8aaD72cmQ0U7HT aCvRb1R7Q6S7_zu0mo.pvoAVpRnR.8ELYdXkaRu4X1g27rNigNI652QLB0PC _1obvblRAK0ZzvsOx3M15FmlQ2vhka.8jyIEtSWT7l_zM50WhrTDONGGlJD8 23Qbj1HnOlZF8_eRWLeB0CCa8YkYmOMOGTY_rSP0gqzadc_VkWoibIEDfDg7 kGJ_7314VVN2F2m2wMTDm1ZAxhMgsBKtRR5WDv.0yvvWIu2tJptuwnqwyHgh EAQgTxF.E78w2ZxBNVOuMu1dxcvhawInTj_eAGp1NcVn7nLHERRD4f8rGcvo - X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r268945 - in head: lib/libc/stdlib sys/sys From: Pedro Giffuni In-Reply-To: <4953747B-B2B3-4F24-A006-022AEC4DDA29@freebsd.org> Date: Wed, 23 Jul 2014 14:41:52 -0500 Message-Id: References: <201407211544.s6LFixKa093406@svn.freebsd.org> <20140723172245.GJ93733@kib.kiev.ua> <4953747B-B2B3-4F24-A006-022AEC4DDA29@freebsd.org> To: Konstantin Belousov X-Mailer: Apple Mail (2.1878.6) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 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: Wed, 23 Jul 2014 19:42:04 -0000 Il giorno 23/lug/2014, alle ore 12:54, Pedro Giffuni = ha scritto: >=20 > Il giorno 23/lug/2014, alle ore 12:22, Konstantin Belousov = ha scritto: >=20 >> On Mon, Jul 21, 2014 at 03:44:59PM +0000, Pedro F. Giffuni wrote: >>> Author: pfg >>> Date: Mon Jul 21 15:44:59 2014 >>> New Revision: 268945 >>> URL: http://svnweb.freebsd.org/changeset/base/268945 >>>=20 >>> Log: >>> Fix hdestroy() compliance issue. >>>=20 >>> The hcreate(3) implementation and related functions we inherited >>> from NetBSD used to free() the key value, something that is not >>> supported by the standard implementation. >>>=20 >>> This would cause a segmentation fault when attempting to run >>> the examples from the opengroup and linux manpages. NetBSD >>> has added non-standard calls to provide the previous >>> behaviour but hdestroy is not very commonly used so at this >>> time it seems excessive to bring those to FreeBSD. >>>=20 >>> Bump the __FreeBSD_version as this is an ABI change. >>>=20 >>> Reference: >>> http://bugs.dragonflybsd.org/issues/1398 >>>=20 >>> MFC after: 2 weeks >>>=20 >>> Modified: >>> head/lib/libc/stdlib/hcreate.c >>> head/sys/sys/param.h >>>=20 >>> Modified: head/lib/libc/stdlib/hcreate.c >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/lib/libc/stdlib/hcreate.c Mon Jul 21 15:26:52 2014 = (r268944) >>> +++ head/lib/libc/stdlib/hcreate.c Mon Jul 21 15:44:59 2014 = (r268945) >>> @@ -159,7 +159,6 @@ hdestroy_r(struct hsearch_data *head) >>> while (!SLIST_EMPTY(&table[idx])) { >>> ie =3D SLIST_FIRST(&table[idx]); >>> SLIST_REMOVE_HEAD(&table[idx], link); >>> - free(ie->ent.key); >>> free(ie); >>> } >>> } >>>=20 >>> Modified: head/sys/sys/param.h >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/sys/sys/param.h Mon Jul 21 15:26:52 2014 = (r268944) >>> +++ head/sys/sys/param.h Mon Jul 21 15:44:59 2014 = (r268945) >>> @@ -58,7 +58,7 @@ >>> * in the range 5 to 9. >>> */ >>> #undef __FreeBSD_version >>> -#define __FreeBSD_version 1100027 /* Master, propagated to newvers = */ >>> +#define __FreeBSD_version 1100028 /* Master, propagated to newvers = */ >>>=20 >>> /* >>> * __FreeBSD_kernel__ indicates that this system uses the kernel of = FreeBSD, >> You broke the ABI. This is absolute stopper for the symversioned >> fundamental library. >>=20 >=20 > I thought about it for a while. > Actually .. I didn=92t. The interface remains unchanged, I only fixed = an undocumented bug. >=20 As clarification .. I meant I didn=92t actually break the ABI ... It=92s just a bug fix and we shouldn=92t provide compatibility shims for = bugs. > I say undocumented because while he NetBSD man page did document the = bug, our man page has always claimed compliance . >=20 >> The right thing to do is to introduce a new version of hcreate() for = FBSD_1.4, >> and provide compat shims with the old behaviour for FBSD_1.0. >=20 > hcreate() is not used in the base: all consumers (ports tree) are = likely to expect the standard behavior so this change saves them from a = segmentation fault. In the rare case of someone having developed their = code for the broken function, the worst they will see is a memory leak. >=20 > A compat shim would be really ugly :(. >=20 FWIW, NetBSD provides new functions with the old behavior but hdestroy() = now conforms to standards. Things there got really ugly because they = also had that issue for the re-entrant versions. I am thinking of MFCing the fix, but not the re-entrant versions. Pedro.=