You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Ronald Dai." <Ro...@proexam.org> on 2007/12/07 21:51:46 UTC

apache mod_perl aborted a process within a eval block without completing it

mod_perl version: 1.27
perl version: 5.6.1
apache version: 1.3.26
 
Question:
We got some 500 server error because an '   eval{...} or die "$@.."   ' block failed.
 
Normally when the eval block failed, the process will die with $@ message logged because of the die statement after the eval block. However, sometimes the process dies without logging the $@ message, which means that the process gets aborted within the eval block.
 
Could someone help me to explain under what circumstances, the mod_perl or apache would abort a process within an eval block without letting the code complete the block?
 
Thanks
Ron

********************************************************************************************************************************************
About PES:  Since 1941, Professional Examination Service (PES) has provided a full range of assessment and advisory services to organizations across a broad range of professions, in support of professional licensure and certification, training, and continuing professional education.  As a mission-driven, not-for-profit organization dedicated to promoting the public welfare through credentialing, PES specializes in the delivery of tailored services that meet the unique needs of each client.  To learn more about PES, visit us online at http://www.proexam.org. 

This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. 

RE: apache mod_perl aborted a process within a eval block without completing it

Posted by "Ronald Dai." <Ro...@proexam.org>.
Perrin:
 
I think there must be something made the apache or mod_perl very unhappy so that it killed the process in the middle.....
 
 
Thanks
Ron
 

________________________________

From: Ronald Dai. [mailto:Ronald@proexam.org]
Sent: Fri 12/7/2007 4:45 PM
To: Perrin Harkins
Cc: modperl@perl.apache.org
Subject: RE: apache mod_perl aborted a process within a eval block without completing it


eval could not catch exit() calls but exit() calls within eval actually won't have the process exit...I just tested it. I am not aware of any $SIG{__DIE__} handler....since in most cases the eval competed normally, I kind suspect that it is mod_perl or apache that is doing something...
 
Thanks
Ron

________________________________

From: pharkins@gmail.com on behalf of Perrin Harkins
Sent: Fri 12/7/2007 4:41 PM
To: Ronald Dai.
Cc: modperl@perl.apache.org
Subject: Re: apache mod_perl aborted a process within a eval block without completing it



On Dec 7, 2007 3:51 PM, Ronald Dai. <Ro...@proexam.org> wrote:
> Could someone help me to explain under what circumstances, the mod_perl or
> apache would abort a process within an eval block without letting the code
> complete the block?

A segfault or an exit().

Your perl is pretty old, so it's possible you're seeing some
long-ago-fixed bug here.  But eval can't catch segfaults or exit()
calls in any perl code.  You could also have a $SIG{__DIE__} handler
somewhere that is intercepting the error and not returning.

- Perrin



RE: apache mod_perl aborted a process within a eval block without completing it

Posted by "Ronald Dai." <Ro...@proexam.org>.
Perrin:
 
I looks you are right....I might have tested something else....;-)
 
Thanks
Ron

________________________________

From: pharkins@gmail.com on behalf of Perrin Harkins
Sent: Fri 12/7/2007 4:53 PM
To: Ronald Dai.
Cc: modperl@perl.apache.org
Subject: Re: apache mod_perl aborted a process within a eval block without completing it



On Dec 7, 2007 4:45 PM, Ronald Dai. <Ro...@proexam.org> wrote:
> eval could not catch exit() calls but exit() calls within eval actually
> won't have the process exit...I just tested it.

You must have tested something else, because exit() does cause a
process to leave an eval block.  Maybe you tried it in a Registry
script?  Those override exit() using the standard perl methods for
overriding CORE:: functions.

This does not print anything:
perl -e 'eval { exit(0); }; print "foo";'

> since in most cases the eval competed normally, I
> kind suspect that it is mod_perl or apache that is doing something...

Well, mod_perl is just perl.  There's nothing different about the
language or the interpreter.

- Perrin



Re: apache mod_perl aborted a process within a eval block without completing it

Posted by Perrin Harkins <pe...@elem.com>.
On Dec 7, 2007 4:45 PM, Ronald Dai. <Ro...@proexam.org> wrote:
> eval could not catch exit() calls but exit() calls within eval actually
> won't have the process exit...I just tested it.

You must have tested something else, because exit() does cause a
process to leave an eval block.  Maybe you tried it in a Registry
script?  Those override exit() using the standard perl methods for
overriding CORE:: functions.

This does not print anything:
perl -e 'eval { exit(0); }; print "foo";'

> since in most cases the eval competed normally, I
> kind suspect that it is mod_perl or apache that is doing something...

Well, mod_perl is just perl.  There's nothing different about the
language or the interpreter.

- Perrin

RE: apache mod_perl aborted a process within a eval block without completing it

Posted by "Ronald Dai." <Ro...@proexam.org>.
eval could not catch exit() calls but exit() calls within eval actually won't have the process exit...I just tested it. I am not aware of any $SIG{__DIE__} handler....since in most cases the eval competed normally, I kind suspect that it is mod_perl or apache that is doing something...
 
Thanks
Ron

________________________________

From: pharkins@gmail.com on behalf of Perrin Harkins
Sent: Fri 12/7/2007 4:41 PM
To: Ronald Dai.
Cc: modperl@perl.apache.org
Subject: Re: apache mod_perl aborted a process within a eval block without completing it



On Dec 7, 2007 3:51 PM, Ronald Dai. <Ro...@proexam.org> wrote:
> Could someone help me to explain under what circumstances, the mod_perl or
> apache would abort a process within an eval block without letting the code
> complete the block?

A segfault or an exit().

Your perl is pretty old, so it's possible you're seeing some
long-ago-fixed bug here.  But eval can't catch segfaults or exit()
calls in any perl code.  You could also have a $SIG{__DIE__} handler
somewhere that is intercepting the error and not returning.

- Perrin



Re: apache mod_perl aborted a process within a eval block without completing it

Posted by Perrin Harkins <pe...@elem.com>.
On Dec 7, 2007 3:51 PM, Ronald Dai. <Ro...@proexam.org> wrote:
> Could someone help me to explain under what circumstances, the mod_perl or
> apache would abort a process within an eval block without letting the code
> complete the block?

A segfault or an exit().

Your perl is pretty old, so it's possible you're seeing some
long-ago-fixed bug here.  But eval can't catch segfaults or exit()
calls in any perl code.  You could also have a $SIG{__DIE__} handler
somewhere that is intercepting the error and not returning.

- Perrin