You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Steve Hay <st...@uk.radan.com> on 2003/09/15 13:12:18 UTC

[PATCH] Re: mp2 with perl-5.8.1 on Windows

Randy Kobes wrote:

>On Fri, 12 Sep 2003, Steve Hay wrote:
>
>  
>
>>Hi,
>>
>>Has anybody else got mp2 (CVS) working with recent perl-5.8.1's on Windows?
>>
>>I've got it building, but I can't start the Apache server at all.  (It's
>>fine without the mod_perl bits in the httpd.conf file.)
>>
>>See this thread on p5p for what I'm getting:
>>
>>http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2003-09/msg00795.html
>>
>>Cheers,
>>- Steve
>>    
>>
>
>I also found a problem, as below:
>==========================================================================
>Perl_safesysmalloc(unsigned int 0x00000010) line 70 + 21 bytes
>  : perl-5.8.1/util.c
>
>modperl_hash_seed_init(apr_pool_t * 0x0026a7f0) line 44 + 7 bytes
>  : modperl-2.0/src/modules/perl/mod_perl.c
>
>modperl_hook_pre_config(apr_pool_t * 0x0026a7f0,
> apr_pool_t * 0x00848100, apr_pool_t * 0x0084a108) line 594 + 9 bytes
>  : modperl-2.0/src/modules/perl/mod_perl.c
>
>ap_run_pre_config(apr_pool_t * 0x00401441, apr_pool_t * 0x0026a7f0,
>  apr_pool_t * 0x00848100) line 126 + 49 bytes
>
>main(int 0x00401d82, const char * const * 0x00000008) line 575 + 19 bytes
>
>APACHE! mainCRTStartup + 227 bytes
>
>==========================================================================
>which seems to be related to the safemalloc() call on line
>44 of src/modules/perl/mod_perl.c. (by the way, I had to
>comment out the fprintf() call at line 66 to get it to
>compile, otherwise an error about my_perl being undeclared
>was found).
>
I still haven't found out what the problem with the server crashing on 
startup is, but the attached patch against CVS seems to fix the 
fprintf() problem that you refer to.

I've no idea how advisable what I've done is, but without it I get:

=====
        cl -IC:/Temp/modperl-2.0/src/modules/perl 
-IC:/Temp/modperl-2.0/xs -IC:\
apache2/include -IC:\apache2/include -nologo -Gf -W3 -Od -MD -Zi 
-DDEBUGGING -DW
IN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT  -DPERL_IMPLICIT_CONTEXT 
-DPERL_IM
PLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX  -I"C:\perl\lib\CORE" 
-DMOD_PERL -
DMP_COMPAT_1X -Od -MD -Zi -DDEBUGGING   -c mod_perl.c && 
C:\perl\bin\perl.exe -M
ExtUtils::Command -e mv mod_perl.obj mod_perl.lo
mod_perl.c
mod_perl.c(66) : error C2065: 'my_perl' : undeclared identifier
mod_perl.c(66) : warning C4047: 'function' : 'struct interpreter *' 
differs in l
evels of indirection from 'int '
mod_perl.c(66) : warning C4024: 'Perl_IStdIO_ptr' : different types for 
formal a
nd actual parameter 1
mod_perl.c(66) : warning C4047: 'function' : 'struct interpreter *' 
differs in l
evels of indirection from 'int '
mod_perl.c(66) : warning C4024: 'Perl_IStdIO_ptr' : different types for 
formal a
nd actual parameter 1
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
=====

and with it, it all builds OK.

- Steve

PS.  Randy: How do you that stacktrace output that you've posted?  Is 
that using MSVC++, or something else?


Re: [PATCH] Re: mp2 with perl-5.8.1 on Windows

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Mon, 15 Sep 2003, Steve Hay wrote:

> I've actually rebuilt Perl and Apache as full debug builds
> so I have all these .pdb files already.  mod_perl gets
> them too because it inherits Perl's "debug build" mode.
>
> My question was where in the DevStudio GUI do you get at
> the stacktrace that you posted, or how do you get
> DevStudio to dump it out for you?  All I can find is a
> "Context" drop-down (in the panel showing variables'
> values) from which I have to manually copy down the
> information (hence I only posted a list of functions!)
> It doesn't look like you've done that!

Hi Steve,
   I see now; that's something I struggled with too,
until Doug pointed this out; try Alt+7 to give a
stacktrace window (look under View -> Debug Windows).
And perhaps also to save some grief, if you want to
copy it, select+right-click within that window
doesn't work; you have to select+Edit->Copy.

-- 
best regards,
randy

Re: [PATCH] Re: mp2 with perl-5.8.1 on Windows

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Mon, 15 Sep 2003, Steve Hay wrote:

