[erlang-bugs] ssh_cli error during start_shell

Anton Ryabkov anton.ryabkov@REDACTED
Tue Dec 17 04:33:59 CET 2013


Hello,

on Erlang R16B03 I've found that ssh_cli crushed with function_clause, when
I trying connected by ssh to my ssh daemon. Error:
...
** {function_clause,[{proplists,get_value,
                                [user,{ok,[]},undefined],
                                [{file,"proplists.erl"},{line,225}]},

 {ssh_cli,start_shell,2,[{file,"ssh_cli.erl"},{line,457}]},
                     {ssh_cli,handle_ssh_msg,2,
                              [{file,"ssh_cli.erl"},{line,107}]},
                     {ssh_channel,handle_info,2,
                                  [{file,"ssh_channel.erl"},{line,241}]},
                     {gen_server,handle_msg,5,
                                 [{file,"gen_server.erl"},{line,604}]},
                     {proc_lib,init_p_do_apply,3,
                               [{file,"proc_lib.erl"},{line,239}]}]}

Note: all error in the file error.

Steps to reproduce:
1. compile ssh_bug.erl
2. ssh_bug:test().
3. connect by ssh: ssh localhost -p9876
4. look at erlang concole for error.

The reason of the bug is getting ConnectionInfo in the ssh_cli. Instead of
use ssh_connection_handler:connection_info method to get ConnectionInfo
used ssh_connection_handler:info.

Patch for current bug:
452c452
<     ConnectionInfo = ssh_connection_handler:info(ConnectionHandler,
---
>     ConnectionInfo =
ssh_connection_handler:connection_info(ConnectionHandler,
456c456
<                      {ok, User} =
---
>                      User =
462c462
<                              [{_, PeerAddr}] =
---
>                              {_, PeerAddr} =
480c480
<     ConnectionInfo = ssh_connection_handler:info(ConnectionHandler,
---
>     ConnectionInfo =
ssh_connection_handler:connection_info(ConnectionHandler,
482c482
<     {ok, User} =
---
>     User =
491c491
<               [{_, PeerAddr}] =
---
>               {_, PeerAddr} =


Sample, error and patch in the attach.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20131217/0f751be6/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ssh_bug_3_0.tar.gz
Type: application/x-gzip
Size: 3257 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20131217/0f751be6/attachment.bin>


More information about the erlang-bugs mailing list