cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl closing fd zero

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 2 Jul 2014 23:28:42 +0200 (CEST)

On Tue, 1 Jul 2014, Priyanka Shah wrote:

> I see some strange behaviour when using libcurl to send data over scp.
> Whenever authentication fails (curl error code 67), I see that curl frees
> up fd zero (calls close(0)). And this causes unexpected behaviour in my
> application.
>
> Here is the trace I got while debugging the issue:
>
> #4 0xf3930a45 in ?? () from /usr/lib/libssh2.so.1
>
> #5 0xf3930fcc in libssh2_agent_disconnect () from /usr/lib/libssh2.so.1

If so, then that's a bug in libssh2. As you can see in the
libssh2_agent_disconnect() function it disconnects the agent connetion which
implies closing the file descriptor. Apparently it is file descriptor zero in
your case which is a fully legitimate file descriptor but I take it that it is
somehow not that in your case.

I believe we haven't fixed a bug like that in later libcurl or libssh2
versions but I'm not 100% sure.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2014-07-02