ftp lib behaviour has changed between ftp-1.0.1 and ftp-1.0.2

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

ftp lib behaviour has changed between ftp-1.0.1 and ftp-1.0.2

Robert Raschke
Hi,

I have code that matches on {ok, Result} and {error, Reason} tuples coming from calls to ftp:ls/2 and ftp:recv_bin/2 (on 21.1, ftp-1.0.1) and upgrading to 21.3 (ftp-1.0.2) sometimes returns a simple ok on those calls. This is surprising.

15> f().

ok

16> {ok, FTP} = ftp:open("somesite"), ok = ftp:user(FTP, "someuser", "somepwd"), timer:sleep(100), R = ftp:ls(FTP, "/somefolder/*"), ftp:close(FTP), R.

{ok,"-rw-r--r--    1 2001       2001           174993 Jul  8 17:16 ..."}

17> f().

ok

18> {ok, FTP} = ftp:open("somesite"), ok = ftp:user(FTP, "someuser", "somepwd"), timer:sleep(100), R = ftp:ls(FTP, "/somefolder/*"), ftp:close(FTP), R.

ok

19> 


What might be the reason for this? And is this expected?


Cheers,

Robby



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: ftp lib behaviour has changed between ftp-1.0.1 and ftp-1.0.2

Ingela Andin
Hi Robert!

Well it somewhat unexpected that it returns an undocumented value. It might be that the correction made to fix a timing bug in the FTP application, that
was exposed by TLS optimizations when running FTP over TLS, uncovered some other timing bug. Most of the FTP code is very old and I wished for the gen_statem behavior while fixing the bug I just mentioned, so I would not be very surprised if there are more race conditions in that code. 

Regards Ingela Erlang/OTP team 

Den mån 8 juli 2019 kl 18:11 skrev Robert Raschke <[hidden email]>:
Hi,

I have code that matches on {ok, Result} and {error, Reason} tuples coming from calls to ftp:ls/2 and ftp:recv_bin/2 (on 21.1, ftp-1.0.1) and upgrading to 21.3 (ftp-1.0.2) sometimes returns a simple ok on those calls. This is surprising.

15> f().

ok

16> {ok, FTP} = ftp:open("somesite"), ok = ftp:user(FTP, "someuser", "somepwd"), timer:sleep(100), R = ftp:ls(FTP, "/somefolder/*"), ftp:close(FTP), R.

{ok,"-rw-r--r--    1 2001       2001           174993 Jul  8 17:16 ..."}

17> f().

ok

18> {ok, FTP} = ftp:open("somesite"), ok = ftp:user(FTP, "someuser", "somepwd"), timer:sleep(100), R = ftp:ls(FTP, "/somefolder/*"), ftp:close(FTP), R.

ok

19> 


What might be the reason for this? And is this expected?


Cheers,

Robby


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: ftp lib behaviour has changed between ftp-1.0.1 and ftp-1.0.2

Robert Raschke
Hi Ingela,

I just had a case of ftp:recv_bin(FTP, "filename") repeatedly returned only 'ok'.
That is, my hoped for workaround of simply retrying the operation fails.

This makes version 1.0.2 of the ftp lib unusable, I'm afraid.
I will have to revert to an earlier version.

Cheers,
Robby


On Tue, 9 Jul 2019 at 20:49, Ingela Andin <[hidden email]> wrote:
Hi Robert!

Well it somewhat unexpected that it returns an undocumented value. It might be that the correction made to fix a timing bug in the FTP application, that
was exposed by TLS optimizations when running FTP over TLS, uncovered some other timing bug. Most of the FTP code is very old and I wished for the gen_statem behavior while fixing the bug I just mentioned, so I would not be very surprised if there are more race conditions in that code. 

Regards Ingela Erlang/OTP team 

Den mån 8 juli 2019 kl 18:11 skrev Robert Raschke <[hidden email]>:
Hi,

I have code that matches on {ok, Result} and {error, Reason} tuples coming from calls to ftp:ls/2 and ftp:recv_bin/2 (on 21.1, ftp-1.0.1) and upgrading to 21.3 (ftp-1.0.2) sometimes returns a simple ok on those calls. This is surprising.

15> f().

ok

16> {ok, FTP} = ftp:open("somesite"), ok = ftp:user(FTP, "someuser", "somepwd"), timer:sleep(100), R = ftp:ls(FTP, "/somefolder/*"), ftp:close(FTP), R.

{ok,"-rw-r--r--    1 2001       2001           174993 Jul  8 17:16 ..."}

17> f().

ok

18> {ok, FTP} = ftp:open("somesite"), ok = ftp:user(FTP, "someuser", "somepwd"), timer:sleep(100), R = ftp:ls(FTP, "/somefolder/*"), ftp:close(FTP), R.

ok

19> 


What might be the reason for this? And is this expected?


Cheers,

Robby


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: ftp lib behaviour has changed between ftp-1.0.1 and ftp-1.0.2

Ingela Andin
Hi Robert!

Can you provide a reliable way to reproduce the problem it will help getting it fixed. Have you tried to run our ftp test suite?
It passes in our tests runs.  The possible bug might be server dependent.

