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
bulk88 via RT
February 26, 2014 01:10
[perl #121230] process group kill on Win32 broken in 5.17.2, regression 5.18
Message ID:
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)
                return 0;
	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);
		if (PerlProc_killpg(proc,val))	/* BSD */ <<<<<<<<<<<<<no way to return kill count, but posix killpg doesn't return process count, just error code
		if (PerlProc_kill(-proc,val))	/* SYSV */

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

via perlbug:  queue: perl5 status: open

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About