Stas Bekman wrote: > Philippe M. Chiasson wrote: > >> Stas Bekman wrote: >> >>> Philippe M. Chiasson wrote: >>> [...] >>> >>>> After a long promised investigation session, I believe I have pinned >>>> it down. It seems to have been introduced by change r160562 when the >>>> anon_cnt initialization code was moved around as a result. Didn't have >>>> enough time tonight to dig down as to _why_ this is breaking though... >>>> >>>> Not entirely sure why this breaks specifically on Darwin and all, but >>>> the following patch seems to make the problem dissapear. Does it fix >>>> the problem you are seeing too ? >>>> >>>> Index: src/modules/perl/modperl_handler.c >>>> =================================================================== >>>> --- src/modules/perl/modperl_handler.c (revision 170139) >>>> +++ src/modules/perl/modperl_handler.c (working copy) >>>> @@ -89,9 +89,6 @@ >>>> modperl_modglobal_lookup(aTHX_ "ANONSUB"); >>>> MP_TRACE_h(MP_FUNC, "init $PL_modglobal{ANONSUB} = []"); >>>> MP_MODGLOBAL_STORE_HV(gkey); >>>> - >>>> - /* init the counter to 0 */ >>>> - modperl_global_anon_cnt_init(p); >>>> } >>>> >>>> /* allocate and populate the anon handler sub-struct */ >>>> Index: src/modules/perl/mod_perl.c >>>> =================================================================== >>>> --- src/modules/perl/mod_perl.c (revision 170139) >>>> +++ src/modules/perl/mod_perl.c (working copy) >>>> @@ -532,6 +532,9 @@ >>>> modperl_global_init_server_rec(pconf, s); >>>> >>>> modperl_tls_create_request_rec(pconf); >>>> + >>>> + /* init the counter to 0 */ >>>> + modperl_global_anon_cnt_init(pconf); >>>> } >>>> >>>> /* >>> >>> Philippe is talking about >>> http://svn.apache.org/viewcvs.cgi?rev=160562&view=rev >>> >>> http://svn.apache.org/viewcvs.cgi/perl/modperl/trunk/src/modules/perl/mod_perl.c?rev=160562&view=diff&r1=160562&r2=160561&p1=perl/modperl/trunk/src/modules/perl/mod_perl.c&p2=/perl/modperl/trunk/src/modules/perl/mod_perl.c >>> >> >> Yup, that one. >> >>> But it can't be reverted , since it was a fix for a bug in >>> vhosts+anonsub+ithreads. I couldn't add a test reproducing the problem, >>> as it wasn't suitable for the test suite (would have affected other >>> tests). So it needs to stay that way and figured out what needs to be >>> fixed elsewhere. >>> >>> Philippe, your patch can't be applied either, since it has exactly the >>> same effect as reverting r160562, since you moved >>> modperl_global_anon_cnt_init() to modperl_init_globals() which is called >>> only for the top-level server >> >> Yes, but I am not reverting that change, keeping it as is, hash >> initialization >> and all, and only moving the modperl_global_anon_cnt_init() up so it's >> called >> only once. I don't think initializating that anon_cnt global more than >> once is >> a feature (and it registers it's destruction twice, causing the >> segfault on OSX). > > No, you are reverting it. Follow the calls trace, you've just moved the > original case (before my change) to a different place.
Unless I am missing something terribly obvious, I believe you are talking about this chunk of code: modperl_modglobal_key_t *gkey = modperl_modglobal_lookup(aTHX_ "ANONSUB"); MP_TRACE_h(MP_FUNC, "init $PL_modglobal{ANONSUB} = []"); MP_MODGLOBAL_STORE_HV(gkey); And that's what needs to be initialized in each server/vhost, correct? And that still is. The only code I am suggesting to move around is the modperl_global_anon_cnt_init() call >> Are you saying that you need more than one distinct global anon_cnt in >> some >> vhost+anonsub+ithreads setup? > > Yes. Otherwise an anon-sub registered at the server startup in a vhost > +Parent doesn't work. But what needs to be initialized for each vhost isn't the anon-sub counter integer, but rather $PL_modglobal{ANONSUB}, right ? > First it was moved from running from each vhost to just the base server: > http://marc.theaimsgroup.com/?l=apache-modperl-dev&m=110177550408046&w=2 > The whole thread is here (i think it was OSX too): > http://marc.theaimsgroup.com/?l=apache-modperl-dev&m=110168848916838&w=2 > > but then Dominique Quatravaux has encountered another bug, which you can > see in this thread: > http://marc.theaimsgroup.com/?t=111227919600001&r=1&w=2 -------------------------------------------------------------------------------- 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
signature.asc
Description: OpenPGP digital signature