Subject: Re: ptys are not always freed
To: None <current-users@NetBSD.ORG>
From: Greg A. Woods <woods@kuma.web.net>
List: current-users
Date: 01/24/1998 21:50:37
[ On Mon, January 19, 1998 at 15:39:19 (-0500), der Mouse wrote: ]
> Subject: Re: ptys are not always freed
>
> Regardless of what pine does or doesn't do, it should not be possible
> for user-land to hold onto a pty in such a way as to produce the
> symptoms described.  If it is it's a bug.  (Pine may also be buggy if
> it doesn't die correctly, but that doesn't excuse the pty driver not
> doing the right thing - either completely revoking access to the slave
> side, or refusing to allow the master to be reopened until the slave is
> irrevocably released by user-land.)

I've noticed this problem on various operating systems (most or all
with at least their networking based on *BSD).  NetBSD recently seems to
be exceptionally prone to this behaviour.

I came across an intesting and possibly related item in Stevens'
Advanced Programming in the UNIX Environment the other day while looking
for information about undocumented accept(2) return codes.  In his
exampe on page 504 he verifies that the inode times associated with the
socket are no older than 30 seconds, and if they are he fails the
connection with no other justification than the comment "the i-node is
too old".

I'm wondering if this hack might work with stale pty's too.

Indeed though there does seem to be something quirky with the pty
driver....

-- 
							Greg A. Woods

+1 416 443-1734			VE3TCP			robohack!woods
Planix, Inc. <woods@planix.com>; Secrets Of The Weird <woods@weird.com>