Chat2.pl and pty probs on a SparcII

Joe Wells jbw at maverick.uswest.com
Fri Jun 14 09:04:23 AEST 1991


In article <1991Jun13.062350.4067 at colorado.edu> frechett at spot.Colorado.EDU (-=Runaway Daemon=-) writes:

   I am finally getting the hang of chat2.pl and doing some fun little 
   stuff and after much frustrating banging, thinking that my code was 
   messed up, I realized that it was the ptys that were hanging on the
   Sparc I am using, or to be more precise, it in the process of opening 
   a pty it hangs.  I shouldn't have been surprised when I found this 
   out as I run 'screen' all the time and it also hangs.  Ussually
   I go to open a new pty and it locks up.. so I kill that window
   and then try again, and after a few times, it might work. ...

This is a POSIX problem, and SunOS is moving towards POSIX compatibility.
We were getting a lot of hung rlogins because of this at cs.bu.edu.  The
most likely cause is this: The master side of the pty pair is not held
open by any process, so the pty pair appears to be free.  However, some
process on the system has the slave side of the pty pair as its
controlling terminal.  (I think the process also has to be a session
leader, but I don't remember.)  Due to POSIX semantics that I don't
understand at all, this causes the open of the slave side to hang.  Find
the process that has that pty pair as its controlling terminal (easily
determinable with ps) and kill it ruthlessly.  The guilty process will be
a process that should have *no* controlling terminal (eg. started by rsh).

-- 
Enjoy,

Joe Wells <jbw at uswest.com>



More information about the Comp.unix.questions mailing list