Re: Out of ptys

Richard B. Johnson (root@chaos.analogic.com)
Tue, 25 Aug 1998 22:53:57 -0400 (EDT)


On Tue, 25 Aug 1998, david wrote:

> Reply to mail from Richard B. Johnson about Out of ptys
> -----------------
> > Don't you love the way these replies start! Always with "wrong" or "no".
> > The "program" to which you refer is telnetd. The ioctls failed because
> > there were no open fds 1 or 2, yet an open returned 3. Telnetd failed
> > because this was unexpected behavior.
>
> if your telnetd is started from inetd, then your stdin/stdout are the
> socket pairs handed by inetd iirc.
>

Yes. But it's even worse than that! The method that I used to show
the "out-pf-ptys" problem causes an additional problem. The two
fds were supposed to be closed, actualy dup2ed to a virtual terminal
so the TCGETS ioctl would work.

What I did was create a daemon on a private port that did....

`strace telnetd`

Strace does its output on stderr and also seems to keep stdout open
(I didn't look at the source). This prevents telnet from working as
advertised so the output from strace is invalid for normal operation.

However the fact remains that doing nothing to my SMP machine except
changing the kernel to 2.1.115 from 2.1.108 causes the out-of-ptys
problem. I did run the new MAKEDEV that was distributed. I do have
lots of ptys, etc.

When the problem occurs, this is an interesting trace...
open("/dev/tty", O_RDWR) = -1 ENXIO (No such device or address)
Interactively, I can open this device 1021 times (1024 fds default).

Cheers,
Dick Johnson
***** FILE SYSTEM WAS MODIFIED *****
Penguin : Linux version 2.1.115 on an i586 machine (66.15 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html