ID:               21077
 Comment by:       webmaster at ragnarokonline dot de
 Reported By:      [EMAIL PROTECTED]
 Status:           Closed
 Bug Type:         Filesystem function related
 Operating System: any BSD
 PHP Version:      4CVS-2002-12-18 (dev)
 Assigned To:      wez
 New Comment:

It looks like, the bug has returned.

the test hangs on 
TEST_PHP_EXECUTABLE=sapi/cli/php \
sapi/cli/php -n run-tests.php \
ext/standard/tests/file/proc_open01.phpt


Previous Comments:
------------------------------------------------------------------------

[2003-02-26 15:56:09] jlondon at mail dot mcg dot edu

proc_open hangs on the example that is in the manual.  Here is the
code.

$descriptorspec = array(
   0 => array("pipe", "r"),  // stdin is a pipe that the child will
read from
   1 => array("pipe", "w"),  // stdout is a pipe that the child will
write to
   2 => array("file", "c:/temp/error-output.txt", "a"), // stderr is a
file to write to
);
$process = proc_open("c:\php\php.exe", $descriptorspec, $pipes);
if (is_resource($process)) {
    // $pipes now looks like this:
    // 0 => writeable handle connected to child stdin
    // 1 => readable handle connected to child stdout
    // Any error output will be appended to /tmp/error-output.txt

    fwrite($pipes[0], "<?php echo \"Hello World!\"; ?>" . chr(3));
    fclose($pipes[0]);

    while(!feof($pipes[1])) {
        echo fgets($pipes[1], 1024);
    }
    fclose($pipes[1]);
    // It is important that you close any pipes before calling
    // proc_close in order to avoid a deadlock
    $return_value = proc_close($process);

    echo "command returned $return_value\n";
}

I'm running NT4 Server/PHP4.3.2.2/IIS4.  This bit of code opened up 54
php.exe/cmd.exe (that's 54 of each or 108 total) processes on my
machine.

------------------------------------------------------------------------

[2002-12-19 14:36:12] [EMAIL PROTECTED]

This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.



------------------------------------------------------------------------

[2002-12-18 08:50:25] [EMAIL PROTECTED]

assigning and marking on request

------------------------------------------------------------------------

[2002-12-18 08:49:40] [EMAIL PROTECTED]

proc_open test in the testsuite fails.

Seems that proc_close fails now (returns -1).

Patch rev 1.85/1.86 on exec.c and related files triggered the bug.

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=21077&edit=1

Reply via email to