X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 	tests=AWL,BAYES_00,SARE_MSGID_LONG40
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <20100309180647.GB3442@sunray.mv.cariden.com>
References: <20100309180647.GB3442@sunray.mv.cariden.com>
Date: Tue, 9 Mar 2010 20:50:38 +0000
Message-ID: <416096c61003091250p186ac05bj8b0b4f7c2b224c85@mail.gmail.com>
Subject: Re: "can't create master tty" errors
From: Andy Koppe <andy.koppe@gmail.com>
To: Cesar Crusius <cesar@cariden.com>, cygwin@cygwin.com
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

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
> =C2=A0 =C2=A0 =C2=A01 [main] env 2748 C:\cygwin\bin\env.exe: *** fatal er=
ror - 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

--
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

