Philippe M. Chiasson wrote:

Geoffrey Young wrote:

There is currently one bug with mod_perl compiled statically. It tries to add
the MODPERL2 server define at hook-registry phase, but for statically linked
modules, that hook-registry phase is called before ap_server_config_defines is
created.


hmm, called before, or the dso reload behavior is different so we don't
notice with dso?  I wasn't aware that the order of things actually changed
with dso vs static.



Basically, we want to define MODPERL2 as a server define, and the only phase
where you can safely do that before configuration is during the hook-registry
phase. the pre_config hook is not early enough for this.

So, from httpd/server/main.c:

    ap_setup_prelinked_modules(process);
    [...]
    ap_server_config_defines   = apr_array_make(pcommands, 1, sizeof(char *));

And the problem is that ap_setup_prelinked_modules() loads up static modules
about the same way that mod_so does it, just at a much earlier time.
ap_setup_prelinked_modules() calls register_hooks on mod_perl (and the other
statically compiled modules), and mod_perl's register_hooks tries to push
MODPERL2 to ap_server_config_defines, but that's not initialized yet, so SEGV.

It can be fixed either with my simple httpd patch, or possibly by introducing an
httpd API to manipulate ap_server_config_defines that can create it when first
accessed.

Why do you need a new API? I think the best fix is to have ap_server_config_defines call the array_make if pcommands is NULL, or is it a static var unaccessible from ap_server_config_defines? I haven't looked at the source.


But the patch I suggested just moves static module initialization after a few
global structures have been initialized, so I can't see what harm it could do.

And someone later will decide to move it back, breaking things again. Allocate on demand is probably the cleanest solution.


__________________________________________________________________
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