Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Pathologically Eclectic Rubbish Lister
 
PerlMonks

Perl Scripts Hang On exit() Being Called

by lamberms (Sexton)
 | Log in | Create a new user | The Monastery Gates | Super Search | 
 | Seekers of Perl Wisdom | Meditations | PerlMonks Discussion | 
 | Obfuscation | Reviews | Cool Uses For Perl | Perl News | Q&A | Tutorials | 
 | Poetry | Recent Threads | Newest Nodes | Donate | What's New | 

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,
Mike

Comment on Perl Scripts Hang On exit() Being Called
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);

    cheers

    tachyon

[reply]
[d/l]
      tachyon,
      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,
      Mike
[reply]
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\@terra.com.br") if ($author_name eq "Er Galvão Abbott");
[reply]
Re: Perl Scripts Hang On exit() Being Called
by hossman (Parson) 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.

[reply]
[d/l]

Back to Seekers of Perl Wisdom


Login:
Password
remember me
What's my password?
Create A New User

Node Status
node history
Node Type: perlquestion [id://334610]
Approved by Limbic~Region
help
Community Ads
Chatterbox
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users
Others rifling through the Monastery: (7)
GrandFather
atcroft
herveus
Eyck
gnosti
raisputin
im2
As of 2009-11-21 08:54 GMT
Sections
The Monastery Gates
Seekers of Perl Wisdom
Meditations
PerlMonks Discussion
Categorized Q&A
Tutorials
Obfuscated Code
Perl Poetry
Cool Uses for Perl
Perl News
Information
PerlMonks FAQ
Guide to the Monastery
What's New at PerlMonks
Voting/Experience System
Tutorials
Reviews
Library
Perl FAQs
Other Info Sources
Find Nodes
Nodes You Wrote
Super Search
List Nodes By Users
Newest Nodes
Recently Active Threads
Selected Best Nodes
Best Nodes
Worst Nodes
Saints in our Book
Leftovers
The St. Larry Wall Shrine
Offering Plate
Awards
Craft
Snippets Section
Code Catacombs
Quests
Editor Requests
Buy PerlMonks Gear
PerlMonks Merchandise
Planet Perl
Perlsphere
Use Perl
Perl.com
Perl 5 Wiki
Perl Jobs
Perl Mongers
Perl Directory
Perl documentation
CPAN
Random Node
Voting Booth

Future historians will find that the material characteristic of the current era is...

Aluminium
Plastic
Oil
Water
Carbon dioxide
Copper
Iron
Silicon
Salt
Uranium
Hydrogen
Other

Results (729 votes), past polls