Subject: kern/13002: ucom hangs in TIOCSETAW changing baud rate
To: None <>
From: John Hawkinson <>
List: netbsd-bugs
Date: 05/21/2001 21:38:15
>Number:         13002
>Category:       kern
>Synopsis:       ucom hangs in TIOCSETAW changing baud rate
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 21 18:42:00 PDT 2001
>Originator:     John Hawkinson
>Release:        -current of 1 May 2001
System: NetBSD 1.5U NetBSD 1.5U (ZORKMID-$Revision: 1.10 $) #103: Mon May 21 21:10:47 EDT 2001 i386

	cu hangs when trying to connect to /dev/ttyU0, my new
USB serial adapter. It only hangs when I try to change the baud rate.
If I ^C it and try again, then it works fine at the given baud rate.

zorkmid# cu -l /dev/ttyU0 -9600
^Ccu: Got interrupt signal
cu: Can't change terminal settings: Interrupted system call
zorkmid# cu -l /dev/ttyU0 -9600

ktrace-ing the hang, we find ourselves stuck in a TIOCSETAW:
   321 cu       RET   ioctl -1 errno 1 Operation not permitted
   321 cu       CALL  ioctl(0x3,TIOCSETA,0x806f054)
   321 cu       RET   ioctl 0
   321 cu       CALL  ioctl(0x3,TIOCSETAW,0x806f054)

t/t in ddb reports:

db> trace: pid 321 at 0xc6ecdcb8
bpendtsleep(c6428280,11a,c044c09a,0,0) at bpendtsleep
ttysleep(c6428238,c6428280,11a,c044c09a,0) at ttysleep+0x22
ttywait(c6428238,802c7415,ffffffff,c6428238,1fff) at ttywait+0x5f
ttioctl(c6428238,802c7415,c6ecded8,7,c6ea9c88) at ttioctl+0x5ee
ucom_do_ioctl(c086ea00,802c7415,c6ecded8,7,c6ea9c88) at ucom_do_ioctl+0x74
ucomioctl(4200,802c7415,c6ecded8,7,c6ea9c88) at ucomioctl+0x3d
spec_ioctl(c6ecddec,c6c94bd0,c6e0eac8,c6ea9c88,c044da80) at spec_ioctl+0x42
VOP_IOCTL(c6e0eac8,802c7415,c6ecded8,7,c08a0300) at VOP_IOCTL+0x46
vn_ioctl(c6c94bd0,802c7415,c6ecded8,c6ea9c88,c6ecdf88) at vn_ioctl+0xae
sys_ioctl(c6ea9c88,c6ecdf88,c6ecdf80,480fe89c,806f054) at sys_ioctl+0x31d
syscall_fancy(1f,1f,0,806f054,bfbfd434) at syscall_fancy+0xcb

I don't have a lot more time to debug this.

	workaround: ^C cu and try again.