NetBSD-Bugs archive

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

kern/56810: virsh+pexpect back-pressure causing console's tab-expanded space characters to be lost



>Number:         56810
>Category:       kern
>Synopsis:       virsh+pexpect back-pressure causing console's tab-expanded space characters to be lost
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 29 02:05:00 +0000 2022
>Originator:     Andrew Cagney
>Release:        NetBSD 9.2
>Organization:
>Environment:
KVM Guest: NetBSD netbsdw 9.2 NetBSD 9.2 (GENERIC) #0: Wed May 12 13:15:55 UTC 2021  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/i386/compile/GENERIC i386
KVM Host: Linux 5.17.4-200.fc35.x86_64 #1 SMP PREEMPT Wed Apr 20 15:37:53 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

>Description:
The setup:

- Linux host

- a very vanilla NetBSD 9.2 guest

- the guest console is set up as:
# tty
/dev/constty
# dmesg | grep cons
[     1.000003] com0: console
# dmesg | grep com0
[     1.000003] com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
[     1.000003] com0: console
# stty
speed 9600 baud;
lflags: echoe echoke echoctl
oflags: onocr onlret
cflags: cs8 -parenb -hupcl clocal

(the baud rate was set low as higher speeds seemed to loose other characters, at least during the install)

- a python (pexpect - pty+tty) script wrapping <<virsh console>> and running on the host is being used to interact with the NetBSD console
the script sends shell commands and then captures the output writing it to a file

When the terminal is set up per above tabs are expanded to spaces, but some of the spaces get lost vis:

# setkey -D
192.1.2.23 192.1.2.45 
        esp mode=tunnel spi=2515219582(0x95eb347e) reqid=16389(0x00004005)
      E: aes-cbc  7a376fd9 4b7017be edf173db 839d44d9

when tab expansion is disabled, vis:

# stty -oxtabs
# setkey -D
192.1.2.23 192.1.2.45 
        esp mode=tunnel spi=2515219582(0x95eb347e) reqid=16389(0x00004005)
        E: aes-cbc  7a376fd9 4b7017be edf173db 839d44d9

there is no character loss.

- it seems to only be the tab-expanded space characters that are lost
- using virsh directly doesn't appear to have the problem
- using virsh+pexpect in "interact" mode also doesn't have the problem (so presumably its the effect of pexpect's pattern-matcher slowing down I/O)
- linux guests, using an identical setup and also using xon, don't suffer from this problem; its console is similar
[    0.727155] 00:00: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A


>How-To-Repeat:
Um.  See above for setup.  Can provide pexpect script if needed.

>Fix:
work-around is to disable tab expansion



Home | Main Index | Thread Index | Old Index