Unkillable perl processes in windows XP

Hello,
   I am using perl version   v5.6.1 built for MSWin32-x86-multi-thread on cmd window in windows XP.
When i trying to run a relatively simple perl script
'perl xyz.pl'
And break its execution with Ctrl-C, the follwing happens (not every time, but at 50% of cases)
1) The cmd window seems frozen but can be closed
2) When the cmd window is closed, task manager shows no perl process running
3) When i open another cmd window and execute another or same perl script, the script starts to run and freezes
4) Now i can see perl.exe process running and i can not:
    - Kill the process (after "End process" attempt  by taskmanager,pview,wintasks - process remains and no error message)
    - Kill the cmd window (window remains, no reaction)
    - Shutdown or reboot system (except by reset button :) )
Everything other seems fine, and trying to open new perl script, leaves one more frozen cmd window with one more unkillable perl process.

- How i can kill this process without hardware reboot?
- What i am doing wrong and how i can stop a script without going into the same situation?

Thanks,
      -Dmitry


dmitry1Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

manav_mathurCommented:
I think a better question would be how PERL handles Ctrl+c

Manav
0
rj2Commented:
In my experience the utilty below is able to kill processes that Task Manager can't.

http://www.sysinternals.com/ntw2k/freeware/pskill.shtml
0
inq123Commented:
Hi dmitry1,

I think it has nothing to do with the handling of Ctrl-C.  The reason why you can't kill it is most likely due to hardware access.  Let's assume that your perl script is accessing a disk drive, or some other hardware resource.  While you can shut perl script execution down, you can't immediately interrupt the disk access, which is also most likely the reason why you wanted to terminate your script ('cause the hardware access hung your script).  Second time you launch a script, your script tries to access the same hardware, and it of course hung again because that hardware is still busy.  Only when you do reboot can that hardware be reset and get free again.  Try to find out why the hardware access would hung there, or if the I/O simply has to take that long.  If the hardware simply would hang after the operations in your perl script, then there's nothing you could do.  But if it's just that the operation takes a long time, it's best that you wait till it finish instead of trying to kill the perl script, which could lead to hardware hang.

Cheers!
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

sstoukCommented:
In addition to inq123 I would like to add other possibilities of freezing:
If you access a network resource within your script and the network resource is not available it might also contribute to inability of closing Perl.exe process.

Use pskill.exe from www.Sysinternals.com 
http://www.sysinternals.com/ntw2k/freeware/pstools.shtml

And you can kill  99% of all froze windows (use the force method).
0
inq123Commented:
I think rj2's suggest would most likely enable OP to kill his perl process, but that would not help with the second part of the question as relaunch after pskill would run into the hardware problem again as HW was not reset.  In such situations, a reboot is unavoidable.
0
moduloCommented:
PAQed with no points refunded (of 250)

modulo
Community Support Moderator
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.