You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Colin Wetherbee <cw...@denterprises.org> on 2007/12/06 03:26:28 UTC

Unqualified segmentation fault from Apache2::Request->new()

Greetings.

I accidentally made the mistake of calling Apache2::Request->new() 
without passing $r, and it turns out that causes Apache to segfault and 
not return anything to the browser.  I'm only pointing this out because 
it seems like there should be a more graceful way of handling this.

### Code
package Test::Handler;

use Apache2::RequestRec;
use Apache2::Const -compile => qw(OK);

sub handler
{
   my ($r) = @_;

   my $req = Apache2::Request->new();

   return Apache2::Const::OK;
}

1;
### End Code

### Log (LogLevel debug)
[Thu Dec 06 02:16:46 2007] [notice] Apache/2.2.3 (Debian) 
mod_apreq2-20051231/2.6.0 mod_perl/2.0.3 Perl/v5.8.8 configured -- 
resuming normal operations
[Thu Dec 06 02:16:46 2007] [info] Server built: Dec  2 2007 18:11:50
[Thu Dec 06 02:16:46 2007] [debug] prefork.c(993): AcceptMutex: sysvsem 
(default: sysvsem)
[Thu Dec 06 02:16:51 2007] [notice] child pid 22461 exit signal 
Segmentation fault (11)
### End Log

Colin

Re: Unqualified segmentation fault from Apache2::Request->new()

Posted by Colin Wetherbee <cw...@denterprises.org>.
Colin Wetherbee wrote:
> use Apache2::RequestRec;
> use Apache2::Const -compile => qw(OK);

To be clear, this also occurs with 'use Apache2::Request' at the top. :)

Colin