Edit report at https://bugs.php.net/bug.php?id=61873&edit=1
ID: 61873
User updated by: dcb at insomniacsoft dot com
Reported by: dcb at insomniacsoft dot com
Summary: proc_get_status always returns exitcode -1
-Status: Feedback
+Status: Open
Type: Bug
Package: Program Execution
Operating System: Linux
PHP Version: 5.4.1
Block user comment: N
Private report: N
New Comment:
Still getting -1 for /bin/ls as well
I did the strace, here is output, unfortunately I have no idea how to interpret
it:
[pid 26199] execve("/bin/sh", ["sh", "-c", "/tmp/te"], [/* 19 vars */]
<unfinished
...>
[pid 26200] execve("/tmp/te", ["/tmp/te"], [/* 19 vars */]) = 0
[pid 26200] open("/tmp/te", O_RDONLY) = 3
write(1, "/tmp/te", 7/tmp/te) = 7
Previous Comments:
------------------------------------------------------------------------
[2012-04-29 06:36:21] phpmpan at mpan dot pl
Maybe strace shows something interesting?
strace -f php -r '$descriptorspec = array(
0 => array("pipe", "r"),
1 => array("pipe", "w"),
2 => array("file", "/tmp/error-output.txt", "a")
);
$p = proc_open("/tmp/te", $descriptorspec, $pipes, "/tmp");
sleep(1);
fclose($pipes[0]);fclose($pipes[1]);
$s = proc_get_status($p);
print_r($s);' 2>&1 | grep '/tmp/te'
------------------------------------------------------------------------
[2012-04-29 03:51:46] [email protected]
what about call "/bin/ls" instead of /tmp/te?
------------------------------------------------------------------------
[2012-04-29 00:18:47] dcb at insomniacsoft dot com
I've checked that, the script executes fine and besides I actually discovered
the
issue while working with the symfony/Process classes. On php 5.3.6 all the
tests
pass, but on the same machine, with the same config (just different paths) all
versions starting from 5.4.0 fail the symfony/Process unit tests related to the
exit code.
------------------------------------------------------------------------
[2012-04-28 14:22:18] reeze dot xia at gmail dot com
I can't reproduce it either. Any error log in /tmp/error-output.txt?
maybe /tmp/te did't have execution permission?
------------------------------------------------------------------------
[2012-04-28 11:30:29] dcb at insomniacsoft dot com
I forgot to mention that on the same machines php 5.3 gives the expected
results.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=61873
--
Edit this bug report at https://bugs.php.net/bug.php?id=61873&edit=1