Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 348
  • Last Modified:

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


0
dmitry1
Asked:
dmitry1
1 Solution
 
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now