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() ?
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 825
Download (untitled) / with headers
text/plain 825b
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
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-18812-1303849038-1148.67774-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 312
Download (untitled) / with headers
text/plain 312b
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
From jand [...] activestate.com Tue Apr 26 16: 29:49 2011
MIME-Version: 1.0
X-Spam-Status: No, score=-4.883 tagged_above=-99.9 required=10 tests=[AWL=1.352, BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_SOFTFAIL=0.665] autolearn=ham
In-Reply-To: <rt-3.8.HEAD-18807-1303848053-1271.67774-4-0 [...] rt.cpan.org>
X-Mailer: Microsoft Outlook 14.0
X-Spam-Flag: NO
References: <RT-Ticket-67774 [...] rt.cpan.org> <rt-3.8.HEAD-18807-1303848053-1271.67774-4-0 [...] rt.cpan.org>
Content-Language: en-us
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <027901cc0450$ac51f990$04f5ecb0$ [...] activestate.com>
Content-Type: text/plain; charset="UTF-8"
Organization: ActiveState Software Inc
X-RT-Original-Encoding: utf-8
X-Spam-Score: -4.883
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id C4B55241939 for <cpan-bug+Win32-Process [...] hipster.bestpractical.com>; Tue, 26 Apr 2011 16:29:49 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RVTVF3IRa2NC for <cpan-bug+Win32-Process [...] hipster.bestpractical.com>; Tue, 26 Apr 2011 16:29:47 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 6A6AB2417C2 for <bug-Win32-Process [...] rt.cpan.org>; Tue, 26 Apr 2011 16:29:47 -0400 (EDT)
Received: (qmail 21760 invoked by uid 103); 26 Apr 2011 20:29:46 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 26 Apr 2011 20:29:46 -0000
Received: from mx.activestate.com (HELO mx.activestate.com) (204.244.102.3) by 16.mx.develooper.com (qpsmtpd/0.80/v0.80-19-gf52d165) with ESMTP; Tue, 26 Apr 2011 13:29:44 -0700
Received: from box5.activestate.com (box25.activestate.com [192.168.69.70]) by mx.activestate.com (Postfix) with ESMTP id 642E32000C for <bug-Win32-Process [...] rt.cpan.org>; Tue, 26 Apr 2011 13:29:42 -0700 (PDT)
Received: from UNIQUE (dhcp-29.activestate.com [192.168.69.29]) by box5.activestate.com (Postfix) with ESMTP id 25A43B828A for <bug-Win32-Process [...] rt.cpan.org>; Tue, 26 Apr 2011 13:29:42 -0700 (PDT)
Delivered-To: cpan-bug+Win32-Process [...] hipster.bestpractical.com
Subject: RE: [rt.cpan.org #67774] A safer alternative to TerminateProcess() ?
Return-Path: <jand [...] activestate.com>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: cpan-bug+Win32-Process [...] hipster.bestpractical.com
X-RT-Mail-Extension: win32-process
Thread-Index: AQHK39vs01tiTydvHcpnEqVZxz8VgAEzOG4hlGlFKvA=
Date: Tue, 26 Apr 2011 13:29:41 -0700
X-Spam-Level:
To: <bug-Win32-Process [...] rt.cpan.org>
Content-Transfer-Encoding: 7bit
From: "Jan Dubois" <jand [...] activestate.com>
RT-Message-ID: <rt-3.8.HEAD-18810-1303849790-447.67774-0-0 [...] rt.cpan.org>
Content-Length: 1166
Download (untitled) / with headers
text/plain 1.1k
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


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.