Bug #69442 [NEW]: proc_open with PTY closes incorrect filedescriptor
| From: | jthijssen+php at noxlogic dot nl | Date: | Tue, 14 Apr 2015 08:43:25 +0000 |
| Subject: | Bug #69442 [NEW]: proc_open with PTY closes incorrect filedescriptor | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-192034@lists.php.net to get a copy of this message | ||
From: jthijssen+php at noxlogic dot nl
Operating system: Ubuntu
PHP version: 5.6.8RC1
Package: Program Execution
Bug Type: Bug
Bug description:proc_open with PTY closes incorrect filedescriptor
Description:
------------
proc_open in combination with PTY support (by default disabled and
unconfigurable, but patched by Debian/Ubuntu), will close file the
/dev/ptmx file descriptor AFTER the other file descriptors have been
dup2()'ed. This causes issues when such a file descriptor happens to
have the same file descriptor as the /dev/ptmx one, which happens
often.
This causes some issues in some tests of Symfony2 where I dove into to
find the problem:
https://github.com/symfony/symfony/issues/12643#issuecomment-92279343
Test script:
---------------
Code can be found at:
https://github.com/symfony/symfony/issues/12643#issuecomment-92279343
--
Edit bug report at https://bugs.php.net/bug.php?id=69442&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69442&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69442&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69442&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=69442&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=69442&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=69442&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=69442&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=69442&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=69442&r=support
Expected behavior: https://bugs.php.net/fix.php?id=69442&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=69442&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=69442&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=69442&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69442&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=69442&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=69442&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=69442&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69442&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=69442&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=69442&r=mysqlcfg