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

[PATCH] console in pty spams conserver when parent process exits

Ed Swierk eswierk@arastra.com
Thu, 25 Oct 2007 13:20:46 -0700 (PDT)

The attached patch fixes a bug in conserver 8.1.16 causing console to
send garbage to the server if read(stdin) returns -1.

This occurs if you run console in a pty on Linux: when the parent
process exits, the kernel eventually SIGHUPs the child, but if the
child keeps reading stdin before this happens, it eventually gets an
EIO, which causes read() to return -1. console currently interprets
this as a valid length and passes -1 to FileWrite(), which ends up
sending a large blob of junk (up to the first NULL) to the server.
This occurs repeatedly until console finally receives SIGHUP.


Attachment: conserver-read-stdin-error.patch
Description: Binary data