From owner-svn-src-head@FreeBSD.ORG Mon Jul 21 15:44:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE434786; Mon, 21 Jul 2014 15:44:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 CB32B23E0; Mon, 21 Jul 2014 15:44:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LFixDw093411; Mon, 21 Jul 2014 15:44:59 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LFixKa093406; Mon, 21 Jul 2014 15:44:59 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407211544.s6LFixKa093406@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 21 Jul 2014 15:44:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268945 - in head: lib/libc/stdlib sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Mon, 21 Jul 2014 15:45:00 -0000 Author: pfg Date: Mon Jul 21 15:44:59 2014 New Revision: 268945 URL: http://svnweb.freebsd.org/changeset/base/268945 Log: Fix hdestroy() compliance issue. 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. 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. Bump the __FreeBSD_version as this is an ABI change. Reference: http://bugs.dragonflybsd.org/issues/1398 MFC after: 2 weeks Modified: head/lib/libc/stdlib/hcreate.c head/sys/sys/param.h Modified: head/lib/libc/stdlib/hcreate.c ============================================================================== --- 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 = SLIST_FIRST(&table[idx]); SLIST_REMOVE_HEAD(&table[idx], link); - free(ie->ent.key); free(ie); } } Modified: head/sys/sys/param.h ============================================================================== --- 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 */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,