> I've actually rebuilt Perl and Apache as full debug builds
> so I have all these .pdb files already.  mod_perl gets
> them too because it inherits Perl's "debug build" mode.
>
> My question was where in the DevStudio GUI do you get at
> the stacktrace that you posted, or how do you get
> DevStudio to dump it out for you?  All I can find is a
> "Context" drop-down (in the panel showing variables'
> values) from which I have to manually copy down the
> information (hence I only posted a list of functions!)
> It doesn't look like you've done that!

Hi Steve,
   I see now; that's something I struggled with too,
until Doug pointed this out; try Alt+7 to give a
stacktrace window (look under View -> Debug Windows).
And perhaps also to save some grief, if you want to
copy it, select+right-click within that window
doesn't work; you have to select+Edit->Copy.

-- 
best regards,
randy

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


Re: [PATCH] Re: mp2 with perl-5.8.1 on Windows

Posted by Steve Hay <st...@uk.radan.com>.
Randy Kobes wrote:

>On Mon, 15 Sep 2003, Steve Hay wrote:
>
>  
>
>>PS.  Randy: How do you that stacktrace output that you've
>>posted?  Is that using MSVC++, or something else?
>>    
>>
>
>Hi Steve,
>  I'm using MSVC++ ... When a problem like this occurs,
>an offer is made to call up the VC++ debugger, where
>the trace is then done.
>  In order to get a more useful trace (with symbol
>information), I compiled Perl using some patches to
>perl-5.8.x/win32/Makefile that ActiveState introduced
>(http://aspn.activestate.com/ASPN/Downloads/ActivePerl/Source).
>This patch enables debug symbols in release builds, and
>involves using '-Zi' in $(OPTIMIZE) and '-debug
>-opt:ref,icf' for $(LINK_DBG). With this, one gets .pdb
>files corresponding to compiled libraries, which hold the
>symbol information (I had to manually copy perl58.pdb
>[corresponding to perl58.dll] to C:\Perl\bin). The
>Apache/2.0.47 sources have this also enabled for the release
>build, by default, and building mod_perl as 'perl
>Makefile.PL ... MP_DEBUG=1' will enable them in mod_perl as
>well.
>
Sorry, I should have made my question more specific.

I've actually rebuilt Perl and Apache as full debug builds so I have all 
these .pdb files already.  mod_perl gets them too because it inherits 
Perl's "debug build" mode.

My question was where in the DevStudio GUI do you get at the stacktrace 
that you posted, or how do you get DevStudio to dump it out for you?  
All I can find is a "Context" drop-down (in the panel showing variables' 
values) from which I have to manually copy down the information (hence I 
only posted a list of functions!)  It doesn't look like you've done that!

- Steve


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


Re: [PATCH] Re: mp2 with perl-5.8.1 on Windows

Posted by Steve Hay <st...@uk.radan.com>.
Randy Kobes wrote:

>On Mon, 15 Sep 2003, Steve Hay wrote:
>
>  
>
>>PS.  Randy: How do you that stacktrace output that you've
>>posted?  Is that using MSVC++, or something else?
>>    
>>
>
>Hi Steve,
>  I'm using MSVC++ ... When a problem like this occurs,
>an offer is made to call up the VC++ debugger, where
>the trace is then done.
>  In order to get a more useful trace (with symbol
>information), I compiled Perl using some patches to
>perl-5.8.x/win32/Makefile that ActiveState introduced
>(http://aspn.activestate.com/ASPN/Downloads/ActivePerl/Source).
>This patch enables debug symbols in release builds, and
>involves using '-Zi' in $(OPTIMIZE) and '-debug
>-opt:ref,icf' for $(LINK_DBG). With this, one gets .pdb
>files corresponding to compiled libraries, which hold the
>symbol information (I had to manually copy perl58.pdb
>[corresponding to perl58.dll] to C:\Perl\bin). The
>Apache/2.0.47 sources have this also enabled for the release
>build, by default, and building mod_perl as 'perl
>Makefile.PL ... MP_DEBUG=1' will enable them in mod_perl as
>well.
>
Sorry, I should have made my question more specific.

I've actually rebuilt Perl and Apache as full debug builds so I have all 
these .pdb files already.  mod_perl gets them too because it inherits 
Perl's "debug build" mode.

My question was where in the DevStudio GUI do you get at the stacktrace 
that you posted, or how do you get DevStudio to dump it out for you?  
All I can find is a "Context" drop-down (in the panel showing variables' 
values) from which I have to manually copy down the information (hence I 
only posted a list of functions!)  It doesn't look like you've done that!

- Steve


Re: [PATCH] Re: mp2 with perl-5.8.1 on Windows

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Mon, 15 Sep 2003, Steve Hay wrote:

> PS.  Randy: How do you that stacktrace output that you've
> posted?  Is that using MSVC++, or something else?

Hi Steve,
  I'm using MSVC++ ... When a problem like this occurs,
an offer is made to call up the VC++ debugger, where
the trace is then done.
  In order to get a more useful trace (with symbol
information), I compiled Perl using some patches to
perl-5.8.x/win32/Makefile that ActiveState introduced
(http://aspn.activestate.com/ASPN/Downloads/ActivePerl/Source).
This patch enables debug symbols in release builds, and
involves using '-Zi' in $(OPTIMIZE) and '-debug
-opt:ref,icf' for $(LINK_DBG). With this, one gets .pdb
files corresponding to compiled libraries, which hold the
symbol information (I had to manually copy perl58.pdb
[corresponding to perl58.dll] to C:\Perl\bin). The
Apache/2.0.47 sources have this also enabled for the release
build, by default, and building mod_perl as 'perl
Makefile.PL ... MP_DEBUG=1' will enable them in mod_perl as
well.

-- 
best regards,
randy

Re: [PATCH] Re: mp2 with perl-5.8.1 on Windows

Posted by Rafael Garcia-Suarez <ra...@hexaflux.com>.
Steve Hay wrote:
> I still haven't found out what the problem with the server crashing on 
> startup is, but the attached patch against CVS seems to fix the 
> fprintf() problem that you refer to.

Your patch passes the current interpreter context to
modperl_hash_seed_init(), and thus the interpreter-wide variables. I
don't see problems with it, but I don't know anything about the mod_perl
2 internals.

I've a minor comment :

> @@ -63,7 +63,8 @@
>          if (s) {
>              int i = atoi(s);
>              if (i == 1) {
> -                fprintf(stderr, "\nmod_perl: using init hash seed: %"UVuf"\n",
> +                PerlIO_printf(PerlIO_stderr(),

When possible, try to use Perl_error_log instead of PerlIO_stderr().
It's equivalent to it, but checks for the availability of STDERR
beforehand. And BTW the trace below should probably be out#defined for
non-debug builds.

> +                	"\nmod_perl: using init hash seed: %"UVuf"\n",
>                          MP_init_hash_seed);
>              }
>          }
> @@ -587,10 +588,12 @@

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


Re: [PATCH] Re: mp2 with perl-5.8.1 on Windows

Posted by Rafael Garcia-Suarez <ra...@hexaflux.com>.
Steve Hay wrote:
> I still haven't found out what the problem with the server crashing on 
> startup is, but the attached patch against CVS seems to fix the 
> fprintf() problem that you refer to.

Your patch passes the current interpreter context to
modperl_hash_seed_init(), and thus the interpreter-wide variables. I
don't see problems with it, but I don't know anything about the mod_perl
2 internals.

I've a minor comment :

> @@ -63,7 +63,8 @@
>          if (s) {
>              int i = atoi(s);
>              if (i == 1) {
> -                fprintf(stderr, "\nmod_perl: using init hash seed: %"UVuf"\n",
> +                PerlIO_printf(PerlIO_stderr(),

When possible, try to use Perl_error_log instead of PerlIO_stderr().
It's equivalent to it, but checks for the availability of STDERR
beforehand. And BTW the trace below should probably be out#defined for
non-debug builds.

> +                	"\nmod_perl: using init hash seed: %"UVuf"\n",
>                          MP_init_hash_seed);
>              }
>          }
> @@ -587,10 +588,12 @@

Re: [PATCH] Re: mp2 with perl-5.8.1 on Windows

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Mon, 15 Sep 2003, Steve Hay wrote:

> PS.  Randy: How do you that stacktrace output that you've
> posted?  Is that using MSVC++, or something else?

Hi Steve,
  I'm using MSVC++ ... When a problem like this occurs,
an offer is made to call up the VC++ debugger, where
the trace is then done.
  In order to get a more useful trace (with symbol
information), I compiled Perl using some patches to
perl-5.8.x/win32/Makefile that ActiveState introduced
(http://aspn.activestate.com/ASPN/Downloads/ActivePerl/Source).
This patch enables debug symbols in release builds, and
involves using '-Zi' in $(OPTIMIZE) and '-debug
-opt:ref,icf' for $(LINK_DBG). With this, one gets .pdb
files corresponding to compiled libraries, which hold the
symbol information (I had to manually copy perl58.pdb
[corresponding to perl58.dll] to C:\Perl\bin). The
Apache/2.0.47 sources have this also enabled for the release
build, by default, and building mod_perl as 'perl
Makefile.PL ... MP_DEBUG=1' will enable them in mod_perl as
well.

-- 
best regards,
randy

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