|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
20 - 16 = ?
Subscribe to this entry?

 [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-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 15 15:01:29 2024 UTC