Problem with latest OpenSSH - 2.5.2p2

Lutz Jaenicke Lutz.Jaenicke at aet.TU-Cottbus.DE
Thu Apr 12 23:16:37 EST 2001


On Thu, Apr 12, 2001 at 08:46:20AM -0400, Brent L. Bates wrote:
>      I am running on a SGI Indigo2 R10000 running IRIX64 6.5.11f.  I
> downloaded the source, compiled, and installed the latest version just like I
> have for all previous versions.  We are using OpenSSL version 0.9.6,
> downloaded October 9, 2000.
>      The problem I am seeing is that every once and a while I get the
> following error in the current OpenSSH connected window:
> 
>         `read: Interrupted function call'

I just did a grep on 'read:' and there is only one place where this error
could be generated. It is in clientloop.c:client_process_input().
Here we find a
                  len = read(fileno(stdin), buf, sizeof(buf));
                  if (len <= 0) {
                        /*
                         * Received EOF or error.  They are treated
                         * similarly, except that an error message is printed
                         * if it was an error condition.
                         */
                        if (len < 0) {
                                snprintf(buf, sizeof buf, "read: %.100s\r\n", st
rerror(errno));
...

There is no check for EINTR (and EAGAIN), and the occurance of EINTR
would be treated as error.
Without fully analyzing the code (I just jumped into it), it should be
sufficient to insert 
                  if (len <= 0) {
                        /*
                         * Received EOF or error.  They are treated
                         * similarly, except that an error message is printed
                         * if it was an error condition.
                         */
                        if (len < 0) {
+				if ((errno == EINTR) || (errno == EAGAIN))
+					continue;
                                snprintf(buf, sizeof buf, "read: %.100s\r\n", st
rerror(errno));

to deal with this condition. But I am sure that the OpenSSH developpers will
know whether this has any unwanted side effect.

Best regards,
	Lutz
PS. Operating systems tend to behave differently. I have never seen such
effects on HP-UX, while e.g. Unixware behaves completely different, as
I have learned when tracking down problems with EINTR in the EGD interface
code of OpenSSL... Therefore it is well possible, that other people not
working on Irix won't be able to reproduce this problem.
-- 
Lutz Jaenicke                             Lutz.Jaenicke at aet.TU-Cottbus.DE
BTU Cottbus               http://www.aet.TU-Cottbus.DE/personen/jaenicke/
Lehrstuhl Allgemeine Elektrotechnik                  Tel. +49 355 69-4129
Universitaetsplatz 3-4, D-03044 Cottbus              Fax. +49 355 69-4153



More information about the openssh-unix-dev mailing list