cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: bug in curl when using threaded resolver but no IPv6 since 7.34.0, all connections time out

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 8 Jan 2014 22:57:44 +0100 (CET)

On Wed, 8 Jan 2014, Fabian Frank wrote:

> Sorry I forgot the -v (lowercase v) output.
>
> $ ./src/curl --connect-timeout 5 -v www.yahoo.com
> * Rebuilt URL to: www.yahoo.com/
> * Hostname was NOT found in DNS cache
> * Adding handle: conn: 0x7fc484008200
> * Adding handle: send: 0
> * Adding handle: recv: 0
> * Curl_addHandleToPipeline: length: 1
> * Connection timed out after 5522 milliseconds
> * Closing connection 0
> curl: (28) Connection timed out after 5522 milliseconds

Thanks. Now, can you re-run configure again and add the --enable-debug option?
It adds some extra debugging code and what I'm especially interested it adds
some extra verbose output, like for example the state changes done in multi.c.

The above output is very strange to me since it seems it fails while trying to
resolve the host name. See the bottom of this mail for a comparison with my -v
output.

It would also probably be a good idea to do strace (or whatever similar tool
you have) to get a matching system call trace with the log about or use
--trace-ascii and --trace-time to get time-stamped logging which helps when
you want to correlate multiple logs.

Also, it would be interesting to wireshark/tcpdump the traffic to see what the
gethostbyname is really doing or not doing in this case.

Here's what my command shows (without --enable-debug):

$ ./src/curl --connect-timeout 5 -v www.yahoo.com
* Rebuilt URL to: www.yahoo.com/
* Hostname was NOT found in DNS cache
* Adding handle: conn: 0x14e3da0
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* Trying 98.139.180.149...
* Connected to www.yahoo.com (98.139.180.149) port 80 (#0)
> GET / HTTP/1.1
[cut]

And with configure --enable-debug:

$ ./src/curl --connect-timeout 5 -v www.yahoo.com
* STATE: INIT => CONNECT handle 0xb7e498; line 1012 (connection #-5000)
* Rebuilt URL to: www.yahoo.com/
* Hostname was NOT found in DNS cache
* Adding handle: conn: 0xb93078
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* 0xb7e498 is at send pipe head!
* STATE: CONNECT => WAITRESOLVE handle 0xb7e498; line 1043 (connection #0)
* Trying 98.139.180.149...
* STATE: WAITRESOLVE => WAITCONNECT handle 0xb7e498; line 1104 (connection #0)
* Connected to www.yahoo.com (98.139.180.149) port 80 (#0)
* STATE: WAITCONNECT => DO handle 0xb7e498; line 1178 (connection #0)
> GET / HTTP/1.1

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