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.

Author sable
Recipients sable
Date 2011-02-17.15:19:37
SpamBayes Score 4.777234e-12
Marked as misclassified No
Message-id <>
This issue already existed on Python 2.5.2 with AIX 5.2:

The documentation for WNOHANG says:
The option for waitpid() to return immediately if no child process status is available immediately. The function returns (0, 0) in this case.

It seems wait4 always returns 0 on AIX when WNOHANG is specified.

Removing WNOHANG will make the test succeed.

waitpid does not have the same limitation.

I suppose this is a bug of AIX, though there is not even a man page to describe wait4 on this platform.

Here is a proposition for a patch that will workaround this bug...

Index: Lib/test/
--- Lib/test/      (revision 88430)
+++ Lib/test/      (working copy)
@@ -3,6 +3,7 @@
 import os
 import time
+import sys
 from test.fork_wait import ForkWait
 from import run_unittest, reap_children, get_attribute
@@ -13,10 +14,14 @@
 class Wait4Test(ForkWait):
     def wait_impl(self, cpid):
+        option = os.WNOHANG
+        if sys.platform.startswith('aix'):
+            # wait4 is broken on AIX and will always return 0 with WNOHANG
+            option = 0
         for i in range(10):
             # wait4() shouldn't hang, but some of the buildbots seem to hang
             # in the forking tests.  This is an attempt to fix the problem.
-            spid, status, rusage = os.wait4(cpid, os.WNOHANG)
+            spid, status, rusage = os.wait4(cpid, option)
             if spid == cpid:
Date User Action Args
2011-02-17 15:19:38sablesetrecipients: + sable
2011-02-17 15:19:37sablesetmessageid: <>
2011-02-17 15:19:37sablelinkissue11185 messages
2011-02-17 15:19:37sablecreate