Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Perl Scripts Hang On exit() Being Called

by lamberms (Sexton)
on Mar 07, 2004 at 14:41 UTC ( #334610=perlquestion: print w/replies, xml ) Need Help??
lamberms has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,
I am currently running ActiveState Perl 5.6.1 (635) and the pdk. I have a application that is being used on many machines. The application launches several Perl programs using Win32::Process. On two of the machines I run on, whenever exit() is called, the script hangs and locks up the Command Window. Just running these programs from the command line seems to work but when I call them with Win32::Process and they call exit() they hang with the Command Windows open. Help please. Best Regards,
  • Comment on Perl Scripts Hang On exit() Being Called

Replies are listed 'Best First'.
Re: Perl Scripts Hang On exit() Being Called
by tachyon (Chancellor) on Mar 07, 2004 at 15:07 UTC

    Although it may not be related we had some issues with Perl scripts 'hanging' on exit where we had built really big hashes (GB size). They did *eventually* exit after about 10 minutes! but they were caught up with a malloc bug in an extended hash cleanup. Using POSIX::_exit fixed the issue for us, perhaps it will work for you. Easy to try anyway and it is supported on Win32....

    use POSIX qw[ _exit ]; ... # avoid perl exit which hangs in some circumstances POSIX::_exit(0);



      That does not seem to work. This problem always happens on certain machines every time. It is really weird. One machine is a P4 running XP Pro and the other is a Dual Xeon which has had Win2k installed and XP Pro installed (did not make a difference).
      Best Regards,
Re: Perl Scripts Hang On exit() Being Called
by DaWolf (Curate) on Mar 07, 2004 at 19:45 UTC
    I can't help you specifically on this problem, but let me try to add my little generic 2 cents here:

    By doing steps one and two you should be able to find something that can ***possibly*** be the cause for the problem.
    1. Check what are the differences between the machines that hang and the machines that doesn't.
    2. Check the similarities between the machines that hang. Then check it between the machines that doesn't.
    3. Upgrade ActivePerl, since it's already on version 5.8.3
    Hope it helps a little.

    Best regards,

    my ($author_nickname, $author_email) = ("DaWolf","erabbott\") if ($author_name eq "Er Galvão Abbott");
Re: Perl Scripts Hang On exit() Being Called
by hossman (Prior) on Mar 08, 2004 at 02:44 UTC

    Try replacing your script with this...

    #!perl exit;

    ...if it still hangs on some computers, burn them.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://334610]
Approved by Limbic~Region
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2018-05-27 16:24 GMT
Find Nodes?
    Voting Booth?