php.net |  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
Votes:2
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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: kshukri at empirica-delasasse dot de
New email:
PHP Version: OS:

 

 [2004-04-14 11:57 UTC] kshukri at empirica-delasasse dot de
Description:
------------
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) {
		ExitTest($c,$stat);
	}
}

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



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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-14 22:31 UTC] sniper@php.net
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] iliaa@php.net
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: Sun Apr 21 08:01:27 2024 UTC