[erlang-bugs] SSH-daemon freezing while call io:getopts() and io:setopts()

Ingela Anderton Andin Ingela.Anderton.Andin@REDACTED
Thu Nov 21 09:45:25 CET 2013


Hello!

Yes this is now a known problem. I have for the upcoming release done a 
big rewrite of ssh to deal with some timing related issues, but this is 
a remaining problem. I had also noticed that failing to handle this 
message was part of the problem. We will investigate if this is the 
whole solution. Thank for you report.

Regards Ingela Erlang/OTP team - Ericsson AB

On 11/21/2013 02:41 AM, Alexander Demidenko wrote:
> Hello, friends.
>
> I have a trouble with using shell in the ssh-daemon, when I call the
> function io:getopts() and io:setopts([{echo, false}, {encoding, latin1}]).
>
> Tested by Erlang 16B02, ssh 2.1.8 and R15B02, ssh 2.1.1
>
>
> How can i see, in the ssh_cli.erl module, handle_msg metod no function
> for processing param ({Group, set_unicode_state, Arg}, State) and
> ({Group, get_unicode_state}, State).
>
> My patch for fixing:
>
> --- ssh-2.1.1/src/ssh_cli.erl2013-10-26 14:25:26.000000000
> +++ ssh-2.1.2/src/ssh_cli.erl2013-10-26 14:18:18.000000000
> @@ -159,12 +159,20 @@
>   %%--------------------------------------------------------------------
>   handle_msg({ssh_channel_up, ChannelId, ConnectionManager},
>    #state{channel = ChannelId,
>   cm = ConnectionManager} = State) ->
>       {ok,  State};
> +handle_msg({Group, set_unicode_state, _Arg}, State) ->
> +  Group ! {self(), set_unicode_state, false},
> +    {ok, State};
> +
> +handle_msg({Group, get_unicode_state}, State) ->
> +    Group ! {self(), get_unicode_state, false},
> +    {ok, State};
> +
>   handle_msg({Group, Req}, #state{group = Group, buf = Buf, pty = Pty,
> cm = ConnectionManager,
> channel = ChannelId} = State) ->
>       {Chars, NewBuf} = io_request(Req, Buf, Pty),
>       write_chars(ConnectionManager, ChannelId, Chars),
>       {ok, State#state{buf = NewBuf}};
>
> Also I attached simple sample, where you can see this problem. To run
> it, compile ssh_shell.erl and ssh_manager.erl and invoke
> "ssh_manager:start_link()" method to run ssh-daemon. (you need generate
> personal keys for used it) Then run ssh-client on terminal to localhost
> on port 7777, after entering the password “test”, enter the command
> "echo_on" or "echo_off".
>
> You can see that there is a delay when calling functions io:getopts()
> and io:setopts([{echo, false}, {encoding, latin1}]).
>
>
> --
> ---------------------------------------------
> With best regards,
> Alexander.
>
>
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://erlang.org/mailman/listinfo/erlang-bugs
>




More information about the erlang-bugs mailing list