From dan@kulesh.obluda.cz  Tue Jun 20 22:26:34 2006
Return-Path: <dan@kulesh.obluda.cz>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id EF76816A479;
	Tue, 20 Jun 2006 22:26:34 +0000 (UTC)
	(envelope-from dan@kulesh.obluda.cz)
Received: from smtp1.kolej.mff.cuni.cz (smtp1.kolej.mff.cuni.cz [195.113.24.4])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 54BE143D45;
	Tue, 20 Jun 2006 22:26:33 +0000 (GMT)
	(envelope-from dan@kulesh.obluda.cz)
Received: from kulesh.obluda.cz (openvpn.ms.mff.cuni.cz [195.113.20.87])
	by smtp1.kolej.mff.cuni.cz (8.13.1/8.13.1) with ESMTP id k5KMQrx0000193;
	Wed, 21 Jun 2006 00:26:54 +0200 (CEST)
	(envelope-from dan@kulesh.obluda.cz)
Received: from kulesh.obluda.cz (localhost [127.0.0.1] (may be forged))
	by kulesh.obluda.cz (8.13.6/8.13.6) with ESMTP id k5KMQUQn001793;
	Wed, 21 Jun 2006 00:26:30 +0200 (CEST)
	(envelope-from dan@kulesh.obluda.cz)
Received: (from root@localhost)
	by kulesh.obluda.cz (8.13.6/8.13.6/Submit) id k5KMQTYx001792;
	Wed, 21 Jun 2006 00:26:29 +0200 (CEST)
	(envelope-from dan)
Message-Id: <200606202226.k5KMQTYx001792@kulesh.obluda.cz>
Date: Wed, 21 Jun 2006 00:26:29 +0200 (CEST)
From: Dan Lukes <dan@obluda.cz>
Reply-To: Dan Lukes <dan@obluda.cz>
To: FreeBSD-gnats-submit@freebsd.org
Cc: keramida@freebsd.org
Subject: [ PATCH ] malloc(3): options J and Z DOESN'T imply option R
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         99231
>Category:       docs
>Synopsis:       [ PATCH ] malloc(3): options J and Z DOESN'T imply option R
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    keramida
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 20 22:30:19 GMT 2006
>Closed-Date:    Tue Jun 20 23:43:44 GMT 2006
>Last-Modified:  Mon Sep  3 23:20:02 GMT 2007
>Originator:     Dan Lukes
>Release:        FreeBSD 6.1-STABLE i386
>Organization:
Obludarium
>Environment:
System: FreeBSD, RELENG-6
src/lib/libc/stdlib/malloc.3,v 1.63

>Description:
	The malloc(3) manual page claim the options 'J' and 'Z' imply 'R' option.

	It's not true (see grep malloc_realloc lib/libc/stdlib/malloc.c)

	Beware, it apply to RELENG-6 only, not CURRENT.

>How-To-Repeat:
	N/A
>Fix:

--- lib/libc/stdlib/malloc.3.ORIG	Fri Jul 15 16:40:52 2005
+++ lib/libc/stdlib/malloc.3	Wed Jun 21 00:15:43 2006
@@ -36,7 +36,7 @@
 .\"     @(#)malloc.3	8.1 (Berkeley) 6/4/93
 .\" $FreeBSD: src/lib/libc/stdlib/malloc.3,v 1.63 2005/01/20 09:17:04 ru Exp $
 .\"
-.Dd August 19, 2004
+.Dd June 21, 2006
 .Dt MALLOC 3
 .Os
 .Sh NAME
@@ -192,9 +192,6 @@
 or
 .Fn reallocf
 will be initialized to 0xd0.
-This options also sets the
-.Dq R
-option.
 This is intended for debugging and will impact performance negatively.
 .It H
 Pass a hint to the kernel about pages unused by the allocation functions.
@@ -241,9 +238,7 @@
 .It Z
 This option implicitly sets the
 .Dq J
-and
-.Dq R
-options, and then zeros out the bytes that were requested.
+option, and then zeros out the bytes that were requested.
 This is intended for debugging and will impact performance negatively.
 .It <
 Reduce the size of the cache by a factor of two.


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: keramida 
State-Changed-When: Tue Jun 20 23:42:55 UTC 2006 
State-Changed-Why:  
Committed in revision 1.63.2.1 or file 
http://cvsweb.freebsd.org/src/lib/libc/stdlib/malloc.3,v 

Thanks :) 


Responsible-Changed-From-To: freebsd-doc->keramida 
Responsible-Changed-By: keramida 
Responsible-Changed-When: Tue Jun 20 23:42:55 UTC 2006 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=99231 

From: Matthieu Michaud <matthieu@epita.info>
To: bug-followup@FreeBSD.org
Cc: LLB <llb@etna-alternance.net>
Subject: Re: docs/99231: [ PATCH ] malloc(3): options J and Z DOESN'T imply
 option R
Date: Tue, 04 Sep 2007 00:53:05 +0200

 hi,
 
 if i'm correctly reading malloc source, the error reported in this old 
 PR seems to also apply on RELENG_5 for quite a long time now, precisely 
 since rev 1.80, ~4 years. diff with previous shows :
 
 @@ -487,18 +490,11 @@ malloc_init ()
       if (malloc_zero)
   	malloc_junk=1;
 
 -    /*
 -     * If we run with junk (or implicitly from above: zero), we want to
 -     * force realloc() to get new storage, so we can DTRT with it.
 -     */
 -    if (malloc_junk)
 -	malloc_realloc=1;
 -
 
 whole diff here :
 http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/stdlib/malloc.c.diff?r1=1.79;r2=1.80
 
 (this has been pointed out by Laurent Le Brun <llb@etna-alternance.net>)
>Unformatted:
