From:             [EMAIL PROTECTED]
Operating system: Fedora 4
PHP version:      5.1.4
PHP Bug Type:     PCNTL related
Bug description:  WNOHANG option causes no PID to be returned.

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= [EMAIL PROTECTED], 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 bug report at http://bugs.php.net/?id=37367&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=37367&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=37367&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=37367&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=37367&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=37367&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=37367&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=37367&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=37367&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=37367&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=37367&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=37367&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=37367&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=37367&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=37367&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=37367&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=37367&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=37367&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=37367&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=37367&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=37367&r=mysqlcfg

Reply via email to