perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gisle Aas <gi...@ActiveState.com>
Subject Re: [PATCH] libperl leaks a THREAD_KEY each time it is reloaded
Date Tue, 11 Jan 2005 20:22:30 GMT
Stas Bekman <stas@stason.org> writes:

> The latest version is:
> 
> Index: src/modules/perl/mod_perl.c
> ===================================================================
> --- src/modules/perl/mod_perl.c (revision 124805)
> +++ src/modules/perl/mod_perl.c (working copy)
> @@ -573,6 +573,17 @@
>       MP_threads_started = 0;
>       MP_post_post_config_phase = 0;
> 
> +    /* with USE_ITHREADS perl leaks pthread_key_t on every
> +     * perl_destruct, which becomes a problem restarts: if the OS

I would fix this comment a bit.  There isn't a pthread_key_t leaked on
every perl_destruct.  There is a pthread_key_t leaked on every reload
of libperl.{a,so}.

> +     * limit is 1024, 1024 restarts later things will start
> +     * crashing */
> +    /* XXX: this is a workaround for the bug in perl, once and if it's
> +     * fixed we need to disable it for the versions that have it
> +     * fixed */
> +    if (PL_curinterp) {
> +        FREE_THREAD_KEY;
> +    }

Still seems like a good idea to protect this section in a #ifdef
USE_ITHREADS block to match when PL_curinterp follow the invariant you
are testing for here.

> +
>       MP_TRACE_i(MP_FUNC, "mod_perl sys term\n");

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message