Stas Bekman wrote:
Steve, Randy, please try the current cvs (just cvs up + make, no need to rebuild from scratch). I have finally been able to solve the segfault with the short config Steve presented. I hope that it solves the problem for you as well. If it does, please try again with the vhost patch that was failing before.
I moved quite a few things in mod_perl.c, but the only real change was adding:
+#ifdef USE_ITHREADS
+ /* after other parent perls were started in vhosts, make sure that
+ * the context is set to the base_perl */
+ PERL_SET_CONTEXT(base_perl);
+#endif
after setting up vhosts, without which, PerlLoadModule in the main server was segfaulting for me.
The bad news: The vhost tests still fail as before :(
I'll try to cut down the conf file to the minimum that still crashes, and post a full trace then.
Here's a minimal conf file which still fails when running "perl t/TEST -start" (or even "C:\apache2\bin\Apache.exe -t -d C:/Temp/modperl-2.0/t -f C:/Temp/modperl-2.0/t/conf/httpd.conf -DAPACHE2 -DPERL_USEITHREADS"):
===== LoadModule perl_module C:\Temp\modperl-2.0\src\modules\perl\mod_perl.so ServerName localhost:8529 Listen 8529 ServerRoot C:/Temp/modperl-2.0/t DocumentRoot C:/Temp/modperl-2.0/t/htdocs LogLevel debug Listen 8530 <VirtualHost _default_:8530> PerlOptions +Parent <Perl > 1; </Perl> </VirtualHost> =====
Here's the stack trace:
=====
VMem::Free(void * 0x0093122c) line 208 + 3 bytes
CPerlHost::Free(void * 0x0093122c) line 59 + 34 bytes
PerlMemFree(IPerlMem * 0x00262434, void * 0x0093122c) line 302
Perl_safesysfree(void * 0x0093122c) line 143 + 26 bytes
Perl_av_extend(interpreter * 0x0092c12c, av * 0x0092cefc, long 4) line 135 + 14 bytes
Perl_av_store(interpreter * 0x0092c12c, av * 0x0092cefc, long 4, sv * 0x0095a9b4) line 315 + 17 bytes
Perl_av_push(interpreter * 0x0092c12c, av * 0x0092cefc, sv * 0x0095a9b4) line 542 + 29 bytes
Perl_newPMOP(interpreter * 0x0092c12c, long 31, long 0) line 2650 + 65 bytes
S_scan_pat(interpreter * 0x0092c12c, char * 0x00958012, long 31) line 6353 + 15 bytes
Perl_yylex(interpreter * 0x0092c12c) line 3613 + 15 bytes
Perl_yyparse(interpreter * 0x0092c12c) line 1470 + 9 bytes
S_doeval(interpreter * 0x0092c12c, int 0, op * * 0x00000000, cv * 0x00000000, unsigned long 19) line 2802 + 9 bytes
Perl_pp_require(interpreter * 0x0092c12c) line 3298 + 102 bytes
modperl_pp_require(interpreter * 0x0092c12c) line 54 + 10 bytes
Perl_runops_debug(interpreter * 0x0092c12c) line 1434 + 13 bytes
S_call_body(interpreter * 0x0092c12c, op * 0x0006f0b4, int 0) line 2193 + 13 bytes
Perl_call_sv(interpreter * 0x0092c12c, sv * 0x0094a01c, long 6) line 2111 + 15 bytes
S_call_list_body(interpreter * 0x0092c12c, cv * 0x0094a01c) line 4361 + 15 bytes
Perl_call_list(interpreter * 0x0092c12c, long 11, av * 0x00949f8c) line 4290 + 13 bytes
Perl_newATTRSUB(interpreter * 0x0092c12c, long 501, op * 0x0094dc04, op * 0x00000000, op * 0x00000000, op * 0x0094dc24) line 4365 + 23 bytes
Perl_utilize(interpreter * 0x0092c12c, int 1, long 501, op * 0x00000000, op * 0x0093fb38, op * 0x0093fb1c) line 2983 + 173 bytes
Perl_yyparse(interpreter * 0x0092c12c) line 414 + 44 bytes
S_doeval(interpreter * 0x0092c12c, int 0, op * * 0x00000000, cv * 0x00000000, unsigned long 17) line 2802 + 9 bytes
Perl_pp_require(interpreter * 0x0092c12c) line 3298 + 102 bytes
modperl_pp_require(interpreter * 0x0092c12c) line 54 + 10 bytes
Perl_runops_debug(interpreter * 0x0092c12c) line 1434 + 13 bytes
S_call_body(interpreter * 0x0092c12c, op * 0x0006f600, int 0) line 2193 + 13 bytes
Perl_call_sv(interpreter * 0x0092c12c, sv * 0x00942720, long 6) line 2111 + 15 bytes
S_call_list_body(interpreter * 0x0092c12c, cv * 0x00942720) line 4361 + 15 bytes
Perl_call_list(interpreter * 0x0092c12c, long 5, av * 0x009426f0) line 4290 + 13 bytes
Perl_newATTRSUB(interpreter * 0x0092c12c, long 292, op * 0x0093fc7c, op * 0x00000000, op * 0x00000000, op * 0x0093fc9c) line 4365 + 23 bytes
Perl_utilize(interpreter * 0x0092c12c, int 1, long 292, op * 0x00000000, op * 0x0093fe78, op * 0x0093fe14) line 2983 + 173 bytes
Perl_yyparse(interpreter * 0x0092c12c) line 414 + 44 bytes
S_doeval(interpreter * 0x0092c12c, int 0, op * * 0x00000000, cv * 0x00000000, unsigned long 2) line 2802 + 9 bytes
Perl_pp_require(interpreter * 0x0092c12c) line 3298 + 102 bytes
modperl_pp_require(interpreter * 0x0092c12c) line 54 + 10 bytes
Perl_runops_debug(interpreter * 0x0092c12c) line 1434 + 13 bytes
S_call_body(interpreter * 0x0092c12c, op * 0x0006faf8, int 1) line 2193 + 13 bytes
Perl_eval_sv(interpreter * 0x0092c12c, sv * 0x00942624, long 2) line 2253 + 15 bytes
modperl_require_module(interpreter * 0x0092c12c, const char * 0x00851470, int 0) line 13 + 15 bytes
modperl_mgv_resolve(interpreter * 0x0092c12c, modperl_handler_t * 0x00851518, apr_pool_t * 0x0028a9f8, const char * 0x00851470, int 0) line 267 + 15 bytes
modperl_handler_resolve(interpreter * 0x0092c12c, modperl_handler_t * * 0x0006fcb8, apr_pool_t * 0x0028a9f8, server_rec * 0x00850670) line 61 + 26 bytes
modperl_callback(interpreter * 0x0092c12c, modperl_handler_t * 0x00851518, apr_pool_t * 0x0028a9f8, request_rec * 0x00000000, server_rec * 0x00850670, av * 0x0092d124) line 11 + 21 bytes
modperl_cmd_perldo(cmd_parms_struct * 0x0006fec8, void * 0x008509e8, const char * 0x008514f8) line 427 + 27 bytes
invoke_cmd(const command_struct * 0x10025110, cmd_parms_struct * 0x0006fec8, void * 0x008509e8, const char * 0x00850428) line 713 + 18 bytes
ap_walk_config_sub(const ap_directive_t * 0x00850430, cmd_parms_struct * 0x0006fec8, ap_conf_vector_t * 0x00850848) line 1082 + 24 bytes
ap_walk_config(ap_directive_t * 0x00850430, cmd_parms_struct * 0x0006fec8, ap_conf_vector_t * 0x00850848) line 1121 + 17 bytes
virtualhost_section(cmd_parms_struct * 0x0006fec8, void * 0x0082cbc8, const char * 0x00850660) line 1974 + 26 bytes
invoke_cmd(const command_struct * 0x6ff356a8, cmd_parms_struct * 0x0006fec8, void * 0x0082cbc8, const char * 0x00850270) line 713 + 18 bytes
ap_walk_config_sub(const ap_directive_t * 0x00850250, cmd_parms_struct * 0x0006fec8, ap_conf_vector_t * 0x0082caa8) line 1082 + 24 bytes
ap_walk_config(ap_directive_t * 0x00850250, cmd_parms_struct * 0x0006fec8, ap_conf_vector_t * 0x0082caa8) line 1121 + 17 bytes
ap_process_config_tree(server_rec * 0x0082c4d8, ap_directive_t * 0x00850008, apr_pool_t * 0x0028a9f8, apr_pool_t * 0x0084c550) line 1594 + 20 bytes
main(int 8, const char * const * 0x00282918) line 582
mainCRTStartup() line 338 + 17 bytes
KERNEL32! 77e814c7()
=====
and here's the output from MOD_PERL_TRACE=cdghimos:
=====
C:\Temp\modperl-2.0>C:\apache2\bin\Apache.exe -t -d C:/Temp/modperl-2.0/t -f C:/
Temp/modperl-2.0/t/conf/httpd.conf -DAPACHE2 -DPERL_USEITHREADS
mod_perl trace flags dump:
c On (configuration for directive handlers)
d On (directive processing)
e Off (environment variables)
f Off (filters)
g On (Perl runtime interaction)
h On (handlers)
i On (interpreter pool management)
m On (memory allocations)
o On (I/O)
s On (perl sections)
t Off (benchmark-ish timings)
mod_perl.c:522: mod_perl globals are configured
modperl_global.c:88: init pconf
modperl_global.c:88: init threaded_mpm
modperl_global.c:88: init server_rec
modperl_config.c:187: p=0x28aa60, s=0x82c4d8, virtual=0
modperl_config.c:137: 0x84fd38
modperl_config.c:137: 0x8509e8
modperl_config.c:121: 0x850ca8
modperl_config.c:187: p=0x28aa60, s=0x850670, virtual=1
modperl_cmd.c:257: arg = +Parent
MpSrv flags dump (localhost):
Clone Off
Parent Off
Enable On
Autoload Off
MergeHandlers Off
Authz On
Authen On
PostConfig On
ChildExit On
OutputFilter On
Response On
Log On
PostReadRequest On
OpenLogs On
PreConnection On
MapToStorage On
ProcessConnection On
ChildInit On
Fixup On
HeaderParser On
InputFilter On
Type On
Trans On
Cleanup On
Access On
Unset On
mod_perl.c:235: starting the parent perl for the base server
modperl_config_srv_argv_init =>
0 = Apache.exe
1 = -e;0
modperl_interp.c:232: server=localhost:8529
modperl_interp.c:107: 0x925b40
mod_perl.c:304: constructed interpreter=0x2643ec
mod_perl.c:355: Init vhost (null):8530: s=0x850670, base_s=0x82c4d8
MpSrv flags dump ((null)):
Clone Off
Parent On
Enable On
Autoload Off
MergeHandlers Off
Authz On
Authen On
PostConfig On
ChildExit On
OutputFilter On
Response On
Log On
PostReadRequest On
OpenLogs On
PreConnection On
MapToStorage On
ProcessConnection On
ChildInit On
Fixup On
HeaderParser On
InputFilter On
Type On
Trans On
Cleanup On
Access On
Unset On
mod_perl.c:239: starting the parent perl for vhost (null):8530
modperl_config_srv_argv_init =>
0 = Apache.exe
1 = -e;0
modperl_interp.c:232: server=(null):8530
modperl_interp.c:107: 0x93c520
mod_perl.c:304: constructed interpreter=0x92c24c
mod_perl.c:394: created parent interpreter for VirtualHost (null):8530
mod_perl.c:355: Init vhost (null):8530: s=0x850670, base_s=0x82c4d8
mod_perl.c:375: server (null):8530 already initialized
modperl_handler.c:23: [3824/1936] new handler Apache::PerlSections
modperl_util.c:160: sv_setref_pv(Apache::CmdParms, 0x6fec8)
modperl_handler.c:75: dup handler Apache::PerlSections
modperl_handler.c:23: [3824/1936] new handler Apache::PerlSections
MpHandler flags dump (Apache::PerlSections):
Parsed Off
Method Off
Object Off
Anon Off
Autoload Off
Dynamic Off
Fake Off
modperl_handler.c:52: [3824/1936 (null):8530] handler Apache::PerlSections was not compiled at startup, attempting to resolve using current pool 0x28aa60
modperl_mgv.c:264: package Apache::PerlSections not defined, attempting to load
Free to wrong pool 262770 not 925938. =====
This short conf file is OK if I remove the "+Parent" line.
I can also "fix" it by removing the <Perl >...</Perl> section, but trying the same trick with the full vhost test setup (commenting out the appropriate add_config() call from t/htdocs/vhost/startup.pl) doesn't fix that :(
I notice that the <Perl >...</Perl> section in that startup.pl file is commented "this used to have problems on win32". Looks like it still does?
I also notice that the short conf file gives this syntax error if I change the <Perl > to <Perl>:
Syntax error on line 10 of C:/Temp/modperl-2.0/t/conf/httpd.conf: <Perl> directive missing closing '>'
- Steve
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]