You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Gisle Aas <gi...@activestate.com> on 2005/01/16 11:58:46 UTC

MP_PERL_FREE_THREAD_KEY_WORKAROUND

Stas, 

Could you apply this addition to the MP_PERL_FREE_THREAD_KEY_WORKAROUND?
This will avoid that the perl_fini patch now in ActivePerl blows up
because we end up with calling FREE_THREAD_KEY twice.

--Gisle


diff -ru modperl-2.0_20050116053812/src/modules/perl/modperl_perl_includes.h modperl-2.0-hack/src/modules/perl/modperl_perl_includes.h
--- modperl-2.0_20050116053812/src/modules/perl/modperl_perl_includes.h	2005-01-13 06:46:07.000000000 +0100
+++ modperl-2.0-hack/src/modules/perl/modperl_perl_includes.h	2005-01-16 11:51:09.986693975 +0100
@@ -146,6 +146,7 @@
 #define MP_PERL_FREE_THREAD_KEY_WORKAROUND      \
     if (PL_curinterp) {                         \
         FREE_THREAD_KEY;                        \
+        PL_curinterp = NULL;                    \
     }
 #else
 #define MP_PERL_FREE_THREAD_KEY_WORKAROUND


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


Re: MP_PERL_FREE_THREAD_KEY_WORKAROUND

Posted by "Philippe M. Chiasson" <go...@ectoplasm.org>.
Eric Cholet wrote:

> Le 16 janv. 05, à 11:58, Gisle Aas a écrit :
>
>> Stas,
>>
>> Could you apply this addition to the  
>> MP_PERL_FREE_THREAD_KEY_WORKAROUND?
>> This will avoid that the perl_fini patch now in ActivePerl blows up
>> because we end up with calling FREE_THREAD_KEY twice.
>>
>> --Gisle
>>
>> diff -ru  
>> modperl-2.0_20050116053812/src/modules/perl/modperl_perl_includes.h  
>> modperl-2.0-hack/src/modules/perl/modperl_perl_includes.h
>> ---  
>> modperl-2.0_20050116053812/src/modules/perl/modperl_perl_includes.h     
>> 2005-01-13 06:46:07.000000000 +0100
>> +++  modperl-2.0-hack/src/modules/perl/modperl_perl_includes.h    
>> 2005-01-16  11:51:09.986693975 +0100
>> @@ -146,6 +146,7 @@
>>  #define MP_PERL_FREE_THREAD_KEY_WORKAROUND      \
>>      if (PL_curinterp) {                         \
>>          FREE_THREAD_KEY;                        \
>> +        PL_curinterp = NULL;                    \
>>      }
>>  #else
>>  #define MP_PERL_FREE_THREAD_KEY_WORKAROUND
>
> also fixes darwin w/ threaded Perl + worker

Same here for me, that patches makes the segfault I reported dissapear on my
darwin box.

Patch is in r125401.
 
--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5 
http://gozer.ectoplasm.org/     F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5


Re: MP_PERL_FREE_THREAD_KEY_WORKAROUND

Posted by "Philippe M. Chiasson" <go...@ectoplasm.org>.
Gisle Aas wrote:
> Eric Cholet <ch...@logilune.com> writes:
> 
>>>diff -ru
>>>modperl-2.0_20050116053812/src/modules/perl/modperl_perl_includes.h
>>>modperl-2.0-hack/src/modules/perl/modperl_perl_includes.h
>>>---
>>>modperl-2.0_20050116053812/src/modules/perl/modperl_perl_includes.h
>>>2005-01-13 06:46:07.000000000 +0100
>>>+++
>>>modperl-2.0-hack/src/modules/perl/modperl_perl_includes.h
>>>2005-01-16  11:51:09.986693975 +0100
>>>@@ -146,6 +146,7 @@
>>> #define MP_PERL_FREE_THREAD_KEY_WORKAROUND      \
>>>     if (PL_curinterp) {                         \
>>>         FREE_THREAD_KEY;                        \
>>>+        PL_curinterp = NULL;                    \
>>>     }
>>> #else
>>> #define MP_PERL_FREE_THREAD_KEY_WORKAROUND
>>
>>also fixes darwin w/ threaded Perl + worker
> 
> This sounds suspicions to me.  Doesn't this mean that
> MP_PERL_FREE_THREAD_KEY_WORKAROUND runs twice in this setup.  Can you
> explain why this would happen?

Without that patch, on darwin with perl-5.8.1-ithreads, I get the following
backtrace on startup:

