perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: [PATCH] libperl leaks a THREAD_KEY each time it is reloaded
Date Mon, 10 Jan 2005 20:14:26 GMT
Gisle Aas wrote:
> Stas Bekman <> writes:
>>I've played with it some more. The following program demonstrates some
>>So again perl doesn't provide enough public API to properly juggle
>>perl interpreters.
> I disagree.  The API seems fine to me.


1) There is a bug in perl_alloc. As my program (see my previous post in 
this thread) demostrates, perl_alloc will not allocate a private key for a 
new interpreter (which is proper for perl_clone'd perls, but broken for a 
different perl running in the same interpreter.

2) PERL_SET_CONTEXT has a problem with using the PL_thr_key key, which may 
belong to a totally different interpreter.

> Don't mess with PL_curintep or FREE_THREAD_KEY.  These are internal to
> perl and this problem should be fixed inside perl.  Assignments to
> PL_curinterp or killing the thread key can't be made thread safe
> without cooperation with perl itself.
> If you need a workaround until this is fixed in perl just link in the
> destructor I provided in mod_perl itself.

I don't try to mess with anything. All I try to do is to provide a 
workaround for users of older perls. As you can see from my previous posts 
the workaround that you suggest does not work if there is more than one 
parent perl as things segfault.

And in any case I didn't see perl fixed and it's not quite clear whether 
it's going to be fixed at all.

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message