cURL / Mailing Lists / curl-library / Single Mail


Re: Sporadic "Couldn't resolve host" error on windows with libcurl 7.30.0

From: Ray Satiro <>
Date: Tue, 23 Sep 2014 02:40:57 -0400

On 9/22/2014 4:42 PM, arif khan wrote:
> Date: Sat, 20 Sep 2014 23:35:38 +0200 (CEST)
> From: Daniel Stenberg < <>>
> On Fri, 19 Sep 2014, arif khan wrote:
> > To narrow down the problem I wrote a multi-threaded app which
> runs 100
> > threads, in each thread if requests http page in a loop of range
> 1000. In
> > total 100000 requests, I can see 6-10 requests fails with above
> error.
> Sounds like it could potentially be running out of some resources?
> I think it
> would help if you figured out exactly which function call that returns
> failure, as I suspect it is actually the underlying getaddrinfo()
> that returns
> failure and then it feels like the problem is in Windows and not
> in libcurl.
> Thank you for comments.
> Yes it is getaddrinfo(). I will try to find the problem if this is
> something with running out of resource.

Is it still supported to build the way arif is building using the
makefile in the winbuild directory? I'm using the projects/Windows
build. Is one better than the other?

assuming threaded resolver then the new thread is created and calls
getaddrinfo_thread() calls Curl_getaddrinfo_ex() at asyn-thread.c:279,
Curl_getaddrinfo_ex() calls getaddrinfo() at curl_addrinfo.c:128.

Are you sure it's getaddrinfo arif? I wonder if getaddrinfo() is truly
thread safe in Windows. I've read a few contradictions but they're
anecdotal. What version of Windows are you using? Attached is a patch
that will dump relevant info to stderr when getaddrinfo fails. The patch
is based on a later version of curl (1ccfabb 2014-09-10) than the one
you are using so it's possible it won't apply clean. In that case look
for the if(error) after getaddrinfo() call in Curl_getaddrinfo_ex().
Also does the problem happen when you build x86?

List admin:

Received on 2014-09-23