Haxx ad

curl's project page on


cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-1431750 ] crash when dns slow

From: <>
Date: Wed, 15 Feb 2006 02:34:27 -0800

Bugs item #1431750, was opened at 2006-02-14 20:59
Message generated for change (Comment added) made by bagder
You can respond by visiting:

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: libcurl
Group: crash
Status: Open
Resolution: None
Priority: 5
Submitted By: xbx (xbx___)
Assigned to: Daniel Stenberg (bagder)
Summary: crash when dns slow

Initial Comment:
I have a strange setup with the dns taking a long time
to answer.
I run my app that make periodic http(s) requests.
Everything goes fine, but after a while (that is, after
maybe 10 successfull requests to the same host) I have
this crash:

#0 0xb7fade01 in Curl_connecthost (conn=0x8a73094,
    sockconn=0x8a7312c, addr=0xbfaefdc4,
connected=0xbfaefe07 "")
    at connect.c:789
#1 0xb7f9ed04 in ConnectPlease (conn=0x8a73094,
    connected=0xbfaefe07 "") at url.c:2017
#2 0xb7fa19f3 in SetupConnection (conn=0x8a73094,
    protocol_done=0xbfaefe88 "") at url.c:3670
#3 0xb7fa1b08 in Curl_connect (data=0x8ab48bc,
    asyncp=0xbfaefe89 "", protocol_done=0xbfaefe88 "")
at url.c:3729
#4 0xb7faf002 in curl_multi_perform
    running_handles=0xbfaeff34) at multi.c:422

(notice the hostaddr=0x0 part)

I'm using libcurl 7.15.1, with this configure options:
./configure --prefix=/usr/ --disable-gopher
--disable-ldap --disable-dict --disable-telnet
--enable-nonblocking --enable-debug
--disable-crypto-auth --enable-ares --disable-ipv6

I could further investigate, but I'd have to know which
way to look..
More precisely,
  code = CreateConnection(data, in_connect, &dns, asyncp);
    code == OK
    dns == null
    asyncp == false
Is the problem that 'code' shouldn't be 'ok', or that
the program shouldn't crash when dns == Null?


>Comment By: Daniel Stenberg (bagder)
Date: 2006-02-15 11:34

Logged In: YES

Ah, right. That's NULL if the connection is re-used. So it
looks like it enters the SetupConnection() function and then
some 30 lines into the function the condition

  if(CURL_SOCKET_BAD == conn->sock[FIRST])

equals true. And then it wrongly tries to re-connect using
the host address that is now NULL.

Can you figure out how it comes it has marked the socket as
being bad, while still believing the connection is being
re-used fine?

What does a CURLOPT_VERSBOSE output reveal? Does the
connection just prior to the failing one look fine and claim
to be leaving the connection alive? Does the failing one
claim to retry the connection or just re-use it normally
like other re-used connections?


Comment By: xbx (xbx___)
Date: 2006-02-15 11:10

Logged In: YES

looks like it's because, url.c::3530
  if(conn->bits.reuse) {
is true.


Comment By: Daniel Stenberg (bagder)
Date: 2006-02-15 10:42

Logged In: YES

Right, can you see if you can figure out why
CreateConnection() returns CURLE_OK while still not
returning any address and setting asnyncp to FALSE?


You can respond by visiting:
Received on 2006-02-15

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET