Page MenuHomePhabricator

phutil_console_get_terminal_width failing intermittently when left to its own devices inside a screen session
Closed, WontfixPublic

Description

I've seen this happen a few times, and was scratching my head a little, initially I thought that surely it was my own code causing a long running process I'd screened to fail every once in a while. As best I can tell, it's always occurring after *arbitrary amount of time has passed* and a call to phutil_console_get_terminal_width is made.

Here's a paste of the output from the most recently failed run:

1[===================- ] 29.8%
2Warning: Destructor threw an object exception: exception 'Exception' with message 'Failed to passthru proc_open(): ' in /home/ubuntu/xhpro/vendor/phacility/libphutil/src/future/exec/PhutilExecPassthru.php:99
3Stack trace:
4#0 /home/ubuntu/xhpro/vendor/phacility/libphutil/src/future/exec/execx.php(50): PhutilExecPassthru->execute()
5#1 /home/ubuntu/xhpro/vendor/phacility/libphutil/src/console/format.php(195): phutil_passthru()
6#2 /home/ubuntu/xhpro/vendor/phacility/libphutil/src/console/PhutilConsoleServer.php(79): phutil_console_get_terminal_width()
7#3 /home/ubuntu/xhpro/vendor/phacility/libphutil/src/console/PhutilConsole.php(204): PhutilConsoleServer->handleMessage()
8#4 /home/ubuntu/xhpro/vendor/phacility/libphutil/src/console/PhutilConsole.php(285): PhutilConsole->writeMessage()
9#5 /home/ubuntu/xhpro/vendor/phacility/libphutil/src/console/PhutilConsoleProgressBar.php(154): PhutilConsole->getErrCols()
10#6 /home/ubuntu/xhpro/vendor/phacility/libphutil/src/console/PhutilConsoleProgressBar.php(146): PhutilConsoleProgressBar->getWidth()
11#7 /home/ubuntu/xhpro/vendor/phacility/libphutil/src/console/PhutilConsoleProgressBar.php(137): PhutilConsoleProgressBar->eraseLine()
12#8 /home/ubuntu/xhpro/vendor/phacility/libphutil/src/console/PhutilConsoleProgressBar.php(159): PhutilConsoleProgressBar->done()
13#9 /home/ubuntu/xhpro/src/xhpro/application/runs/management/XHProRunsImportWorkflow.php(67): PhutilConsoleProgressBar->__destruct()
14#10 /home/ubuntu/xhpro/vendor/phacility/libphutil/src/parser/argument/PhutilArgumentParser.php(394): XHProRunsImportWorkflow->execute()
15#11 /home/ubuntu/xhpro/vendor/phacility/libphutil/src/parser/argument/PhutilArgumentParser.php(290): PhutilArgumentParser->parseWorkflowsFull()
16#12 /home/ubuntu/xhpro/scripts/runs/manage_runs.php(21): PhutilArgumentParser->parseWorkflows()
17#13 {main} in /home/ubuntu/xhpro/src/xhpro/application/runs/management/XHProRunsImportWorkflow.php on line 67
18
19Fatal error: Uncaught exception 'Exception' with message 'Failed to passthru proc_open(): ' in /home/ubuntu/xhpro/vendor/phacility/libphutil/src/future/exec/PhutilExecPassthru.php:99
20Stack trace:
21#0 /home/ubuntu/xhpro/vendor/phacility/libphutil/src/future/exec/execx.php(50): PhutilExecPassthru->execute()
22#1 /home/ubuntu/xhpro/vendor/phacility/libphutil/src/console/format.php(195): phutil_passthru()
23#2 /home/ubuntu/xhpro/vendor/phacility/libphutil/src/console/PhutilConsoleServer.php(79): phutil_console_get_terminal_width()
24#3 /home/ubuntu/xhpro/vendor/phacility/libphutil/src/console/PhutilConsole.php(204): PhutilConsoleServer->handleMessage()
25#4 /home/ubuntu/xhpro/vendor/phacility/libphutil/src/console/PhutilConsole.php(285): PhutilConsole->writeMessage()
26#5 /home/ubuntu/xhpro/vendor/phacility/libphutil/src/console/PhutilConsoleProgressBar.php(154): PhutilConsole->getErrCols()
27#6 /home/ubuntu/xhpro/vendor/phacility/libphutil/src/console/PhutilConsoleProgressBar.php(99): PhutilConsoleProgressBar->getWidth()
28#7 /home/ubuntu/xhpro/vendor/phacility/libphutil/src/console/PhutilConsoleProgressBar.php(64): PhutilConsoleProgressBar->redraw()
29#8 /home/ubuntu/xhpro/src/xhpro/application/runs/management/XHProRunsImportWorkflow.php(63): PhutilConsoleProgressBar->update()
30#9 /home/ubuntu/xhpro/vendor/phacility/libphutil/src/parser/argument/PhutilArgumentParser.php(394): XHProRunsImportWorkflow->execute()
31#10 /home/ubuntu/xhpro/vendor/phacility/libphutil/src/parser/argument/PhutilArgumentParser.php(290): PhutilArgumentParser->parseWorkflowsFull()
32#11 /home/ubuntu/xhpro/scripts/runs/manage_runs.php(21): PhutilArgumentParser->parseWorkflows()
33#12 {main}

I realize that the parameters surrounding when and how this fails might not make it incredibly easy to track this down. If it's immediately obvious to someone from Phacility why this might be occurring, I'm all ears.

Revisions and Commits

Related Objects

Event Timeline

yelirekim raised the priority of this task from to Needs Triage.
yelirekim updated the task description. (Show Details)
yelirekim added a project: libphutil.
yelirekim added a subscriber: yelirekim.
chad claimed this task.

Unfortunately nothing comes to mind, and without a repro case, it's a bit of a fishing expedition on our side (and not likely worth the time). Feel free to reopen with more details if you can build something consistent.

https://secure.phabricator.com/book/phabcontrib/article/bug_reports/#unreproducible-problems