sub ModPerl::Test::exit_handler {
my($p, $s) = @_; $s->log->info("Child process pid=$$ is exiting");
}which didn't return a value. It actually did return a value via the last call to info(), which according to XS should return XSRETURN_EMPTY, which for some reason left some SV on the stack, which was recognized by Devel::Peek as Undef but it wasn't really &PL_sv_undef. Other than checking why XSRETURN_EMPTY returned a value at all (which is unrelated to mod_perl), it just shows that a handler can return absolutely anything, when there is no explicit status return, so any guessing on our part won't be much of help. I think the generated warning is a good solution, but the problem is that it doesn't show where does it happen, since we have left the scope of the callback by the time we retrieve the value off-the stack. Perl_sv_2iv calls:
void
Perl_report_uninit(pTHX)
{
if (PL_op)
Perl_warner(aTHX_ packWARN(WARN_UNINITIALIZED), PL_warn_uninit,
" in ", OP_DESC(PL_op));
else
Perl_warner(aTHX_ packWARN(WARN_UNINITIALIZED), PL_warn_uninit, "", "");
}and since PL_op is not defined, it just prints a dummy warnings, with no pointers. If could fake PL_op to point to that handler that was just executed, it'll will tell the exact location of the warning. So "all" we have to figure out is how to fake that PL_op thingy...
Another solution would be to rip-off the logic from Perl_sv_2iv (there are 3 places where it calls report_uninit, and provide a custom warning message, but there is quite a lot of logic to duplicate, which is executed anyway.
Finally we could try to temprorary override the PL_warn_uninit format string to provide a custom error message. may be that will be the easiest thing to do.
I'll post later if I come up with some nice solution.
__________________________________________________________________ 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]