Program received signal EXC_BAD_ACCESS, Could not access memory.
0x02432910 in S_mess_alloc (my_perl=0x0) at util.c:818
818         if (!PL_dirty)
(gdb) bt
#0  0x02432910 in S_mess_alloc (my_perl=0x0) at util.c:818
#1  0x02432db4 in Perl_vmess (my_perl=0x0, pat=0x252fc5c "panic: pthread_setspecific", args=0xbffff2a4) at util.c:946
#2  0x02434260 in Perl_vcroak (my_perl=0x0, pat=0x252fc5c "panic: pthread_setspecific", args=0xbffff2a4) at util.c:1146
#3  0x02434bd4 in Perl_croak_nocontext (pat=0x252fc5c "panic: pthread_setspecific") at util.c:1216
#4  0x023b5a4c in perl_alloc () at perl.c:144
#5  0x02206490 in modperl_startup (s=0x1807fb8, p=0x1806218) at mod_perl.c:237
#6  0x022063c0 in modperl_startup (s=0x1807fb8, p=0x1806218) at mod_perl.c:207
#7  0x02207df4 in modperl_init (base_server=0x1807fb8, p=0x1806218) at mod_perl.c:453
#8  0x02208450 in modperl_hook_init (pconf=0x1806218, plog=0x0, ptemp=0x0, s=0x1807fb8) at mod_perl.c:613
#9  0x022084a8 in modperl_run () at mod_perl.c:624
#10 0x0221067c in modperl_cmd_load_module (parms=0xbffff850, mconfig=0x1843ff8, arg=0x1971b78 "TestCompat::apache_module") at modperl_cmd.c:650
#11 0x00020498 in invoke_cmd (cmd=0x2240be0, parms=0xbffff850, mconfig=0x1843ff8, args=0x1971b78 "TestCompat::apache_module") at config.c:796
#12 0x00020bc4 in ap_walk_config_sub (current=0x1971b58, parms=0xbffff850, section_vector=0x183de50) at config.c:1059
#13 0x00020c64 in ap_walk_config (current=0x2240be0, parms=0xbffff850, section_vector=0x1971b58) at config.c:1098
#14 0x00021a08 in ap_process_config_tree (s=0x1807fb8, conftree=0x183de50, p=0x2240be0, ptemp=0xbffff850) at config.c:1641
#15 0x0000ae18 in main (argc=11, argv=0xbffffa00) at main.c:595

--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/     F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5

Re: MP_PERL_FREE_THREAD_KEY_WORKAROUND

Posted by Gisle Aas <gi...@activestate.com>.
Eric Cholet <ch...@logilune.com> writes:

> > diff -ru
> > modperl-2.0_20050116053812/src/modules/perl/modperl_perl_includes.h
> > modperl-2.0-hack/src/modules/perl/modperl_perl_includes.h
> > ---
> > modperl-2.0_20050116053812/src/modules/perl/modperl_perl_includes.h
> > 2005-01-13 06:46:07.000000000 +0100
> > +++
> > modperl-2.0-hack/src/modules/perl/modperl_perl_includes.h
> > 2005-01-16  11:51:09.986693975 +0100
> > @@ -146,6 +146,7 @@
> >  #define MP_PERL_FREE_THREAD_KEY_WORKAROUND      \
> >      if (PL_curinterp) {                         \
> >          FREE_THREAD_KEY;                        \
> > +        PL_curinterp = NULL;                    \
> >      }
> >  #else
> >  #define MP_PERL_FREE_THREAD_KEY_WORKAROUND
> 
> also fixes darwin w/ threaded Perl + worker

This sounds suspicions to me.  Doesn't this mean that
MP_PERL_FREE_THREAD_KEY_WORKAROUND runs twice in this setup.  Can you
explain why this would happen?

--Gisle


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


Re: MP_PERL_FREE_THREAD_KEY_WORKAROUND

Posted by Eric Cholet <ch...@logilune.com>.
Le 16 janv. 05, à 11:58, Gisle Aas a écrit :

> Stas,
>
> Could you apply this addition to the  
> MP_PERL_FREE_THREAD_KEY_WORKAROUND?
> This will avoid that the perl_fini patch now in ActivePerl blows up
> because we end up with calling FREE_THREAD_KEY twice.
>
> --Gisle
>
>
> diff -ru  
> modperl-2.0_20050116053812/src/modules/perl/modperl_perl_includes.h  
> modperl-2.0-hack/src/modules/perl/modperl_perl_includes.h
> ---  
> modperl-2.0_20050116053812/src/modules/perl/modperl_perl_includes.h	 
> 2005-01-13 06:46:07.000000000 +0100
> +++  
> modperl-2.0-hack/src/modules/perl/modperl_perl_includes.h	2005-01-16  
> 11:51:09.986693975 +0100
> @@ -146,6 +146,7 @@
>  #define MP_PERL_FREE_THREAD_KEY_WORKAROUND      \
>      if (PL_curinterp) {                         \
>          FREE_THREAD_KEY;                        \
> +        PL_curinterp = NULL;                    \
>      }
>  #else
>  #define MP_PERL_FREE_THREAD_KEY_WORKAROUND

also fixes darwin w/ threaded Perl + worker

--
Eric Cholet


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