Bug 188572 - Valgrind on Mac should suppress setenv() mem leak
Summary: Valgrind on Mac should suppress setenv() mem leak
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: memcheck (show other bugs)
Version: 3.5 SVN
Platform: Unlisted Binaries macOS
: NOR normal
Target Milestone: blocking3.5.0
Assignee: Nicholas Nethercote
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-31 23:00 UTC by Nirnimesh
Modified: 2011-02-02 18:18 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nirnimesh 2009-03-31 23:00:35 UTC
setenv() on Mac leaks memory intentionally. (refer: man setenv)
Valgrind should suppress this on Mac.

Probably:
{
 setenv() leaks on Mac intentionally.
   Memcheck:Leak
   ...
   fun:__setenv
   fun:setenv$UNIX2003
}
Comment 1 Nicholas Nethercote 2009-04-01 01:36:19 UTC
For reference, here's the relevant section from the man page:

BUGS
     Successive calls to setenv() or putenv() assigning a differently sized
     value to the same name will result in a memory leak.  The FreeBSD seman-
     tics for these functions (namely, that the contents of value are copied
     and that old values remain accessible indefinitely) make this bug
     unavoidable.  Future versions may eliminate one or both of these semantic
     guarantees in order to fix the bug.
Comment 2 Nicholas Nethercote 2009-06-26 09:00:32 UTC
Fixed in r10380.  Thanks for the report.
Comment 3 Alexander Potapenko 2010-10-26 08:55:49 UTC
This is missing in darwin10.supp since the merge of MACOSX106. Was it intentional?
Comment 4 Julian Seward 2011-02-02 18:18:48 UTC
Fixed, r11519.