From owner-svn-src-head@FreeBSD.ORG Wed Jul 23 17:54:51 2014 Return-Path: Delivered-To: svn-src-head@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 314B5732 for ; Wed, 23 Jul 2014 17:54:51 +0000 (UTC) Received: from nm24-vm0.bullet.mail.bf1.yahoo.com (nm24-vm0.bullet.mail.bf1.yahoo.com [98.139.213.161]) (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 D6B4628A4 for ; Wed, 23 Jul 2014 17:54:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1406138083; bh=GAvgpswGNYsOLi5G/zYRHF1NhIK+ZaDadj0Ql0EBezE=; 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:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; b=a8xfiZzxCGD2ks3lLS19lZb3ylY+lxsLgyR5ln2kvnLBxLbNeTPqac3Bu0f1oOwtYVrqOUkMYrqIAq1bFf6KhRlswDg4ME4xdEw3SZZHAhgN5U9AbGZ0pveOuHJ9Lwp03XRRC3uu8+ilVztYcf0jLDo+RR0ngch/AoZNrPTXdKp0CPW0r3e/Gj/DcelIJA//qUS/QCxN5C7zHvbuDaxNBjAIifW+WQecp1Q9+ZdzjQ8M4W5ZAaa5wYz0CWfNwBmxZjiFHC80t/AtpOAF/FeCkrfJGYuG7rXbaY70/c+nMXE6xv0/OcEtGcXwNB3J+lA42KbUr7i8TRb+Dx6PgGSR7g== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=GTNP+UXiUXM6uL4W1OqlJbhuhLivBNKYPgKdPoD+mQAd5HvSVvXB796TGU1RelcY5URf8FSKBx1wjQlcKYr2uvliTGvB3VdMu0OiSb1x9YmWyJPpGsgOuugK62L4u7jwUiSQEKZ2GfQ/Qv+LmrmBynlTPOdzm+xBSJyA+qpAJSq/BLaq7vICK1mdKUBeyfPaMbSc0FTQow6BphD/ZRGmdBG7PUiEsfGQzjmjCoV0ebGPgfDO2tLQaGuMK0wXVn0EHP85lscX4uvUcfkh9EtJ1XLjUXR5k9ej11uqC3Z9njsfjRJajQp1CqvV3z+Z11AKs+36ZgVZrOZarQBEUftdrg==; Received: from [98.139.212.152] by nm24.bullet.mail.bf1.yahoo.com with NNFMP; 23 Jul 2014 17:54:43 -0000 Received: from [98.139.211.197] by tm9.bullet.mail.bf1.yahoo.com with NNFMP; 23 Jul 2014 17:54:43 -0000 Received: from [127.0.0.1] by smtp206.mail.bf1.yahoo.com with NNFMP; 23 Jul 2014 17:54:43 -0000 X-Yahoo-Newman-Id: 591477.93540.bm@smtp206.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: bOt.IYgVM1n16QhiTXGQd0hKvPvhRKn5lpPQE6cU_fbVtJD tBQ1gzbCrjCQfDb4IUP35EmWTay__F6wd0YtExvoD188AlrewFliAB3qwF7H jFteoq8oHh5cctBsCe97iAa.Ou3bSKJh0U7G3nbanRCSQjhXzW8w2jzipuwS eNnMBgPGb5W7XmN4C6JiX5xs0egQTb0di_kkjZSUmrDEiuvhX71pbVLuSEJx DrYnNrWj.FP7yllVyI0UTMplMyfApzNpXTxnowylBYdcvX7xkIB_YXrkgzKP HqyVoqHVbgzN9vDdRwB.1NPEBq1lVCDpc1rUvbDqvPCtCM0mr9r_GOwwKz_P 9xQTAfXbr1CpoJJ2vskkAc40T3JDQs65Fd8rBPAMykEd4O2gRvohXRpqfsxu dDtP_Q8EAYS4CEa8OK2FWDA37NvKQ4acme7i1UlIWFdcyru6qRB1T5gcoJIM b6BQZsr2KpG2GNScZYkF_HjyrJiKnuxPlamD9J7csjAZ0rHVWkDcW0JavyTW nbREqr8rrqP4aY9XKueYPHaQgFPIir0lGYkM28wnNTcqjvSvLHY4iXuiTbzs hO8CVEqx_lacHKYjMReCa5OUW8NSAwmajNqDUba2vwNFaXb3eZPZtRjqGz.k 4SLcZM.hYkF2NAa30BfmRwEZnyVKO1XiWuUCp3szDX6OgjvJgmicAYBiEXfp OZyss6hLU5z7s.g-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Content-Type: text/plain; charset=windows-1252 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: <20140723172245.GJ93733@kib.kiev.ua> Date: Wed, 23 Jul 2014 12:54:39 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <4953747B-B2B3-4F24-A006-022AEC4DDA29@freebsd.org> References: <201407211544.s6LFixKa093406@svn.freebsd.org> <20140723172245.GJ93733@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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: Wed, 23 Jul 2014 17:54:51 -0000 Il giorno 23/lug/2014, alle ore 12:22, Konstantin Belousov = ha scritto: > 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 I thought about it for a while. Actually .. I didn=92t. The interface remains unchanged, I only fixed an = undocumented bug. I say undocumented because while he NetBSD man page did document the = bug, our man page has always claimed compliance . > 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. 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. A compat shim would be really ugly :(. Pedro.