Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERL-1001: SFTP issue #3827

Closed
OTP-Maintainer opened this issue Jul 10, 2019 · 1 comment
Closed

ERL-1001: SFTP issue #3827

OTP-Maintainer opened this issue Jul 10, 2019 · 1 comment
Assignees
Labels
not a bug Issue is determined as not a bug by OTP priority:medium team:PS Assigned to OTP team PS

Comments

@OTP-Maintainer
Copy link

Original reporter: raimo
Affected version: OTP-22.0
Component: ssh
Migrated from: https://bugs.erlang.org/browse/ERL-1001


Reported by Serge Alleynikov, on erts-10.4.

Looks like a bug to me:

{noformat}
1> f(CPid), f(Conn), {ok, CPid, Conn} = ssh_sftp:start_channel("xxxx",
2222, []).
{ok,<0.6351.0>,<0.6349.0>}
2> ssh_sftp:close(CPid, Conn).
** exception exit: {{badarg,
                        [{erlang,size,[<0.6349.0>],[]},

 {ssh_xfer,close,3,[{file,"ssh_xfer.erl"},{line,116}]},
                         {ssh_sftp,do_handle_call,3,
                             [{file,"ssh_sftp.erl"},{line,601}]},
                         {ssh_client_channel,handle_call,3,
                             [{file,"ssh_client_channel.erl"},{line,216}]},
                         {gen_server,try_handle_call,4,
                             [{file,"gen_server.erl"},{line,661}]},
                         {gen_server,handle_msg,6,
                             [{file,"gen_server.erl"},{line,690}]},
                         {proc_lib,init_p_do_apply,3,
                             [{file,"proc_lib.erl"},{line,249}]}]},
                    {gen_server,call,
                        [<0.6351.0>,
                         {{timeout,infinity},{close,false,<0.6349.0>}},
                         infinity]}}
     in function  gen_server:call/3 (gen_server.erl, line 223)
     in call from ssh_client_channel:call/3 (ssh_client_channel.erl, line 93)
{noformat}

@OTP-Maintainer
Copy link
Author

hans said:

ssh_sftp:close closes *handles* obtained from ssh_sftp:open, like this:

{noformat}
1> ssh:start().
ok
2> {ok, CPid, Conn} = ssh_sftp:start_channel(loopback, 22, []).
{ok,<0.95.0>,<0.92.0>}
3> {ok,Handle} = ssh_sftp:open(CPid, "/tmp/foo", [write]).
{ok,<<0,0,0,0>>}
4> ssh_sftp:close(CPid, Handle).
ok
5> 
{noformat}

@OTP-Maintainer OTP-Maintainer added not a bug Issue is determined as not a bug by OTP team:PS Assigned to OTP team PS priority:medium labels Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not a bug Issue is determined as not a bug by OTP priority:medium team:PS Assigned to OTP team PS
Projects
None yet
Development

No branches or pull requests

2 participants