sshd gets stuck: select() in packet_read_seqnr waits indefinitely

Matt Day opensshbugs at fjarlq.com
Thu Mar 15 13:59:04 EST 2007


On Thu, Mar 15, 2007 at 01:43:47PM +1100, Darren Tucker wrote:
> The descriptor is O_NONBLOCK (set by packet_set_nonblocking()), so the
> read() should return -1 with errno == EWOULDBLOCK or EAGAIN.
>
> [..]
>
> You could test for EWOULDBLOCK or EAGAIN and provide a more informative
> error message, though.

OK, thanks, I didn't notice that. Yeah, it might be useful to log
a debug message there. It would also seem safer and more clear to
handle the timeout case explicitly. Or perhaps a comment documenting
the O_NONBLOCK assumption.

What about the timeout handling in packet_write_wait? Do you really
want to proceed with the write() and then possibly loop back around
to the select() call?

Thanks,
Matt


More information about the openssh-unix-dev mailing list