Subject: bin/3229: pppd sometimes hangs restoring modes
To: None <gnats-bugs@gnats.netbsd.org>
From: Ken Raeburn <raeburn@raeburn.org>
List: netbsd-bugs
Date: 02/18/1997 12:37:40
>Number:         3229
>Category:       bin
>Synopsis:       pppd sometimes hangs restoring modes
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 18 09:50:02 1997
>Last-Modified:
>Originator:     Ken Raeburn
>Organization:
	not much
>Release:        mid-November
>Environment:
	
System: NetBSD kr-pc.cygnus.com 1.2B NetBSD 1.2B (RAEBURN) #1: Sun Nov 17 01:30:47 EST 1996 root@kr-pc.cygnus.com:/h/NetBSD-build/sys/arch/i386/compile/RAEBURN i386


>Description:

Occasionally, very occasionally, pppd will hang on my system.  In the
case that came up today, it had just tried dialing up to the server,
and got lots of garbage back after connecting, probably due to some
server problem:

Feb 18 08:54:53 kr-pc chat[3877]: CONNECT 115200/V.34 16800/NONE^M 
Feb 18 08:54:53 kr-pc chat[3877]: ?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~? 
Feb 18 08:54:53 kr-pc chat[3877]: ^L;^T^Hx~?^N^^^?+)Y~?~?~?~?~?~?~^_N)^_^@Z~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?W`l 
...
Feb 18 08:55:01 kr-pc pppd[3875]: Connect script failed

The pppd process was hung for about half an hour until I noticed it
and sent it a signal.  It then logged a "tcsetattr: Interrupted system
call" message.  Actually, it logged a message I had modified to tell
me specifically that it was the tcsetattr call to restore the old
device state.

This call uses TCSAFLUSH, my guess is that's why it's waiting.  But if
it's waiting to write characters to the modem, and it's in a mode
where it can't write characters because the modem has hung up, maybe
it should be discarding the pending output instead?

Last I looked, this code in pppd hadn't changed from the November
sources I last built from.

>How-To-Repeat:
	No idea.  It usually doesn't happen.  Probably timing sensitive?

	A situation could probably be constructed to test my guess
above, but I'm not familiar enough with tty mode handling to do it off
the top of my head.
>Fix:
	?
>Audit-Trail:
>Unformatted: