On 6 November 2013 00:48, Jeff Trawick <traw...@gmail.com> wrote:
> On Tue, Nov 5, 2013 at 11:53 AM, Jeff Trawick <traw...@gmail.com> wrote:
>>
>> * Have existing 64-bit debug build of httpd/apr/etc. with VS 2012
>> * Checked out httpd24threading branch of mod_perl
>> * Have ActiveState 64-bit build of Perl 5.16.3 in PATH
>>
>> From a VS 2012 64-bit command prompt:
>>
>> > set MP_USE_MY_EXTUTILS_EMBED=1
>> (ActiveState ppm doesn't show the exact version requested as available.)
>>
>> > perl Makefile.PL MP_AP_PREFIX=%HOME%\PREFIXES\241
>> (and let it download apxs.bat et al)
>> > nmake
>> > nmake install
>> > nmake test
>>
>> ==> crash at httpd startup
>>
>> If I believe the Visual Studio debugger, it fails with a very basic
>> linkage issue -- mod_authz_core.so!add_authz_provider has non-NULL
>> cmd_parms; it calls perl_parse_require_line(), which the debugger believes
>> has a NULL cmd_parms.  And indeed it crashes at a place in
>> modperl_interp_pool_select() where a NULL pointer would be used, after
>> making a bad decision based on the NULL cmd_parms.
>>
>> Any guess on what to change first?
>>
>> --
>> Born in Roswell... married an alien...
>> http://emptyhammock.com/
>
>
> Back to the httpd24threading branch:
>
> * modperl_interp_pool_select() has this notion of phase, which must either
> be startup or request context.
> * It thinks it is startup only if the pool passed in is s->process->pconf.
> * Sometimes it is passed s->process->pool (parent of pconf), such as from
> perl_parse_require_line().
> * perl_parse_require_line() can sometimes be called from request context.
> * When perl_parse_require_line() calls modperl_interp_pool_select(), request
> context can never be identified because perl_parse_require_line() never
> passes in r->pool (which I guess would be cmd->pool).
> * etc.
>
> This would seem to be the way to get the right pool to
> modperl_interp_pool_select().
>
> Index: src/modules/perl/modperl_util.c
> ===================================================================
> --- src/modules/perl/modperl_util.c     (revision 1539040)
> +++ src/modules/perl/modperl_util.c     (working copy)
> @@ -989,7 +989,7 @@
>      int count;
>      void *key;
>      auth_callback *ab;
> -    MP_dINTERP_POOLa(cmd->server->process->pool, cmd->server);
> +    MP_dINTERP_POOLa(cmd->pool, cmd->server);
>
>      if (global_authz_providers == NULL) {
>          MP_INTERP_PUTBACK(interp, aTHX);
>
> That still doesn't bring happiness (no interpreter returned, resulting in a
> crash trying to dereference interp).
>
> Any idea where to try to hack in some -debug support for "devenv /debugexe"?

Perl XS extensions (like mod_perl) pick up compile and link flags from
perl itself. If you're using ActivePerl then they'll be set to
"release with debug info" flags. I normally get a debug build by
building my own perl:

cd win32
nmake CFG=Debug INST_TOP=/path/to/install/into
nmake CFG=Debug INST_TOP=/path/to/install/into installbare

(See win32/Makefile for other settings).

You might be able to get mod_perl to build in debug mode with
ActivePerl by editing ActivePerl's lib/Config_heavy.pl to change
ccflags and lddlflags appropriately (perl uses compile / link flags O1
-MD -Zi -DNDEBUG / -debug -opt:ref,icf for release builds vs. -Od -MD
-Zi -DDEBUGGING / -debug for debug builds), but I've never tried doing
that myself -- I sometimes find I need perl built in debug mode to get
the full picture anyway, so that's what I do.


>
> Where do I see messages like
>
>            MP_TRACE_i(MP_FUNC, "using parent interpreter at startup");
>

When you build mod_perl, specify "MP_TRACE=1" on the Makefie.PL
command-line. Then you can use the PerlTrace directive in httpd.conf
and/or the MOD_PERL_TRACE environment variable to set various
different modes as documented here:

http://perl.apache.org/docs/2.0/user/config/config.html#C_PerlTrace_

The output goes to STDERR (i.e. logs/error_log).

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@perl.apache.org
For additional commands, e-mail: dev-h...@perl.apache.org

Reply via email to