This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_subprocess failure on OpenBSD/NetBSD buildbots
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.2, Python 3.3, Python 3.4, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: neologix, python-dev, trent
Priority: low Keywords: buildbot, needs review, patch

Created on 2012-12-24 10:23 by neologix, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
kill_esrch.diff neologix, 2012-12-24 10:28 review
Messages (2)
msg178045 - (view) Author: Charles-François Natali (neologix) * (Python committer) Date: 2012-12-24 10:23
test_subprocess fails on OpenBSD/NetBSD buildbots:
http://buildbot.python.org/all/builders/AMD64 NetBSD 5.1.2 [SB] 2.7/builds/158/steps/test/logs/stdio
"""

======================================================================
ERROR: test_kill_dead (test.test_subprocess.POSIXProcessTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/cpython/buildslave/2.7.snakebite-netbsd51-amd64-1/build/Lib/test/test_subprocess.py", line 940, in test_kill_dead
    self._kill_dead_process('kill')
  File "/home/cpython/buildslave/2.7.snakebite-netbsd51-amd64-1/build/Lib/test/test_subprocess.py", line 913, in _kill_dead_process
    getattr(p, method)(*args)
  File "/home/cpython/buildslave/2.7.snakebite-netbsd51-amd64-1/build/Lib/subprocess.py", line 1506, in kill
    self.send_signal(signal.SIGKILL)
  File "/home/cpython/buildslave/2.7.snakebite-netbsd51-amd64-1/build/Lib/subprocess.py", line 1496, in send_signal
    os.kill(self.pid, sig)
OSError: [Errno 3] No such process

======================================================================
ERROR: test_send_signal_dead (test.test_subprocess.POSIXProcessTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/cpython/buildslave/2.7.snakebite-netbsd51-amd64-1/build/Lib/test/test_subprocess.py", line 936, in test_send_signal_dead
    self._kill_dead_process('send_signal', signal.SIGINT)
  File "/home/cpython/buildslave/2.7.snakebite-netbsd51-amd64-1/build/Lib/test/test_subprocess.py", line 913, in _kill_dead_process
    getattr(p, method)(*args)
  File "/home/cpython/buildslave/2.7.snakebite-netbsd51-amd64-1/build/Lib/subprocess.py", line 1496, in send_signal
    os.kill(self.pid, sig)
OSError: [Errno 3] No such process

======================================================================
ERROR: test_terminate_dead (test.test_subprocess.POSIXProcessTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/cpython/buildslave/2.7.snakebite-netbsd51-amd64-1/build/Lib/test/test_subprocess.py", line 944, in test_terminate_dead
    self._kill_dead_process('terminate')
  File "/home/cpython/buildslave/2.7.snakebite-netbsd51-amd64-1/build/Lib/test/test_subprocess.py", line 913, in _kill_dead_process
    getattr(p, method)(*args)
  File "/home/cpython/buildslave/2.7.snakebite-netbsd51-amd64-1/build/Lib/subprocess.py", line 1501, in terminate
    self.send_signal(signal.SIGTERM)
  File "/home/cpython/buildslave/2.7.snakebite-netbsd51-amd64-1/build/Lib/subprocess.py", line 1496, in send_signal
    os.kill(self.pid, sig)
OSError: [Errno 3] No such process
"""

According to POSIX, kill shoudln't fail with ESRCH on a zombie processes:
"""
Existing implementations vary on the result of a kill() with pid indicating an inactive process (a terminated process that has not been waited for by its parent). Some indicate success on such a call (subject to permission checking), while others give an error of [ESRCH]. Since the definition of process lifetime in this volume of POSIX.1-2008 covers inactive processes, the [ESRCH] error as described is inappropriate in this case. In particular, this means that an application cannot have a parent process check for termination of a particular child with kill(). (Usually this is done with the null signal; this can be done reliably with waitpid().)
"""
msg179818 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-01-12 15:56
New changeset 61d6b34af419 by Charles-François Natali in branch '2.7':
Issue #16762: Fix some test_subprocess failures on NetBSD and OpenBSD: kill()
http://hg.python.org/cpython/rev/61d6b34af419

New changeset 58ce6ac61ada by Charles-François Natali in branch '3.2':
Issue #16762: Fix some test_subprocess failures on NetBSD and OpenBSD: kill()
http://hg.python.org/cpython/rev/58ce6ac61ada

New changeset a3f0414af55b by Charles-François Natali in branch '3.3':
Issue #16762: Fix some test_subprocess failures on NetBSD and OpenBSD: kill()
http://hg.python.org/cpython/rev/a3f0414af55b

New changeset 487ed428f0ba by Charles-François Natali in branch 'default':
Issue #16762: Fix some test_subprocess failures on NetBSD and OpenBSD: kill()
http://hg.python.org/cpython/rev/487ed428f0ba
History
Date User Action Args
2022-04-11 14:57:39adminsetgithub: 60966
2013-01-12 15:57:31neologixsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2013-01-12 15:56:23python-devsetnosy: + python-dev
messages: + msg179818
2013-01-05 12:46:39trentsetnosy: + trent
2012-12-24 10:28:37neologixsetfiles: + kill_esrch.diff
2012-12-24 10:23:54neologixcreate