Control: found -1 1:3.3.4-2

Hi,

The bug in #732410 may be just that ps argues about getting a CONT
signal without being suspended. The following has been posted on the
zsh workers' mailing list today[1].

[1] http://www.zsh.org/cgi-bin/mla/redirect?WORKERNUMBER=32251 

Additionally, I was also able to reproduce it on an amrhf Jessie
installation with procps 1:3.3.4-2 being installed:

!514 Z1 ?0 L2 screen abe@c33:~ (pts/0 zsh 5.0.5 jessie) 22:01:16 
~ → echo `ps | cat`
Signal 18 (CONT) caught by ps (procps-ng version 3.3.4).
ps:display.c:59: please report this bug
PID TTY TIME CMD 24893 pts/0 00:00:01 zsh 25183 pts/0 00:00:03 zsh 25294 pts/0 
00:00:00 zsh 25295 pts/0 00:00:00 ps 25296 pts/0 00:00:00 cat
!515 Z2 ?0 L2 screen abe@c33:~ (pts/0 zsh 5.0.5 jessie) 22:01:30 
~ → 

----- Forwarded message from Bart Schaefer <[email protected]> -----
X-Seq: 32251
From: Bart Schaefer <[email protected]>
Message-id: <[email protected]>
Date: Sun, 12 Jan 2014 20:00:02 -0800
In-reply-to: <[email protected]>
Comments: In reply to Michele Guerini Rocco <[email protected]>
        "Signal 18 (CONT) caught by ps (procps-ng version 3.3.9)" (Jan 12, 
10:59pm)
References: <[email protected]>
To: Michele Guerini Rocco <[email protected]>, [email protected]
Subject: Re: Signal 18 (CONT) caught by ps (procps-ng version 3.3.9)

On Jan 12, 10:59pm, Michele Guerini Rocco wrote:
}
} Executing `ps -ef | wc -l` in a zsh shell script or directly with `echo $(ps 
-ef | wc -l)` will cause this message to appear:
} 
}     Signal 18 (CONT) caught by ps (procps-ng version 3.3.9).
}     ps:display.c:66: please report this bug```

That's rather a strange error message.  Why would it be a bug for ps to
get a CONT signal?

There are cases in which zsh sends a CONT signal to a child process that
*could* be in a stopped state without bothering to check first whether
the child actually *is* stopped.  This should be a completely harmless
no-op for a child that's already running, and I'd say it's more a bug
in ps for complaining about it than it is a bug in zsh for sending it.

The "extraneous" SIGCONT is at line 285 of Src/jobs.c and "git blame" says
it has been there since 2000-04-01, so there is undoubtedly *some* way to
induce it in any version of zsh you're likely to be able to try; but the
circumstances in which that code is called have changed recently, as we
now try to do a more thorough job of tracking child processes for correct
population the $pipestatus array and avoiding race conditions.

Relevant strace:

% schaefer[602] strace -q -f -e trace=kill,process Src/zsh -fc 'echo "$(ps -ef 
| wc -l)"' 
execve("Src/zsh", ["Src/zsh", "-fc", "echo \"$(ps -ef | wc -l)\""], [/* 34 vars 
*/]) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, 
child_tidptr=0xb7eef708) = 9550
[pid  9550] clone(child_stack=0, 
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7eef708) 
= 9551
[pid  9550] clone(child_stack=0, 
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7eef708) 
= 9552
[pid  9551] execve("/bin/ps", ["ps", "-ef"], [/* 34 vars */] <unfinished ...>
[pid  9552] execve("/usr/bin/wc", ["wc", "-l"], [/* 34 vars */] <unfinished ...>
[pid  9551] <... execve resumed> )      = 0
[pid  9552] <... execve resumed> )      = 0
[pid  9551] exit_group(0)               = ?
[pid  9550] --- SIGCHLD (Child exited) @ 0 (0) ---
[pid  9550] wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 
WNOHANG|WSTOPPED|WCONTINUED, {ru_utime={0, 9998}, ru_stime={0, 0}, ...}) = 9551
[pid  9550] wait4(-1, 0xbfeef6c4, WNOHANG|WSTOPPED|WCONTINUED, 0xbfeef64c) = 0
[pid  9550] kill(9551, SIGCONT <unfinished ...>
[pid  9552] exit_group(0)               = ?
[pid  9550] <... kill resumed> )        = -1 ESRCH (No such process)
[pid  9550] kill(9552, SIGCONT)         = 0
[pid  9550] --- SIGCHLD (Child exited) @ 0 (0) ---
[pid  9550] wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 
WNOHANG|WSTOPPED|WCONTINUED, {ru_utime={0, 0}, ru_stime={0, 9998}, ...}) = 9552
[pid  9550] wait4(-1, 0xbfeef6c4, WNOHANG|WSTOPPED|WCONTINUED, 0xbfeef64c) = -1 
ECHILD (No child processes)
[pid  9550] exit_group(0)               = ?
kill(9550, SIG_0)                       = 0
--- SIGCHLD (Child exited) @ 0 (0) ---
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], WNOHANG|WSTOPPED|WCONTINUED, 
{ru_utime={0, 9998}, ru_stime={0, 9998}, ...}) = 9550
wait4(-1, 0xbfeefb24, WNOHANG|WSTOPPED|WCONTINUED, 0xbfeefaac) = -1 ECHILD (No 
child processes)
kill(9550, SIG_0)                       = -1 ESRCH (No such process)
128
exit_group(0)                           = ?

-- 
Barton E. Schaefer
----- End forwarded message -----

HTH.

                Regards, Axel
-- 
 ,''`.  |  Axel Beckert <[email protected]>, http://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE
  `-    |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to