From owner-freebsd-current Fri Aug 7 19:09:32 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA12525 for freebsd-current-outgoing; Fri, 7 Aug 1998 19:09:32 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from smtp04.primenet.com (smtp04.primenet.com [206.165.6.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA12506 for ; Fri, 7 Aug 1998 19:09:23 -0700 (PDT) (envelope-from tlambert@usr01.primenet.com) Received: (from daemon@localhost) by smtp04.primenet.com (8.8.8/8.8.8) id TAA22235; Fri, 7 Aug 1998 19:08:41 -0700 (MST) Received: from usr01.primenet.com(206.165.6.201) via SMTP by smtp04.primenet.com, id smtpd022177; Fri Aug 7 19:08:35 1998 Received: (from tlambert@localhost) by usr01.primenet.com (8.8.5/8.8.5) id TAA20796; Fri, 7 Aug 1998 19:08:23 -0700 (MST) From: Terry Lambert Message-Id: <199808080208.TAA20796@usr01.primenet.com> Subject: Re: memory leaks in libc To: jb@cimlogic.com.au (John Birrell) Date: Sat, 8 Aug 1998 02:08:23 +0000 (GMT) Cc: archie@whistle.com, jb@cimlogic.com.au, freebsd-current@FreeBSD.ORG, bde@zeta.org.au, wollman@khavrinen.lcs.mit.edu, dg@root.com In-Reply-To: <199808072135.HAA10923@cimlogic.com.au> from "John Birrell" at Aug 8, 98 07:35:32 am X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > FWIW, I think that any proposed changes to libc should be _required_ to > be thread-safe from now on so that libc has a better chance of working > with kernel threads. I have sent copies of excerpts of the CAE and SUS specifications to the most interested (vocal) parties. Here are the salient points, and then can we let this die like Poul suggested? According to the standards: 1) People are permitted to muck about in environ. 2) putenv( "foo=fee"); followed by putenv("foo=xyz") is REQUIRED to free the allocations; in other words, not leak. 3) getenv() is permitted to use a local static buffer. Thus depending on getting a pointer to the real variable is not a valid thing to do. 4) Conforming POSIX threading programs are required to implement synchronization between threads accessing getenv/putenv and/or using environ to much things around. 5) Neither getenv() or putenv() are required to be reentrant. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message