Stas Bekman wrote:[...]
mod_perl 1.99_10 on AIX 5.2 with the IBM vac compiler, using perl 5.8.1 without ithreads, is mostly OK.
Here's the full test output :[...]
$ t/TEST -v modperl/subenv
*** setting ulimit to allow core files
ulimit -c unlimited; t/TEST -v 'modperl/subenv'
consider removing an old /home/garcia/mod_perl-1.99_10/t/core file before running tests
/home/garcia/apache2prefork/bin/httpd -d /home/garcia/mod_perl-1.99_10/t -f /home/garcia/mod_perl-1.99_10/t/conf/httpd.conf -DAPACHE2 using Apache/2.0.47 (prefork MPM)
modperl/subenv....1..16[...]
FAILED tests 14-16
Failed 3/16 tests, 81.25% okay
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
modperl/subenv.t 16 3 18.75% 14-16
*** server localhost:8529 shutdown
!!! error running tests (please examine t/logs/error_log)
!!! oh jeez, server dumped core !!! for stacktrace, run: gdb /home/garcia/apache2prefork/bin/httpd -core /home/garcia/mod_perl-1.99_10/t/core
So it segfaults when calling
$r->subprocess_env(FOO => 1);
at t/response/TestModperl/subenv.pm:34
which goes into C guts at WrapXS/Apache/RequestRec/RequestRec.c
#line 66 "RequestRec.xs" RETVAL = mpxs_Apache__RequestRec_subprocess_env(aTHX_ r, key, val);
#line 117 "RequestRec.c" ST(0) = RETVAL; sv_2mortal(ST(0));
I'd check whether RETVAL is a valid sv. It gets its value from modperl_table_get_set pasted next:
SV *modperl_table_get_set(pTHX_ apr_table_t *table, char *key, SV *sv_val, int do_taint) { SV *retval = &PL_sv_undef;
if (table == NULL) { /* do nothing */ } else if (key == NULL) { retval = modperl_hash_tie(aTHX_ "APR::Table", Nullsv, (void*)table); } else if (!sv_val) { /* no val was passed */ char *val; if ((val = (char *)apr_table_get(table, key))) { retval = newSVpv(val, 0); } else { retval = newSV(0); } if (do_taint) { SvTAINTED_on(retval); } } else if (!SvOK(sv_val)) { /* val was passed in as undef */ apr_table_unset(table, key); } else { apr_table_set(table, key, SvPV_nolen(sv_val)); }
return retval; }
Here's the backtrace :
(dbx) where sig_coredump(sig = 11), line 367 in "prefork.c" Perl_sv_2mortal() at 0xd40bac0c XS_Apache__RequestRec_subprocess_env() at 0xd41fd9fc Perl_pp_entersub() at 0xd4139a48 Perl_runops_standard() at 0xd41356fc S_call_body() at 0xd40c37bc Perl_call_sv() at 0xd40c7614 modperl_callback() at 0xd40a01b0 modperl_callback_run_handlers() at 0xd409fe80 modperl_callback_per_dir() at 0xd409fbcc modperl_response_handler_run() at 0xd409e594 modperl_response_handler() at 0xd409f034 ap_run_handler(0x208065b8), line 194 in "config.c" ap_invoke_handler(0x208065b8), line 401 in "config.c" ap_process_request(0x208065b8), line 288 in "http_request.c" ap_process_http_connection(0x20802670), line 293 in "http_core.c" ap_run_process_connection(0x20802670), line 85 in "connection.c" ap_process_connection(0x20802670, 0x20802598), line 211 in "connection.c" child_main(child_num_arg = 1), line 694 in "prefork.c" unnamed block $b272, line 788 in "prefork.c" make_child(s = 0x20028b80, slot = 1), line 788 in "prefork.c" perform_idle_server_maintenance(p = 0x20026470), line 923 in "prefork.c" unnamed block $b276, line 1118 in "prefork.c" ap_mpm_run(_pconf = 0x20026470, plog = 0x2005e630, s = 0x20028b80), line 1118 in "prefork.c" main(argc = 6, argv = 0x2ff22ac4), line 660 in "main.c"
I'm using httpd 2.0.47.
I suspect some portability nastiness with memory handing of environment variables, but that's just an impression. I may have time to dig further in some future.
I can't reproduce this problem, so if you can debug it that would be great. For the future you probably want to build mod_perl with MP_MAINTAINER=1 and MP_DEBUG=1 so that your stacktrace will show the arguments and line numbers as well. Also throw in MP_TRACE=1, if you ever need to do tracing without invoking debugger. This is of course good only for a non-production server.
__________________________________________________________________ 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]