Re: tty->count(1) != #fd's(2)

Ian Viemeister (
Tue, 04 Mar 1997 11:53:50 -0400

This is definitely a side effect of changing to the new
tty major/minors -- sshd did this for the first time right
after I replaced /dev/tty[p-e][1-f].
Have you also noticed that you start losing tty's?
With every ssh connection (and with some other connections,
but less predicatably), I lose one tty device.
Watch:$ w
4:41pm up 11 days, 20:00, 1 user, load average: 0.00, 0.00, 0.00
ian ttypb nj010c-035.cybe 4:39pm 0.00s 0.14s 0.03s w$

Currently I've lost ttyp0 through ttypa.
Not only that, but every time a process (like telnetd) tries
to allocate a tty, I get one error in syslog for each missing
tty. (same error as below)

I'd try to put a fix together, but I don't really understand
how the kernel handles psuedo-ttys internally.

Ian Viemeister

Doug Ledford <> said:
> On Tue, 25 Feb 1997, Jon Lewis wrote:
> > I got this with 2.0.28 today. I don't remember getting these since very
> > shortly after upgrading to 2.0.x and the new 256 ptys.
> >
> > Feb 24 22:17:14 yoda sshd[17348]: log: Password authentication for flaboy
> > accepted.
> > Feb 24 22:17:16 yoda kernel: Warning: dev (03:b3) tty->count(1) != #fd's(2)
> > in do_tty_hangup
> > Feb 24 22:17:17 yoda sshd[17348]: log: Closing connection to
> I just got this again, and again it's right about the same time as an sshd
> session ending:
> Feb 27 16:51:46 yoda kernel: Warning: dev (03:b4) tty->count(1) !=
> #fd's(2) in do_tty_hangup
> Feb 27 16:51:46 yoda sshd[25049]: log: Closing connection to
> I only have the new tty/pty devices...the old ones were rm'd many months
> ago. It seems to me this must be a kernel bug sshd is exposing. I'm
> using sshd 1.2.17 (ELF) and kernel 2.0.28 on the server.