Re: Pty is losing bytes

From: Alan Curry
Date: Tue Feb 15 2005 - 15:16:40 EST


Linus Torvalds writes the following:
>
>Does the problem go away if you change the default value of "chunk" (in
>drivers/char/tty_io.c:do_tty_write) from 4096 to 2048? If so, that means
>that the pty code has _claimed_ to have written 4kB, and only ever wrote
>4kB-1 bytes. That in turn implies that "ldisc.receive_room()" disagrees
>with "ldisc.receive_buf()".
>

That does fix it for me, in 2.6.10-as3 (the -as3 patch doesn't touch anything
near the pty code, so it should be good for vanilla 2.6.10 too).

I noticed while testing that the "lost byte" is occasionally more than one
byte. It's always one byte at the 4k mark, but sometimes a larger group of
bytes is lost around the 8k mark, and (more rarely) an even larger group of
bytes is lost at the 12k mark.

$ ls -l /etc/mime.types
-rw-r--r-- 1 root root 15723 Apr 9 2002 /etc/mime.types
$ while :; do ./ptytest < /etc/mime.types | wc -c ; sleep 1 ; done
15722
15710
15722
15710
15722
15710
15722
15722
15682
(and so on)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/