console freeze

Emmanuel Dreyfus <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <[email protected]>
Hello

I have one machine that freeze the serial console after a few seconds
of running userland. It happens on 10.0/amd64 but not on 10.0/i386 nor
on 9.3/amd64 (tested with INSTALL kernels).

Once it get frozen, the kernel is still able to output messages, and
the machines quietly carry on booting. It executes /etc/rc to its end, 
which lets me connect through SSH, and then the sh processes running
/etc/rc wait forever:

PID PPID WCHAN  COMMAND
214    1 wait  sh /etc/rc autoboot
223  214 ttyout sh /etc/rc autoboot

It is not possible to reach ddb, but crash can give us the backtrace
of PID 223:
trace: pid 223 lid 223 at 0xffffaa00ae8f2b50
sleepq_block() at sleepq_block+0x13a
cv_timedwait_sig() at cv_timedwait_sig+0xc6
ttysleep() at ttysleep+0x50
ttwrite() at ttwrite+0x96
cdev_write() at cdev_write+0x87
cdev_write() at cdev_write+0x87
spec_write() at spec_write+0x87
VOP_WRITE() at VOP_WRITE+0xa6
vn_write() at vn_write+0x10e
dofilewrite() at dofilewrite+0x80
sys_write() at sys_write+0x49
syscall() at syscall+0x211

fstat confirms this is the console:
USER     CMD          PID   FD  MOUNT         INUM MODE         SZ|DV R/W
root     sh           223   wd  /                2 drwxr-xr-x    1024 r 
root     sh           223    0* pipe 0xfffffe48d89ec038 <- 0x0 r
root     sh           223    1  /         73317127 crw-------  console rw
root     sh           223    2  /         73317127 crw-------  console rw
root     sh           223    7  /         73317127 crw-------  console rw
root     sh           223    8  /         73317127 crw-------  console rw

Disassembling the kernel around ttwrite+0x96 suggests this is this call:
                        /* Sleep awaiting carrier. */
                        error = ttysleep(tp, &tp->t_rawcv, true, 0);

Why is it waiting carrier? This is a local serial line. 

-- 
Emmanuel Dreyfus
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.