|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27993 pcntl_waitpid with WNOHANG | WUNTRACED same as WNOHANG
Submitted: 2004-04-14 11:57 UTC Modified: 2004-04-21 00:12 UTC
Avg. Score:2.5 ± 0.5
Reproduced:0 of 0 (0.0%)
From: kshukri at empirica-delasasse dot de Assigned:
Status: No Feedback Package: POSIX related
PHP Version: 4.3.4 OS: debian 3.0 with linux 2.4.24
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
50 + 45 = ?
Subscribe to this entry?

 [2004-04-14 11:57 UTC] kshukri at empirica-delasasse dot de
pcntl_waitpid with option WNOHANG | WUNTRACED behaves just like WNOHANG alone, that means it never returns PID of children that have exited before. 
This could be a bug in Linux too. 
Please excuse me if I just don't understand the way  pcntl_waitpid should work.
Here's my php config:
./configure --with-apxs --with-config-file-path=/usr/local/lib --with-zlib --enable-ftp --enable-calendar --enable-track-vars --with-pgsql --with-unixodbc --with-mysql --enable-sigchild --enable-pcntl --with-gd --enable-cli --with-snmp --enable-ucd-snmp-hack  --with-openssl --enable-sockets --prefix=/usr/local/stow/php-4.3.4 --with-curl

Reproduce code:
function CheckExited () {
	while (($c=pcntl_waitpid(-1, $stat, WUNTRACED | WNOHANG))>0) {

function ExitTest($c,$stat) { blabla..;}
while ($condition) {
 $CHILD_PID = pcntl_fork();

Expected result:
pcntl_waitpid(...WNOHANG|WUNTRACED) should return PIDs of all children that have exited  since the last call of CheckExited(). 

Actual result:
pcntl_waitpid(...WNOHANG|WUNTRACED) doesn't return any PIDs


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-14 22:31 UTC]
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 avoid embedding huge scripts into the report.

 [2004-04-21 00:12 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 20:01:31 2024 UTC