#37367 [Opn->Fbk]: WNOHANG option causes no PID to be returned.
| From: | tony2001@php.net | Date: | Mon, 15 May 2006 21:55:59 +0000 |
| Subject: | #37367 [Opn->Fbk]: WNOHANG option causes no PID to be returned. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-97145@lists.php.net to get a copy of this message | ||
ID: 37367
Updated by: tony2001@php.net
Reported By: doprea at chimesnet dot com
-Status: Open
+Status: Feedback
Bug Type: PCNTL related
Operating System: Fedora 4
PHP Version: 5.1.4
New Comment:
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc.
If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.
Previous Comments:
------------------------------------------------------------------------
[2006-05-08 16:59:55] doprea at chimesnet dot com
Sorry for the multiple posts: There is only one file at that location,
called 'multitiered.php'.
Clearly, I'm losing my mind.
------------------------------------------------------------------------
[2006-05-08 16:58:07] doprea at chimesnet dot com
Please use email address doprea at chimesnet dot com.
------------------------------------------------------------------------
[2006-05-08 16:56:44] doprea@php.net
(email change.)
------------------------------------------------------------------------
[2006-05-08 16:55:22] doprea at chimesnet dot com
Description:
------------
Thanks in advance for helping me to resolve this issue-- It will be a
great help!!
Passing the WNOHANG option will cause pcntl_wait() and pcntl_waitpid()
to never return a PID, but only 0 or -1 (0 before a child returns, and
-1 after). I have tested this under version 5.0.4-10, 5.1.2-5, and
5.1.4, both with and without the --enable-sigchild build option.
Reproduce code:
---------------
ftp://www.redplanet5.net, user= temp@redplanet5.net, pass=
temp.
Expected result:
----------------
It will fork a child from the parent, and then a second child from the
first. If you send a TERM from the shell to the first child, it will
attempt to end the second child, and report whether or not it received
an acceptable wait() response. Just remove the WNOHANG flag and it
works flawlessly.
As written, the WNOHANG option was passed to the pcntl_wait() function,
and the program will report that "there may have been a problem with the
termination of the child."
Actual result:
--------------
If the WNOHANG option is removed, the program says that the child
exited nicely. This should be the case regardless of whether or not the
WNOHANG option was passed.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37367&edit=1