Page MenuHomePhabricator

Find another workaround for the "dumb terminal" warnings which doesn't hang
Closed, ResolvedPublic


I fixed the VCS "dumb terminal" warnings on some systems by adding TERM=dumb to commit_hook.php, but this also caused some systems to hang. The change was reverted; we should find a different approach which solves the problem without the hang.

Original Report

(Also reported on github), just wanted to include some more here)

Since 541664956c77 (to which we just updated) pushing to a mercurial repo hangs. It seems to be due to TERM=dumb, but I couldn't immediately find a reason.

I do have a process trace of what happens server-side, but it doesn't immediately seem useful - it's as if the server process is in a loop of some kind. See P1715. The client-side process is just waiting for a response, and doesn't seem to do anything.

Event Timeline

richardvanvelzen assigned this task to epriestley.
richardvanvelzen raised the priority of this task from to High.
richardvanvelzen updated the task description. (Show Details)
richardvanvelzen added a project: Mercurial.
richardvanvelzen added a subscriber: richardvanvelzen.

Are you deploying this on an EC2 AMI, by chance? I haven't been able to reproduce this on any system, and it seems like the kind of thing I'm going to need to debug by, e.g., rebuilding PHP.

I'm not sure what to make of that trace, definitely looks bizarre.

No, this a private server in an internal network. For some context, here a some of the version number that seem relevant:


-> php -v
PHP 5.4.4-14+deb7u5 (cli) (built: Oct 3 2013 09:24:58)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies


-> hg --version
Mercurial Distributed SCM (version 3.1.2)


-> sudo sshd -?
unknown option -- ?
OpenSSH_6.6.1p1 Debian-4~bpo70+1, OpenSSL 1.0.1e 11 Feb 2013


-> uname -a
Linux *.*.* 3.16.0-0.bpo.4-amd64 #1 SMP Debian 3.16.7-ckt2-1~bpo70+1 (2014-12-08) x86_64 GNU/Linux

I'm not sure if that's useful, but it might give some way of narrowing down where to search for. If there's anything I can provide to make this easier to track down, let me know.

Alright. Since this is report #3 and it doesn't look like a repro is forthcoming without a lot of work, I'm just going to remove TERM=dumb and suffer the warnings for now.

Same issue here, with pretty much the same trace. It seems to never actually execute anything from the script itself.

I'm running this inside a few Docker containers so it should be easy to reproduce it on your side. I'll get an image ready and comment back.

Turns out this might be just a limitation of shebangs. From the manpage of the execve call, regarding the shebang as #! interpreter [optional-arg]:

The semantics of the optional-arg argument of an interpreter script
vary across implementations.  On Linux, the entire string following
the  interpreter  name is passed as a single argument to the inter‐
preter, and this string can include white space.  However, behavior
differs  on  some  other systems.  Some systems use the first white
space to terminate optional-arg.  On some systems,  an  interpreter
script  can  have multiple arguments, and white spaces in optional-
arg are used to delimit the arguments.

yes. It's not related to php. Even this bash script hangs on my system:
$ cat /tmp/
#!/usr/bin/env TERM=dumb bash
echo "hello world"

epriestley renamed this task from Pushing to mercurial repo hangs to Find another workaround for the "dumb terminal" warnings which doesn't hang.Feb 5 2015, 12:49 PM
epriestley lowered the priority of this task from High to Wishlist.
epriestley updated the task description. (Show Details)

@cspeckmim, can you and/or other users experiencing this issue confirm that D12182 fixes it without causing hangs?


  • Apply D12182.
  • Run bin/repository update CALLSIGN to make sure the new hook gets written.
  • Push to the repository.

It seems to fix things on my end, but I was never able to reproduce the original hangs.

I was not experiencing hangs, but was seeing the additional "dumb terminal" output on my local client.

  1. I downloaded the diff and applied it to my local phabricator install
  2. I restarted all services
  3. I ran bin/repository update CALLSIGN
  4. I pushed changes to the repository

There was no additional output related to "dumb terminal", and the process did not hang.