[erlang-bugs] ssh_sftp:stop_channel/1 tampers trap_exit flag

Ali Yakout ali.yakout@REDACTED
Wed Jun 22 07:12:39 CEST 2011


Hi Niclas,

You are right, this seems to be a problem with the version I'm using SSH-2.0.1/R14B.
The stop_channel/1 is running fine with the latest SSH-2.0.7

Thanks for the feedback.

Regards,
Ali  

-----Original Message-----
From: Niclas Eklund [mailto:nick@REDACTED] 
Sent: Monday, June 20, 2011 1:32 PM
To: Ali Yakout
Cc: erlang-bugs@REDACTED
Subject: Re: [erlang-bugs] ssh_sftp:stop_channel/1 tampers trap_exit flag


Hello!

The crash report should be related to a bug that was fixed some time ago. 
Are you sure that you're running the latest SSH version (2.0.7)?!

Best regards,

Niclas @ Erlang/OTP




On Sun, 19 Jun 2011, Ali Yakout wrote:

> Hi,
>
> I was facing a problem with ssh_sftp:stop_channel/1, while checking the code I noticed that it changes the trap_exit to be always true!
>
>> stop_channel(Pid) ->
>>    case process_info(Pid, [trap_exit]) of
>> 	[{trap_exit, Bool}] ->
>> 	    ...
>> 	    process_flag(trap_exit, Bool),
>
>
> I think 'Pid' should have been self() instead.
>
>> stop_channel(Pid) ->
>>    case process_info(self(), [trap_exit]) of
>
>
>
> Beside this issue, I'm getting a 'gen_server' noproc crash when trying to close the sftp channel...
> The server complains with a strange message "Received oclose for nonexistent channel 0."
>
>
> Any idea?
>
> /Ali
>
>
> Crash report below:
> ===================
>
> 14> {ok,Pid,Conn}=ssh_sftp:start_channel("myhost",22,[{user,"myuser"},{password,"mypass"}]).
> {ok,<0.76.0>,<0.73.0>}
> 15> ssh_sftp:stop_channel(Pid).
> ok
> 16>
> =ERROR REPORT==== 18-Jun-2011::22:37:04 ===
> ** Generic server <0.73.0> terminating
> ** Last message in was {ssh_msg,<0.74.0>,
>                           {ssh_msg_disconnect,2,
>                               "Received oclose for nonexistent channel 0.",
>                               []}}
> ** When Server state == {state,client,<0.32.0>,undefined,<0.74.0>,
>                            {connection,[],32784,[],[],1,undefined,undefined,
>                                undefined,undefined,undefined,undefined},
>                            0,
>                            [{address,"myhost"},
>                             {port,22},
>                             {role,client},
>                             {channel_pid,<0.32.0>},
>                             {socket_opts,[inet6]},
>                             {ssh_opts,
>                                 [{host,"myhost"},
>                                  {password,"mypass"},
>                                  {user,"myuser"}]}],
>                            undefined,true}
> ** Reason for termination ==
> ** {noproc,{gen_server,call,[undefined,which_children,infinity]}}
>
> =ERROR REPORT==== 18-Jun-2011::22:37:04 ===
> ** Generic server <0.72.0> terminating
> ** Last message in was {'EXIT',<0.73.0>,
>                           {noproc,
>                               {gen_server,call,
>                                   
> [undefined,which_children,infinity]}}}
> ** When Server state == {state,client,<0.73.0>,<0.74.0>,undefined}
> ** Reason for termination ==
> ** {noproc,{gen_server,call,[undefined,which_children,infinity]}}
>
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://erlang.org/mailman/listinfo/erlang-bugs
>





More information about the erlang-bugs mailing list