Bug #71804 [Opn]: proc_close does not return exit code

From: Date: Thu, 17 Mar 2016 16:12:47 +0000
Subject: Bug #71804 [Opn]: proc_close does not return exit code
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-199897@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71804&edit=1

 ID:                 71804
 User updated by:    mark at mpen dot ca
 Reported by:        mark at mpen dot ca
 Summary:            proc_close does not return exit code
 Status:             Open
 Type:               Bug
 Package:            Program Execution
 Operating System:   Ubuntu 14.10
 PHP Version:        7.0.4
 Block user comment: N
 Private report:     N

 New Comment:

Not sure how to attach files; it wouldn't let me submit them as patches. I've uploaded
them to pastebin:

- PHP 5.6 strace: http://pastebin.com/SNuJGAZW
- PHp 7.0.4 strace: http://pastebin.com/akrFjzpT


Previous Comments:
------------------------------------------------------------------------
[2016-03-15 04:22:56] as@php.net

Having trouble reproducing. Can you attach strace output for 5.6 and 7? Invoke like:

    $ strace -ttt -T -f -s1024 -o strace.log php test.php

Thanks.

------------------------------------------------------------------------
[2016-03-11 19:00:30] mark at mpen dot ca

Description:
------------
proc_close always return exit code -1 on PHP 7 when it should be 0 (as it does on PHP 5.6).

$ php7 --version
PHP 7.0.4 (cli) (built: Mar 11 2016 10:54:16) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies


Compiled with:

./configure  --with-openssl --with-layout=GNU --with-pear --enable-ftp --with-mysqli=mysqlnd
--with-pdo-mysql=mysqlnd --enable-session --enable-libxml --enable-xml --with-zlib=yes
--enable-mbstring=all --with-gettext --with-pspell --with-gd --enable-gd-native-ttf
--with-freetype-dir=/usr/local/lib/ --with-jpeg-dir=/usr/local/lib/ --enable-sockets --enable-pcntl
--enable-sigchild --with-mcrypt=/usr/local/lib --enable-posix --enable-dom --enable-simplexml
--with-readline --enable-bcmath 


Test script:
---------------
<?php
$proc = proc_open("pwd",[1=>['pipe','w']], $pipes);
var_dump(stream_get_contents($pipes[1]));
fclose($pipes[1]);
var_dump(proc_close($proc));


Expected result:
----------------
Exit code 0

Actual result:
--------------
Exit code -1


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



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


Thread (7 messages)

« previous php.bugs (#199897) next »