develooper Front page | perl.perl5.porters | Postings from February 2014

[perl #121230] process group kill on Win32 broken in 5.17.2, regression 5.18

Thread Previous | Thread Next
From:
bulk88 via RT
Date:
February 26, 2014 01:10
Subject:
[perl #121230] process group kill on Win32 broken in 5.17.2, regression 5.18
Message ID:
rt-4.0.18-25391-1393377033-434.121230-15-0@perl.org
On Mon Feb 24 19:23:45 2014, bulk88 wrote:

While writing a test for this, I discovered another bug or issue in Win32 PG kill. PG kill is supposed to return the number of processes "signaled" (is this a synonym for "killed" on Win32 platform?) per perldoc
------------------------------------------------
Sends a signal to a list of processes. Returns the number of processes successfully signaled (which is not necessarily the same as the number actually killed).
-----------------------------------------------

My testing shows the retval in PP of PG kill in 5.12.2 is always 1. 

from win32_kill()
-------------------------------------------
	if (child >= 0) {
            if (my_kill(pid, sig)) {<<<<<<<<<<<<kill count lost
                DWORD exitcode = 0;
                if (GetExitCodeProcess(w32_child_handles[child], &exitcode) &&
                    exitcode != STILL_ACTIVE)
                {
                    remove_dead_process(child);
                }
                return 0;
            }
	}
--------------------------------------------
Perl_apply
--------------------------------------------
	if (val < 0) {
	    val = -val;
	    while (++mark <= sp) {
		I32 proc;
		if (!(SvIOK(*mark) || SvNOK(*mark) || looks_like_number(*mark)))
		    Perl_croak(aTHX_ "Can't kill a non-numeric process ID");
		proc = SvIV(*mark);
		APPLY_TAINT_PROPER();
#ifdef HAS_KILLPG
		if (PerlProc_killpg(proc,val))	/* BSD */ <<<<<<<<<<<<<no way to return kill count, but posix killpg doesn't return process count, just error code
#else
		if (PerlProc_kill(-proc,val))	/* SYSV */
#endif
--------------------------

Is this something to be fixed or it is correct behavior that you can't tell how many processes were in the group from a kill on a PG?

-- 
bulk88 ~ bulk88 at hotmail.com

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=121230

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About