cURL / Mailing Lists / curl-library / Single Mail


Re: Curl 7.21.7 had problem to work.

From: Daniel Stenberg <>
Date: Sat, 15 Oct 2011 23:47:07 +0200 (CEST)

On Mon, 10 Oct 2011, Frank Van Uffelen wrote:

> I narrowed down this problem to singleipconnect in lib/connect.c where
> apparently the return value of the connect call gets trashed before it can
> be used (this explains the discrepancy between the EINPROGRESS return you
> see in strace vs curl's EINVAL diagnostic).

Thanks for this work. It seems entirely plausible and I'll certainly apply
your suggested fix, with a minor addition.

> 1 - although relatively recent (it didn't exist in 7.19.5) this code has
> been present in several curl versions, so is the fact that it appears on our
> embedded Linux platform a symptom of some deeper issue, or just bad luck?

I would say bad luck (or possibly due to a rare combination of problem and
your particular libc implementation/version), but I've not really dug into
what system call that gets used after connect() that clobbers errno and why it
haven't hurt more people...

> 2 - I don't see any possible side effects, but can you confirm that no ill
> side effects could be caused by this patch?

The only little flaw I could spot is that 'error' could be used uninitialized
in some code paths so it needs to be initialized to zero to make sure that
doesn't occur.

Fix was pushed as commit 1a416cd27a37d. Thanks a lot!

List admin:
Received on 2011-10-15