php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69442 proc_open with PTY closes incorrect filedescriptor
Submitted: 2015-04-14 08:43 UTC Modified: 2017-01-06 07:02 UTC
Votes:2
Avg. Score:3.5 ± 0.5
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: jthijssen+php at noxlogic dot nl Assigned: krakjoe (profile)
Status: Closed Package: Program Execution
PHP Version: 5.6.8RC1 OS: Ubuntu
Private report: No CVE-ID: None
 [2015-04-14 08:43 UTC] jthijssen+php at noxlogic dot nl
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


Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-06 07:02 UTC] krakjoe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: krakjoe
 [2017-01-06 07:02 UTC] krakjoe@php.net
The fix for this bug has been committed.

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/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 08:01:29 2024 UTC