#27993 [NEW]: pcntl_waitpid with WNOHANG | WUNTRACED same as WNOHANG

From: Date: Wed, 14 Apr 2004 15:57:22 +0000
Subject: #27993 [NEW]: pcntl_waitpid with WNOHANG | WUNTRACED same as WNOHANG
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-58129@lists.php.net to get a copy of this message
From: kshukri at empirica-delasasse dot de Operating system: debian 3.0 with linux 2.4.24 PHP version: 4.3.4 PHP Bug Type: POSIX related Bug description: pcntl_waitpid with WNOHANG | WUNTRACED same as WNOHANG 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 -- Edit bug report at http://bugs.php.net/?id=27993&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27993&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27993&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=27993&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=27993&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=27993&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=27993&r=needscript Try newer version: http://bugs.php.net/fix.php?id=27993&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=27993&r=support Expected behavior: http://bugs.php.net/fix.php?id=27993&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=27993&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=27993&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=27993&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27993&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=27993&r=dst IIS Stability: http://bugs.php.net/fix.php?id=27993&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=27993&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=27993&r=float

« previous php.bugs (#58129) next »