in reply to Disappearing fatal errors and die() with mod_perl2

It looks/sounds to me like the die handler i.e. $SIG{__DIE__}, might be/is being modified in/by the Foo constructor - which is, IMO, why your changes in the use'ing code have no effect and undef'ing the object clears the problem.

I would suggest either:

Then i.e having done either/both of the above, come back and ask again (by updating your node) - with any luck and a following wind, by that time, you might even have identified the problem for yourself.

A user level that continues to overstate my experience :-))

Replies are listed 'Best First'.
Re^2: Disappearing fatal errors and die() with mod_perl2
by Farenji (Novice) on Jul 31, 2009 at 16:59 UTC

    Thanks for your reply. I got so far that a messed up/redefined die handler could be the problem. It's still one of my main hypotheses. But I cannot explain why:

    • (locally) re-defining/resetting the die handler using $SIG{__DIE__} does not solve the issue - it should if that's the problem, shouldnt it?
    • the issue only occurs under mod_perl, not in CLI or with CGI. That suggests the problem could be outside my code.

    Of course I did my share of eliminating / commenting out parts, got me a bit further, but it takes LONG as there's hundreds of modules, many thousands line of code to go through. I haven't stop looking yet and will continue my quest for the solution, but I was hoping someone else encountered a similar issue before.

      ...(locally) re-defining/resetting the die handler using $SIG{__DIE__} does not solve the issue... : nor would it - consider tst.pl and Foo.pm defined as:
      #! /usr/bin/env perl use warnings; use strict; use Foo; die "Died here";
      package Foo; local $SIG{__DIE__} = sub { print "Caught in " . __PACKAGE }; sub _die { die }; 1;
      When run, tst.pl produces
      $> perl tst.pl Died here at tst.pl line 7.
      As expected ... by me anyway, since the handler has only been locally re-defined at the lower-level i.e. in the scope of Foo, leaving the handler unchanged at the upper/calling level.

      As to your latter question, sadly, I have no experience with mod_perl, so I'm afraid, have nothing to contribute :-((

      A user level that continues to overstate my experience :-))