|  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
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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: jthijssen+php at noxlogic dot nl
New email:
PHP Version: OS:


 [2015-04-14 08:43 UTC] jthijssen+php at noxlogic dot nl
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:

Test script:
Code can be found at:


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-06 07:02 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: krakjoe
 [2017-01-06 07:02 UTC]
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

 For Windows:
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Oct 05 02:03:49 2022 UTC