You can't test mod_perl modules from the command line, Scott. Only
running under a mod_perl interpreter.
Dooh. I didn't know that. Mine have always worked - I guess I just
have not come across the thing that does not work :-) Until now.
Right, that worked in mod_perl - still seg faults, so here is the
code (short as possible now to still cause the problem) and the
backtrace.
OK Here are the new results...
Some more information:
* perl Makefile.PL MP_DEBUG=1; make && make test - worked with 3 errors
(Note however, that you must manually set environment variable PATH
or Taint check fails)
1&2: t/api/status
3: t/apache/content_length_header.t
* Stack Backtrace
(gdb) bt
#0 0xb7bef73d in modperl_wbucket_flush (wb=0x0, add_flush_bucket=0)
at modperl_filter.c:236
#1 0xb7a7efaf in mpxs_ap_run_sub_req (r=0x84e1708) at
Apache2__SubRequest.h:25
#2 0xb7a7f55b in XS_Apache2__SubRequest_run (cv=0x8351e78) at
SubRequest.xs:83
#3 0xb7b30c68 in Perl_pp_entersub () from /usr/lib/libperl.so.1
* Full version of code that causes the problem (including configuration)
package Zaltana::ExpandTest;
use Apache2::SubRequest ();
use Apache2::Const -compile => qw(OK DECLINED);
use base qw/Apache2::Filter/;
# Usage
# Alias /zx /var/www
# PerlModule Zaltana::ExpandTest
# <Location /zx>
# PerlOutputFilterHandler Zaltana::ExpandTest
# </Location>
sub handler : FilterRequestHandler {
my $f = shift;
unless ($f->ctx) {
$f->r->headers_out->unset('Content-Length');
$f->ctx(1);
}
# Read in all the data the XSL parser requires
while ($f->read(my $buffer, BUFF_LEN)) {
# usually do something with data...
}
if ($f->seen_eos) {
# TEST - Just run the sub request, ignore content
my $subr = $f->r->lookup_uri('/sub.html');
$subr->run();
}
return Apache2::Const::OK;
}
1;
Test Environments:
1. Gentoo running Apache 2.2, mod_perl 2.0.2, Perl 5.8.6
2. Debian Linux running Apache 2.0, mod_perl 2.0.2, Perl 5.8.8
By using both environments above, with different compiles (the Debian
ones are packages, the Gentoo mod_perl and Apache are my own
compiles) it shows me that it is not likely the compile that is the
problem, but the code itself (either mine or mod_perl or apache).
Scott