Philippe M. Chiasson wrote:
Stas Bekman wrote:

Philippe,

there is a problem with this code:

MP_CMD_SRV_DECLARE(post_config_requires)
{
[...]
#ifdef USE_ITHREADS
             if (modperl_is_running()) {
                 require->perl = scfg->mip->parent->perl;
             }
#endif

so if perl is not yet running, (which is by chance not a case with our test suite) those perls will be never registered and postconfig will be all segfaults.


Not quite, that's what modperl_config.c:modperl_config_prepare_PerlPostConfigRequire()
is for. Detecting these at modperl startup time and binding the right, newly created
Perl interpreters with these.

Ah, OK, but why doing it in two places, when this can be always done by modperl_config.c:modperl_config_prepare_PerlPostConfigRequire()?

Index: src/modules/perl/modperl_cmd.c
===================================================================
--- src/modules/perl/modperl_cmd.c      (revision 122972)
+++ src/modules/perl/modperl_cmd.c      (working copy)
@@ -282,18 +282,12 @@
     apr_pool_t *p = parms->pool;
     apr_finfo_t finfo;
     MP_dSCFG(parms->server);
-    MP_PERL_DECLARE_CONTEXT;

if (APR_SUCCESS == apr_stat(&finfo, arg, APR_FINFO_TYPE, p)) {
if (finfo.filetype != APR_NOFILE) {
- modperl_require_file_t *require = apr_pcalloc(p, sizeof(*require));
-#ifdef USE_ITHREADS
- if (modperl_is_running()) {
- MP_PERL_OVERRIDE_CONTEXT;
- require->perl = aTHX;
- MP_PERL_RESTORE_CONTEXT;
- }
-#endif
+ modperl_require_file_t *require = apr_pcalloc(p, sizeof(*require));
+ /* require->perl will be populated by
+ * modperl_config_prepare_PerlPostConfigRequire */
require->file = arg;


             MP_TRACE_d(MP_FUNC, "push PerlPostConfigRequire for %s\n", arg);

But this doesn't work - the server segfaults of the first pass, meaning that if someone tries to use this when modperl_is_running() returns 0 this will fail. May be try to reproduce that with a skeleton, outside the mp2 test suite.


-- __________________________________________________________________ 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]



Reply via email to