win-ssh-agent icon indicating copy to clipboard operation
win-ssh-agent copied to clipboard

Segfault on Windows 10 / Cygwin 64bit

Open michaelkanis opened this issue 9 years ago • 4 comments

I had this running on Win 7 before. In the meantime I upgraded to Win 10 and now win-ssh-agent crashes with a segmentation fault. My gdb skills are very limited, but here is a backtrace.

Let me know if I can get any other info.

Starting program: win-ssh-agent
[New Thread 3292.0x1830]
[New Thread 3292.0x1a08]
[New Thread 3292.0x9dc]
[New Thread 3292.0x2238]
[New Thread 3292.0x19b0]
[New Thread 3292.0x1600]

Program received signal SIGSEGV, Segmentation fault.
0x0000000100404433 in TaskTray::wndProc(HWND__*, unsigned int, unsigned long long, long long) ()
(gdb) bt
#0  0x0000000100404433 in TaskTray::wndProc(HWND__*, unsigned int, unsigned long long, long long) ()
#1  0x00007ffc57af1169 in USER32!DispatchMessageW () from /WINDOWS/system32/USER32.dll
#2  0x00007ffc57af0c97 in USER32!DispatchMessageW () from /WINDOWS/system32/USER32.dll
#3  0x00000001004035fa in main ()

michaelkanis avatar Mar 09 '16 11:03 michaelkanis

Thank you for the bug report. I updated my cygwin64 environment (on Win7) now, then win-ssh-agent segfaults. I will fix it, so please wait for a little.

ganaware avatar Mar 10 '16 01:03 ganaware

I released 1.09. Please try it.

ganaware avatar Mar 10 '16 02:03 ganaware

Wow, that was fast! Thank you very much!

It doesn't segfault anymore, but I think I can't get it to work anymore either.

I start it from Explorer, then start a Cygwin 64 Terminal. The env vars are setup properly as far as I can see: ~$ export | grep SSH SSH_AGENT_PID=9876 SSH_ASKPASS=/usr/local/bin/win-ssh-askpass.exe SSH_AUTH_SOCK=/tmp/ssh-GHc1F7KxesXB/agent.9964

If I right click the tray icon and click on "Add ...", nothing happens, but I can't remember what that was supposed to do.

If I want to ssh into a machine with pubkey auth, the ssh client asks me directly on the command line for the password of the key. Shouldn't the win-ssh-askpass dialog appear? Am I maybe doing something wrong?

michaelkanis avatar Mar 10 '16 10:03 michaelkanis

"Add ..." should display a dialogbox that asks you your passphrase. On my Windows7 machine, it works as expected. (I have no Windows10 machine)

Please run the following commands, and let me know their results.

$ uname -a
$ ssh -V
$ cygcheck -c | grep ssh
$ /usr/local/bin/win-ssh-askpass
$ /usr/local/bin/win-ssh-agent --verbose

NOTE:

  • $ /usr/local/bin/win-ssh-askpass displays a dialogbox. What you input is echoed to the Cygwin64 terminal.
  • $ /usr/local/bin/win-ssh-agent --verbose also displays a dialogbox. Input your passphrase.
    • Select "Exit" on the tasktray menu after (message loop) is printed on Cygwin64 terminal.

My results are: $ uname -a

CYGWIN_NT-6.1 MY_HOST_NAME 2.4.1(0.293/5/3) 2016-01-24 11:26 x86_64 Cygwin

$ ssh -V

OpenSSH_7.2p1, OpenSSL 1.0.2g  1 Mar 2016

$ cygcheck -c | grep ssh

libssh2_1                    1.7.0-1            OK
openssh                      7.2p1-1            OK
openssh-debuginfo            7.2p1-1            OK

$ /usr/local/bin/win-ssh-askpass

WHAT_I_INPUT

$ /usr/local/bin/win-ssh-agent --verbose

$ /usr/local/bin/win-ssh-agent --verbose
$ ssh-agent -s
SSH_AUTH_SOCK=/tmp/ssh-Mk75r2WOo9gJ/agent.7448; export SSH_AUTH_SOCK;
SSH_AGENT_PID=9128; export SSH_AGENT_PID;
echo Agent pid 9128;
$ echo $DISPLAY
:0
$ export SSH_AUTH_SOCK=/tmp/ssh-Mk75r2WOo9gJ/agent.7448
$ export SSH_AGENT_PID=9128
$ export SSH_ASKPASS=/usr/local/bin/win-ssh-askpass.exe
(broadcast)

(run ssh-add)
$ export SSH_ASKPASS=/usr/local/bin/win-ssh-askpass.exe
$ export DISPLAY=:0
$ ssh-add
Identity added: /home/MY_USERNAME/.ssh/id_rsa (/home/MY_USERNAME/.ssh/id_rsa)
ssh-add exit(0)

(message loop)

(cleanup)
$ ssh-agent -s -k
unset SSH_AUTH_SOCK;
unset SSH_AGENT_PID;
echo Agent pid 9128 killed;
$ unset SSH_AUTH_SOCK
$ unset SSH_AGENT_PID
$ unset SSH_ASKPASS
(broadcast)

ganaware avatar Mar 11 '16 01:03 ganaware