[erlang-bugs] ssh_sftp:stop_channel/1 tampers trap_exit flag
Ali Yakout
ali.yakout@REDACTED
Sun Jun 19 09:33:53 CEST 2011
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]}}
More information about the erlang-bugs
mailing list