[Catalyst] Solved - curious Catalyst/DBIx:Class bug

Toby Corkindale tjc at wintrmute.net
Mon May 12 06:26:10 BST 2008


Found and solved an interesting little bug in someone else's application today.

Their unit tests ran fine, but the application itself always died instantly,
with an error from Class::C3::XS.. so they thought the bug was in DBIx::Class,
or rather their use of it, and we spent a lot of time hunting around there..
and it was really annoying me that we just couldn't reproduce the problem
in unit tests though.. just on an actual apache-based server.

Eventually, hit upon the server's startup.pl.. Turns out that inside it was
a (global) $SIG{__DIE__} handler.. Aargh!

They were using this to try and catch fatal errors in their applications..
Except of course these handlers are completely broken and get called by deaths
in eval{} blocks, thus preventing ANY eval{} code from working.. including the
ones in DBIx::Class and Catalyst. *rolls eyes*

I can't believe their major application has NOT hit this problem before!
I just thought I'd mention it, in case anyone else has to debug something where
cat/dbic is mysteriously dieing - grep for __DIE__!

Cheers,
Toby



More information about the Catalyst mailing list