Stas Bekman wrote:
Stas Bekman wrote:
This and your trace proves my suspicion that my solution just happened to work for the particular setup you had the crush with. But I think we are on the right track. We get the crash when the wrong perl is set as the current context. I will try to remove my recent solution and try to see why modperl_cmd_modules doesn't use the correct perl. This is the place where the problem comes from.
Please try this patch:
Trying your patch with the short conf file that I posted a few minutes ago, the -t test now passes "syntax OK", but the server still won't start.
Running "C:\apache2\bin\Apache.exe -d C:/Temp/modperl-2.0/t -f C:/Temp/modperl-2.0/t/conf/httpd.conf -DAPACHE2 -DPERL_USEITHREADS" still crashes at the same "Free to wrong pool" place in the code, although its much earlier and I don't see that error message in the console now. Here's the stack trace:
=====
VMem::Free(void * 0x009fa3ac) line 208 + 3 bytes
CPerlHost::Free(void * 0x009fa3ac) line 59 + 34 bytes
PerlMemFree(IPerlMem * 0x00262434, void * 0x009fa3ac) line 302
Perl_safesysfree(void * 0x009fa3ac) line 143 + 26 bytes
Perl_sv_clear(interpreter * 0x002643cc, sv * 0x002653c4) line 5198 + 13 bytes
Perl_sv_free(interpreter * 0x002643cc, sv * 0x002653c4) line 5342 + 13 bytes
Perl_free_tmps(interpreter * 0x002643cc) line 189 + 13 bytes
perl_destruct(interpreter * 0x002643cc) line 456 + 23 bytes
modperl_perl_destruct(interpreter * 0x002643cc) line 144 + 9 bytes
So here we get perl_destruct calling some functions that rely on the right context. I don't get this problem, but please try this patch:
Index: src/modules/perl/mod_perl.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v
retrieving revision 1.201
diff -u -r1.201 mod_perl.c
--- src/modules/perl/mod_perl.c 23 Oct 2003 05:57:46 -0000 1.201
+++ src/modules/perl/mod_perl.c 23 Oct 2003 23:28:59 -0000
@@ -458,13 +458,6 @@
exit(1); /*XXX*/
}
}
-
-#ifdef USE_ITHREADS
- /* after other parent perls were started in vhosts, make sure that
- * the context is set to the base_perl */
- PERL_SET_CONTEXT(base_perl);
-#endif
-
} #ifdef USE_ITHREADS
Index: src/modules/perl/modperl_cmd.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_cmd.c,v
retrieving revision 1.49
diff -u -r1.49 modperl_cmd.c
--- src/modules/perl/modperl_cmd.c 20 Oct 2003 17:44:48 -0000 1.49
+++ src/modules/perl/modperl_cmd.c 23 Oct 2003 23:28:59 -0000
@@ -116,6 +116,11 @@
#ifdef USE_ITHREADS
/* XXX: .htaccess support cannot use this perl with threaded MPMs */
dTHXa(scfg->mip->parent->perl);
+ PERL_SET_CONTEXT(scfg->mip->parent->perl);
+ MP_TRACE_d(MP_FUNC,
+ "using mip=0x%lx, my_perl=0x%lx, PL_curinterp=0x%lx\n",
+ (PerlInterpreter *)scfg->mip->parent->perl, my_perl,
+ PERL_GET_CONTEXT);
#endif
MP_TRACE_d(MP_FUNC, "load PerlModule %s\n", arg);@@ -145,6 +150,7 @@
#ifdef USE_ITHREADS
/* XXX: .htaccess support cannot use this perl with threaded MPMs */
dTHXa(scfg->mip->parent->perl);
+ PERL_SET_CONTEXT(scfg->mip->parent->perl);
#endif MP_TRACE_d(MP_FUNC, "load PerlRequire %s\n", arg);
@@ -381,6 +387,7 @@
#ifdef USE_ITHREADS
/* XXX: .htaccess support cannot use this perl with threaded MPMs */
aTHX = scfg->mip->parent->perl;
+ PERL_SET_CONTEXT(scfg->mip->parent->perl);
#endif/* data will be set by a <Perl> section */ Index: src/modules/perl/modperl_perl.c =================================================================== RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl.c,v retrieving revision 1.19 diff -u -r1.19 modperl_perl.c --- src/modules/perl/modperl_perl.c 18 Oct 2003 21:01:30 -0000 1.19 +++ src/modules/perl/modperl_perl.c 23 Oct 2003 23:28:59 -0000 @@ -135,12 +135,14 @@
{
dTHXa(perl);
+ PERL_SET_CONTEXT(perl); if ((module_commands = modperl_module_config_table_get(aTHX_ FALSE))) {
modperl_svptr_table_destroy(aTHX_ module_commands);
}
}+ PERL_SET_CONTEXT(perl);
perl_destruct(perl);/* XXX: big bug in 5.6.1 fixed in 5.7.2+
Using the full vhost test setup I do still see the "Free to wrong pool" message as before, but the stack trace is still shorter. Here it is:
=====
VMem::Free(void * 0x00acea1c) line 208 + 3 bytes
CPerlHost::Free(void * 0x00acea1c) line 59 + 34 bytes
PerlMemFree(IPerlMem * 0x00262434, void * 0x00acea1c) line 302
Perl_safesysfree(void * 0x00acea1c) line 143 + 26 bytes
Perl_sv_clear(interpreter * 0x012aff6c, sv * 0x013a1b3c) line 5198 + 13 bytes
Perl_sv_free(interpreter * 0x012aff6c, sv * 0x013a1b3c) line 5342 + 13 bytes
Perl_av_undef(interpreter * 0x012aff6c, av * 0x013a1ae8) line 498 + 32 bytes
Perl_sv_clear(interpreter * 0x012aff6c, sv * 0x013a1ae8) line 5161 + 13 bytes
Perl_sv_free(interpreter * 0x012aff6c, sv * 0x013a1ae8) line 5342 + 13 bytes
Perl_free_tmps(interpreter * 0x012aff6c) line 189 + 13 bytes
Perl_pp_nextstate(interpreter * 0x012aff6c) line 41 + 23 bytes
Perl_runops_debug(interpreter * 0x012aff6c) line 1434 + 13 bytes
S_call_body(interpreter * 0x012aff6c, op * 0x0006fbe0, int 1) line 2193 + 13 bytes
Perl_eval_sv(interpreter * 0x012aff6c, sv * 0x012c759c, long 2) line 2253 + 15 bytes
Perl_require_pv(interpreter * 0x012aff6c, const char * 0x0088cec8) line 2351 + 15 bytes
modperl_require_file(interpreter * 0x012aff6c, const char * 0x0088cec8, int 1) line 30 + 13 bytes
modperl_config_apply_PerlRequire(server_rec * 0x0088bfd0,
Just to prove my assumptions I'd try to temporarely patch it as:
Index: src/modules/perl/modperl_util.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.c,v
retrieving revision 1.55
diff -u -r1.55 modperl_util.c
--- src/modules/perl/modperl_util.c 9 Oct 2003 23:56:52 -0000 1.55
+++ src/modules/perl/modperl_util.c 23 Oct 2003 23:34:32 -0000
@@ -4,6 +4,8 @@
{
SV *sv;+ PERL_SET_CONTEXT(my_perl);
+
dSP;
PUSHSTACKi(PERLSI_REQUIRE);
PUTBACK;
__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
