[comp.unix.questions] Chat2.pl and pty probs on a SparcII

frechett@spot.Colorado.EDU (-=Runaway Daemon=-) (06/13/91)

Not sure which newsgroup is best here.. 

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.  As a test
I have left 'screen' trying to open a pty or two for several hours 
and it never gets it right.  

I never have this problem on our DEC but unfortunately chat2.pl doesn't 
doesn't work right on the DEC so I am in a bit of a bind.  
Has anyone else had this problem?  
Is it just a Sun problem?
Can it be fixed?  

If there was some way to check the status of the pty or to clear the
status of it or something like that, that would be great... but 
for now, anything that I make is totally unreliable and at best works 
33% of the time.. Any help would be appreciated. Thanks... 

	ian

-=Runaway Daemon=-         (UNIXOPS  University of Colorado at Boulder)

jbw@maverick.uswest.com (Joe Wells) (06/14/91)

In article <1991Jun13.062350.4067@colorado.edu> frechett@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@uswest.com>

trygg@nososl.UUCP (Trygg A. Eliassen) (06/14/91)

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

>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.  As a test
>I have left 'screen' trying to open a pty or two for several hours 
>and it never gets it right.  

This is funny I run screen on the SPARC and have not encountered this 
problem.a screen 2.0a 19-Oct-88 ansi 2.0a

>
>	ian
>
>-=Runaway Daemon=-         (UNIXOPS  University of Colorado at Boulder)

It would have been apropriate with a bit more information about yourself !!!




-- 
Trygg A. Eliassen BSc. Hons | trygg@nordic-offshore.no
Nordic Offshore Systems AS  | mcsun!nuug!nososl!trygg
Stabekk - Oslo - NORWAY     | Tlf +472 12 55 80  Fax +472 12 54 01