Skip Menu |

This queue is for tickets about the Win32-Process CPAN distribution.

Report information
The Basics
Id: 67774
Status: open
Priority: 0/
Queue: Win32-Process

People
Owner: Nobody in particular
Requestors: APOCAL [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: A safer alternative to TerminateProcess() ?
Hello, I was browsing the interwebs and found this page. http://drdobbs.com/windows/184416547?pgno=1 I noticed that various CPAN smokers sometimes gets "wedged" on win32 because they attempt to kill the smoking process and in turn, it wedges the Perl DLL. While I have encountered this a few times, others have said it happens with regularity. I thought this would be a good workaround, and is willing to help add this functionality to the module. What do you think? If it was to be added, it should be called something like Win32::Process::SafeKillProcess() and $ProcessObj->SafeKill(); If this is a viable concept and if we can get it to work, I'll be very happy and will prod the various CPAN toolchain authors to use it on MSWin32 so we have a safer smoking environment :) Thanks again! -- ~Apocalypse
David Golden told me that he did some "pre-alpha" work on it here: https://github.com/dagolden/win32-process-safeterminate <@xdg> I wouldn't even describe it as "alpha" -- it was an experiment. I don't even remember how well it was working. But it's a starting point for someone. Big kudos! -- ~Apocalypse
Subject: RE: [rt.cpan.org #67774] A safer alternative to TerminateProcess() ?
Date: Tue, 26 Apr 2011 13:29:41 -0700
To: <bug-Win32-Process [...] rt.cpan.org>
From: "Jan Dubois" <jand [...] activestate.com>
On Tue, 26 Apr 2011, Apocalypse via RT wrote: Show quoted text
> I was browsing the interwebs and found this page. > > http://drdobbs.com/windows/184416547?pgno=1 > > I noticed that various CPAN smokers sometimes gets "wedged" on win32 > because they attempt to kill the smoking process and in turn, it wedges > the Perl DLL. While I have encountered this a few times, others have > said it happens with regularity.
What does "wedged" mean here? I assume it means that the process somehow got stuck and couldn't actually get killed? In that case I don't think using SafeKillProcess() will help at all, as it makes it *less* likely that the killing will actually succeed. As MSDN says (under the ExitProcess documentation): | Therefore, if you do not know the state of all threads in your | process, it is better to call TerminateProcess than ExitProcess." So I would really like to see an actual example where SafeKillProcess() solves a problem before adding a (potentially useless) API to it. BTW, I'm especially interested in what "in turn, it wedges the Perl DLL" means. How do you detect this wedging, and what are the negative side effects of it? Cheers, -Jan