On Mon, 2009-02-23 at 15:32 +0100, Clinton Gormley wrote:
> Hiya
> 
> I'm using PerlConfigRequire to load my Perl application, which also sets
> up the VirtualHost's using $r->add_config()
> 
> The problem is, if one my modules has a compile time error, instead of
> getting the real error message, I get something like this:
> 
> ---------------------------------------------------------
> Syntax error on line 266 of /opt/apache/conf/httpd.conf:
> `l\xa6\x02
> ---------------------------------------------------------

Turns out it was my $SIG{__DIE__} handler which was causing the problem.
I added a handler to inflate uncaught errors into an object exception,
so it could give me a nice stack trace.

>From the perlvar POD:

__DIE__ /__WARN__ handlers are very special in one respect: they may be
called to report (probable) errors found by the parser. In such a case
the parser may be in inconsistent state, so any attempt to evaluate Perl
code from such a handler will probably result in a segfault. This means
that warnings or errors that result from parsing Perl should be used
with extreme caution...

So by using:

  local $SIG{__DIE__};

before requiring modules, this issue has been sorted out.

thanks to all who gave advice.

clint

Reply via email to