Could you report it at https://bugs.erlang.org/

Regards Ingela Erlang/OTP Team - Ericsson AB

Den fre 12 juli 2019 kl 10:43 skrev Robert Raschke <[hidden email]>:
Hi Ingela,

I just had a case of ftp:recv_bin(FTP, "filename") repeatedly returned only 'ok'.
That is, my hoped for workaround of simply retrying the operation fails.

This makes version 1.0.2 of the ftp lib unusable, I'm afraid.
I will have to revert to an earlier version.

Cheers,
Robby


On Tue, 9 Jul 2019 at 20:49, Ingela Andin <[hidden email]> wrote:
Hi Robert!

Well it somewhat unexpected that it returns an undocumented value. It might be that the correction made to fix a timing bug in the FTP application, that
was exposed by TLS optimizations when running FTP over TLS, uncovered some other timing bug. Most of the FTP code is very old and I wished for the gen_statem behavior while fixing the bug I just mentioned, so I would not be very surprised if there are more race conditions in that code. 

Regards Ingela Erlang/OTP team 

Den mån 8 juli 2019 kl 18:11 skrev Robert Raschke <[hidden email]>:
Hi,

I have code that matches on {ok, Result} and {error, Reason} tuples coming from calls to ftp:ls/2 and ftp:recv_bin/2 (on 21.1, ftp-1.0.1) and upgrading to 21.3 (ftp-1.0.2) sometimes returns a simple ok on those calls. This is surprising.

15> f().

ok

16> {ok, FTP} = ftp:open("somesite"), ok = ftp:user(FTP, "someuser", "somepwd"), timer:sleep(100), R = ftp:ls(FTP, "/somefolder/*"), ftp:close(FTP), R.

{ok,"-rw-r--r--    1 2001       2001           174993 Jul  8 17:16 ..."}

17> f().

ok

18> {ok, FTP} = ftp:open("somesite"), ok = ftp:user(FTP, "someuser", "somepwd"), timer:sleep(100), R = ftp:ls(FTP, "/somefolder/*"), ftp:close(FTP), R.

ok

19> 


What might be the reason for this? And is this expected?


Cheers,

Robby


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: ftp lib behaviour has changed between ftp-1.0.1 and ftp-1.0.2

Robert Raschke
Hi Ingela,

the server I see this behaviour on is: Pure-FTPd - http://pureftpd.org/ 

If I can find the time, I will try to raise a report. Might take a bit. Also, the ftp server is not mine, but a live commercial installation. So I'm not sure about the parameters of their installation or if I can ever find out.

Cheer,
Robby


On Fri, 12 Jul 2019 at 11:52, Ingela Andin <[hidden email]> wrote:
Hi Robert!

Can you provide a reliable way to reproduce the problem it will help getting it fixed. Have you tried to run our ftp test suite?
It passes in our tests runs.  The possible bug might be server dependent.

Could you report it at https://bugs.erlang.org/

Regards Ingela Erlang/OTP Team - Ericsson AB

Den fre 12 juli 2019 kl 10:43 skrev Robert Raschke <[hidden email]>:
Hi Ingela,

I just had a case of ftp:recv_bin(FTP, "filename") repeatedly returned only 'ok'.
That is, my hoped for workaround of simply retrying the operation fails.

This makes version 1.0.2 of the ftp lib unusable, I'm afraid.
I will have to revert to an earlier version.

Cheers,
Robby


On Tue, 9 Jul 2019 at 20:49, Ingela Andin <[hidden email]> wrote:
Hi Robert!

Well it somewhat unexpected that it returns an undocumented value. It might be that the correction made to fix a timing bug in the FTP application, that
was exposed by TLS optimizations when running FTP over TLS, uncovered some other timing bug. Most of the FTP code is very old and I wished for the gen_statem behavior while fixing the bug I just mentioned, so I would not be very surprised if there are more race conditions in that code. 

Regards Ingela Erlang/OTP team 

Den mån 8 juli 2019 kl 18:11 skrev Robert Raschke <[hidden email]>:
Hi,

I have code that matches on {ok, Result} and {error, Reason} tuples coming from calls to ftp:ls/2 and ftp:recv_bin/2 (on 21.1, ftp-1.0.1) and upgrading to 21.3 (ftp-1.0.2) sometimes returns a simple ok on those calls. This is surprising.

15> f().

ok

16> {ok, FTP} = ftp:open("somesite"), ok = ftp:user(FTP, "someuser", "somepwd"), timer:sleep(100), R = ftp:ls(FTP, "/somefolder/*"), ftp:close(FTP), R.

{ok,"-rw-r--r--    1 2001       2001           174993 Jul  8 17:16 ..."}

17> f().

ok

18> {ok, FTP} = ftp:open("somesite"), ok = ftp:user(FTP, "someuser", "somepwd"), timer:sleep(100), R = ftp:ls(FTP, "/somefolder/*"), ftp:close(FTP), R.

ok

19> 


What might be the reason for this? And is this expected?


Cheers,

Robby


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions