Return-Path: Delivered-To: apmail-perl-dev-archive@www.apache.org Received: (qmail 33830 invoked from network); 8 Oct 2004 02:09:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 8 Oct 2004 02:09:22 -0000 Received: (qmail 6530 invoked by uid 500); 8 Oct 2004 02:09:21 -0000 Delivered-To: apmail-perl-dev-archive@perl.apache.org Received: (qmail 6392 invoked by uid 500); 8 Oct 2004 02:09:20 -0000 Mailing-List: contact dev-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@perl.apache.org Received: (qmail 6377 invoked by uid 99); 8 Oct 2004 02:09:20 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [195.80.154.36] (HELO mail.logilune.com) (195.80.154.36) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 07 Oct 2004 19:09:17 -0700 Received: from [127.0.0.1] (localhost.logilune.com [127.0.0.1]) by mail.logilune.com (Postfix) with ESMTP id C93321E1990; Fri, 8 Oct 2004 04:09:12 +0200 (CEST) Message-ID: <4165F6C7.3060303@stason.org> Date: Thu, 07 Oct 2004 22:09:11 -0400 From: Stas Bekman Organization: Hope, Humanized User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040804 X-Accept-Language: en-us, en, he, ru MIME-Version: 1.0 To: Joe Schaefer Cc: dev@perl.apache.org Subject: Re: t/TEST t/directive/cmdparms.t segfaults w/5.8.5+ithreads References: <87zn37id1z.fsf@gemini.sunstarsys.com> <877jqaictu.fsf@gemini.sunstarsys.com> <415D9203.1040702@modperlcookbook.org> <415DCDD7.70401@stason.org> <878yapoixf.fsf@gemini.sunstarsys.com> <4164A976.3070808@stason.org> <87zn2zw84f.fsf@gemini.sunstarsys.com> <4164BA88.2020200@stason.org> <87k6u2we4s.fsf@gemini.sunstarsys.com> In-Reply-To: <87k6u2we4s.fsf@gemini.sunstarsys.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Joe Schaefer wrote: > Stas Bekman writes: > > >>Joe Schaefer wrote: >> >>>Stas Bekman writes: >>>[...] >>> >>> >>>>Joe, this still needs to applied? But please make sure that you >>>>restore the context when you are done with it. Look at the other >>>>places where this is done (grep for SET_CONTEXT). >>> >>>AFAICT the only place where the context is "localized" is in modperl_cmd.c: >>>#define MP_PERL_DECLARE_CONTEXT \ >>> PerlInterpreter *orig_perl; \ >>> pTHX; >>>/* XXX: .htaccess support cannot use this perl with threaded MPMs */ >>>#define MP_PERL_OVERRIDE_CONTEXT \ >>> orig_perl = PERL_GET_CONTEXT; \ >>> aTHX = scfg->mip->parent->perl; \ >>> PERL_SET_CONTEXT(aTHX); >>>#define MP_PERL_RESTORE_CONTEXT \ >>> PERL_SET_CONTEXT(orig_perl); >>>Is that what you have in mind here? >> >>Exactly. > > > Here's the patch- unfortunately it doesn't quite work... > I get a similar segfault when the perl handler runs > (this patch only affects modperl_module_config_merge). > > Index: src/modules/perl/modperl_module.c > =================================================================== > RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_module.c,v > retrieving revision 1.17 > diff -u -r1.17 modperl_module.c > --- src/modules/perl/modperl_module.c 4 Mar 2004 06:01:07 -0000 1.17 > +++ src/modules/perl/modperl_module.c 7 Oct 2004 18:50:57 -0000 > @@ -169,6 +169,7 @@ > #ifdef USE_ITHREADS > modperl_interp_t *interp; > dTHX; > + PerlInterpreter *orig_perl = aTHX; > #endif I wonder why do we have dTHX there. It's most likely the cause of the problem, as essentially it grabs the latest context that was used recently. It should be: Index: src/modules/perl/modperl_module.c =================================================================== RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_module.c,v retrieving revision 1.17 diff -u -r1.17 modperl_module.c --- src/modules/perl/modperl_module.c 4 Mar 2004 06:01:07 -0000 1.17 +++ src/modules/perl/modperl_module.c 8 Oct 2004 02:04:48 -0000 @@ -168,7 +168,7 @@ #ifdef USE_ITHREADS modperl_interp_t *interp; - dTHX; + pTHX; #endif /* if the module is loaded in vhost, base==NULL */ need to check if we have other places that use dTHX instead of pTHX pTHX: register PerlInterpreter *my_perl dTHX: register PerlInterpreter *my_perl = PERL_GET_THX Could that be the problem that you see? Could you please try with my patch above, reversing yours first? -- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:stas@stason.org http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org For additional commands, e-mail: dev-help@perl.apache.org