tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: console freeze



On Tue, Sep 10, 2024 at 03:40:19PM +0000, Emmanuel Dreyfus wrote:
> 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. 

What does
ssty -a -f /dev/console
shows ? Does it have clocal set ?

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index