You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Doug MacEachern <do...@covalent.net> on 2001/06/14 07:12:21 UTC

Re: segfault on subrequest?

On Thu, 15 Mar 2001, Pierre Phaneuf wrote:

> 
> I have a PerlTransHandler that is very simple:

the problem is likely that your trans handler is recursing.  try adding
this to prevent recursion:
 
> sub handler {
>   my($r) = @_;

return unless $r->is_main;

>   my($info);
> 
>   $info = $r->lookup_file('/home/pp/pierre.jpg')->content_type();
> 
>   warn("content type is $info\n");
> 
>   return DECLINED;
> }
> 
> But it causes a segfault when invoked... I removed the
> "->content_type()", so that I should normally see something like
> "Apache::SubRequest=SCALAR(0x815eb54)", but it also crashes.
> 
> I tried using the exact same handler as a PerlHandler and as a
> PerlHeaderParserHandler instead, and it works perfectly. I was thinking
> that calling lookup_uri from within a PerlTransHandler might be a bad
> idea (infinite loops!), but I would have thought that lookup_file would
> be ok...
> 
> Okay, maybe everyone will jump in my face about this: this is on an
> updated Red Hat 7.0 system, using Red Hat's Apache and mod_perl RPM
> packages.
> 
>