Bug 1135 - ssh-agent auth socket problem = infinite loop 100% cpu
Summary: ssh-agent auth socket problem = infinite loop 100% cpu
Status: CLOSED DUPLICATE of bug 1633
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh-agent (show other bugs)
Version: 4.2p1
Hardware: All Cygwin on NT/2k/Win7-11
: P2 normal
Assignee: Assigned to nobody
URL:
Keywords:
: 1134 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-12-16 20:54 AEDT by Anastasius Focht
Modified: 2010-04-16 15:50 AEST (History)
1 user (show)

See Also:


Attachments
debug session and source code snippets pinpointing the problem (3.99 KB, text/plain)
2005-12-16 20:55 AEDT, Anastasius Focht
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anastasius Focht 2005-12-16 20:54:11 AEDT
ssh-agent is started using .bashrc.

When i update my cygwin installation using "setup.exe" i occasionally
get the ssh-agent hanging eating 100% cpu.

Attached is a debugger session/code snippets which shows the bug

in short: select() is returning "1" while the following accept() gets -1 (errno = 0x6C). The main while(1) loop leads to 100% cpu usage.

No one on cygwin mailing list cared to answer so i hope someone here can shed any lights on this.
Maybe this bug is originated within cygwin itself ...

Its very annyoing bug because i often update cygwin installations and have to kill ssh-agent manually (while eating 100% cpu) to continue.

Regards

A. Focht
Comment 1 Anastasius Focht 2005-12-16 20:55:51 AEDT
Created attachment 1044 [details]
debug session and source code snippets pinpointing the problem
Comment 2 Darren Tucker 2005-12-17 21:45:55 AEDT
*** Bug 1134 has been marked as a duplicate of this bug. ***
Comment 3 Darren Tucker 2005-12-17 22:37:29 AEDT
I would guess that you have problems when setup.exe updates the cygwin dll while ssh-agent is still using it.  I have no idea what is happening under the covers though (or even if an update while cygwin processes are still running is even supported?)
Comment 4 Anastasius Focht 2005-12-18 06:53:32 AEDT
(In reply to comment #3)
> I would guess that you have problems when setup.exe updates the cygwin dll
> while ssh-agent is still using it.  I have no idea what is happening under the
> covers though (or even if an update while cygwin processes are still running is
> even supported?)
> 

Hello again,

no the cygwin dynamic library is not updated/replaced when this occurs.
I examined the setup.log.full after each install and tells like this:

--- snip ---
....
2005/12/16 23:24:59 running: e:\cygwin\bin\bash.exe -c /etc/postinstall/update-info-dir.sh
Agent pid 3148
Could not open a connection to your authentication agent.
2005/12/16 23:25:28 abnormal exit: exit code=0
2005/12/16 23:25:34 mbox note: Installation Complete
2005/12/16 23:25:34 Ending cygwin install
...
--- snip ---

As posted before, my .bashrc contains

----- snip ----

[ -z "$SSH_AUTH_SOCK" ] && eval `ssh-agent -s`
[ -z "$SSH_AGENT_PID" ] || ssh-add -l >/dev/null 2>&1 || ssh-add 
 
--- snip ---

Each time bash is started, this gets executed and the following lines appear on my shell:

--- snip ---

Agent pid xxxx
Identity added: /home/focht/.ssh/id_rsa (/home/focht/.ssh/id_rsa)

focht@xxxx ~
$ 
--- snip ---

Maybe there is some kind of race condition somewhere because there is a line in setup log saying "Could not open a connection to your authentication agent."

I guess its some kind of socket problem .. 

select() = ok (returns 1)
accept() = fail (returns -1, errno: shutdown)

Regards
Comment 5 Damien Miller 2009-11-20 10:41:44 AEDT
This was probably bug #1633

*** This bug has been marked as a duplicate of bug 1633 ***
Comment 6 Damien Miller 2010-04-16 15:50:04 AEST
Mass move of bugs RESOLVED->CLOSED following the release of openssh-5.5p1