delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/03/09/16:12:51

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
Date: Tue, 9 Mar 2010 13:12:40 -0800
From: Cesar Crusius <cesar AT cariden DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: "can't create master tty" errors
Message-ID: <20100309211240.GC3442@sunray.mv.cariden.com>
Reply-To: Cesar Crusius <cesar AT cariden DOT com>
References: <20100309180647 DOT GB3442 AT sunray DOT mv DOT cariden DOT com> <416096c61003091250p186ac05bj8b0b4f7c2b224c85 AT mail DOT gmail DOT com>
MIME-Version: 1.0
In-Reply-To: <416096c61003091250p186ac05bj8b0b4f7c2b224c85@mail.gmail.com>
User-Agent: Mutt/1.5.19 (2009-01-05)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Tue, Mar 09, 2010 at 08:50:38PM +0000, Andy Koppe wrote:
> Cesar Crusius:
> > I am using Cygwin and SSH to do automated remote builds using Visual
> > C++. It works for a few days, but invariably things start failing with
> > messages like these (this one from a build log):
> >
> > Makefile:9: MakePID: 5964
> >      1 [main] env 2748 C:\cygwin\bin\env.exe: *** fatal error - can't create master tty
> 
> The number of tty devices is limited, so the first thing to check is
> whether your build system simply leaves too many sessions open, by
> checking the output of 'ps'.
> 
> If not, it might be to do with the following. If you open a couple of
> terminals, they're assigned  tty0 and tty1. If you then close tty1 and
> open another terminal, that again becomes tty1. But if you close tty0,
> and open yet another one, that becomes tty2 rather than tty0.
> 
> That appears to be the general rule: a new terminal gets the next ID
> above the current highest one. This means, however, that if opening
> and closing of terminal sessions is interleaved in certain ways,
> Cygwin might eventually run out of terminal IDs, even if only few of
> them are actually used. High numbers in the TTY column of the 'ps'
> output would point to that.
> 
> Cgf, am I talking rubbish here?
> 
> Andy
> 

There are never many processes running at a time by the build system
account (or any other account). If the second option really describes
the algorithm, then it is probably what is happening, and why it takes a
few days for the problem to manifest itself.

I'm trying to reproduce it, though, and here's what I am getting

ssh me AT build -> exit -> ssh build AT build -> exit -> ...

This loop always gives me SSH_TTY=/dev/tty0, so it seems tty0 is getting
reused. (ps -eaW currently reports max(TTY)=2).

If I ssh as two users at the same time, one got tty0, the other tty3.
Still, exiting and ssh'ing back again still gives me tty0...

- Cesar

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019