[Lxr-dev] $SIG{__DIE__} considered harmful in a mod-perl environment?
Brought to you by:
ajlittoz
From: Jens-Uwe M. <ju...@he...> - 2001-09-28 14:07:30
|
I have been chasing a strange error in my installation for a while that I finally nailed down today. Occasionally users did mention to me that they see strange error messages in their HTML pages that do mention they are generated by LXR even though they are not on any page that is generated by LXR. I do use also HTML::Embperl and other perl modules so most of the pages do use some perl in any case, and I found that some pages use eval statements to check for availability of modules. If LXR happened to run once in that particular httpd then the problem occurs that LXR happens to issue error messages for failing eval statements even though it is not really associated to these. This happens as mod-perl does implement a shared interpreter for all the scripts, and some of the interpreter resources are shared across all scripts loaded into mod-perl. In particular here the problem is httpinit in LXR::Common.pm, which does modify (pseudo) signal handlers: sub httpinit { $SIG{__WARN__} = \&warning; $SIG{__DIE__} = \&fatal; These are shared across all scripts and thus fatal or warning gets called even though LXR is not processing a request currently. Would it be possible to get around without setting these signal handlers? Looking into the mod-perl mailing list archive it looks like this usage is considered harmful in the mod-perl environment. -- Jens-Uwe Mager HELIOS Software GmbH Steinriede 3 30827 Garbsen Germany Phone: +49 5131 709320 FAX: +49 5131 709325 Internet: ju...@he... |