develooper Front page | perl.perl5.porters | Postings from December 2015

[perl #126240] "panic: free from wrong pool" while freeing the envafter fork on darwin

Thread Previous
Tony Cook via RT
December 16, 2015 03:53
[perl #126240] "panic: free from wrong pool" while freeing the envafter fork on darwin
Message ID:
On Wed Dec 09 07:08:21 2015, davem wrote:
> On Tue, Dec 08, 2015 at 03:38:02PM -0800, Tony Cook via RT wrote:
> > I suspect that we should be using -DPERL_USE_SAFE_PUTENV on any
> > system we can
> By "can", do you mean any system that physically works with
> PERL_USE_SAFE_PUTENV, or any system that doesn't leak with

I guess that's the hard bit to define.

I'm guessing any system that has unsetenv() will be safe, since setenv(), getenv() and unsetenv() *should* be working together to manage memory correctly.

putenv()'s memory handling isn't well defined in POSIX, ie. there's no 
assumption in POSIX[1] (nor the man pages for Linux, BSD, OS X that I 
saw) that such memory is allocated with malloc(), so an implementation 
can't really free() it safely.

POSIX also mentions[2] that using putenv() can (theoretically) slow down getenv() if an implementation uses an internal structure to speed up environment variable lookups.


The rationale talks about free() in passing, but there's no requirement

in the rationale.

via perlbug:  queue: perl5 status: open

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About