In function after_select(), case AUTH_CONNECTION, the do-loop which handles socket reads will peg my CPU at close to 100% when errno is EAGAIN. I'm running FreeBSD 6.2 pre-release, with OpenSSH built from the ports collection (security/openssh-portable). The problem only occurs for me while running an automation script that sends commands through ssh to about a hundred servers at at time, and I have not been successful in identifying which server causes the problem. But the bottom line is that the read fails with errno EAGAIN, and continues to fail in a very tight loop until a timeout occurs at some point. My work-around was to introduce a tiny sleep before the continue statement in that loop, which is apparently enough to allow some data to become available for reading, and makes the problem go away. I will attach my work-around as a patch, realizing that usleep() is probably not available on all platforms.
Created attachment 1203 [details] Adds a sleep when socket reads fail with EAGAIN
This patch does not look correct - select() should guarantee that the socket has data ready to be read, so EAGAIN should not occur. Even if it does, falling back through to select() again to wait would be the correct behaviour.
I can't reproduce this at all, can you try a recent ssh-agent (ideally from 5.0p1) to see if the behaviour persists?
1 year with no followup == bug closed
Mass move of RESOLVED bugs to CLOSED now that 5.3 is out.
With the release of 5.4p1, this bug is now considered closed.