On Fri, 12 Sep 2003, 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.
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'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?
--- mod_perl.c.orig 2003-09-11 19:10:39.000000000 +0100 +++ mod_perl.c 2003-09-15 12:00:30.273019100 +0100 @@ -22,7 +22,7 @@ #endif /* see modperl_hash_seed_set() */ -static void modperl_hash_seed_init(apr_pool_t *p) +static void modperl_hash_seed_init(pTHX_ apr_pool_t *p) { #ifdef MP_NEED_HASH_SEED_FIXUP char *s; @@ -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(), + "\nmod_perl: using init hash seed: %"UVuf"\n", MP_init_hash_seed); } } @@ -587,10 +588,12 @@ int modperl_hook_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp) { + dTHX; + /* we can't have PerlPreConfigHandler without first configuring mod_perl */ /* perl 5.8.1+ */ - modperl_hash_seed_init(p); + modperl_hash_seed_init(aTHX_ p); return OK; }