cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Ares Issue, Please Help!

From: Dirk Manske <dm_at_sysformance.com>
Date: Tue, 30 Mar 2004 18:06:13 +0200

On Tuesday 30 March 2004 10:11, Daniel Stenberg wrote:
> On Mon, 29 Mar 2004, Roy Shan wrote:
>
> > After adding debugging code as you advised, I did observe that handles got
> > stuck in the state of CURLM_STATE_WAITRESOLVE.
>
> Ok, having that verified it is pretty obvious that we don't handle name lookup
> timeouts properly in there. I was naively assuming that ares took care of
> those automatically.
There is another problem, I've notice that I get timeouts where the timeout time isn't
really reached.

Valgrind found a bug (using cvs versions of curl and c-ares of today 040330 ~17:05 CEST):

==884== Thread 2:
==884== Syscall param socketcall.recv(args) contains uninitialised or unaddressable byte(s)
==884== at 0x3C195812: recv (in /lib/libc-2.2.5.so)
==884== by 0x3C03F517: read_tcp_data (ares_process.c:190)
==884== by 0x3C03F2CA: ares_process (ares_process.c:64)
==884== by 0x3C027205: Curl_wait_for_resolv (hostip.c:653)
==884== Address 0x3C5D4C40 is on thread 2's stack

After that curl_easy_perform returns with "error 28: Resolving host timed out: <snip>"
followed by some more errors (maybe one bug) :

==884== Invalid write of size 1
==884== at 0x3C02734E: host_callback (hostip.c:706)
==884== by 0x3C03DEE4: end_hquery (ares_gethostbyname.c:149)
==884== by 0x3C03DEB4: host_callback (ares_gethostbyname.c:141)
==884== by 0x3C04007E: end_squery (ares_search.c:178)
==884== Address 0x3CAC16C0 is 1920 bytes inside a block of size 1932 free'd
==884== at 0x3C01C83F: free (vg_replace_malloc.c:127)
==884== by 0x3C02F15A: Curl_disconnect (url.c:1386)
==884== by 0x3C027318: Curl_wait_for_resolv (hostip.c:680)
==884== by 0x3C0398DA: Curl_perform (transfer.c:1917)
==884==
==884== Invalid write of size 4
==884== at 0x3C027355: host_callback (hostip.c:707)
==884== by 0x3C03DEE4: end_hquery (ares_gethostbyname.c:149)
==884== by 0x3C03DEB4: host_callback (ares_gethostbyname.c:141)
==884== by 0x3C04007E: end_squery (ares_search.c:178)
==884== Address 0x3CAC16C4 is 1924 bytes inside a block of size 1932 free'd
==884== at 0x3C01C83F: free (vg_replace_malloc.c:127)
==884== by 0x3C02F15A: Curl_disconnect (url.c:1386)
==884== by 0x3C027318: Curl_wait_for_resolv (hostip.c:680)
==884== by 0x3C0398DA: Curl_perform (transfer.c:1917)
==884==
==884== Invalid write of size 4
==884== at 0x3C0273D3: host_callback (hostip.c:730)
==884== by 0x3C03DEE4: end_hquery (ares_gethostbyname.c:149)
==884== by 0x3C03DEB4: host_callback (ares_gethostbyname.c:141)
==884== by 0x3C04007E: end_squery (ares_search.c:178)
==884== Address 0x3CAC16BC is 1916 bytes inside a block of size 1932 free'd
==884== at 0x3C01C83F: free (vg_replace_malloc.c:127)
==884== by 0x3C02F15A: Curl_disconnect (url.c:1386)
==884== by 0x3C027318: Curl_wait_for_resolv (hostip.c:680)
==884== by 0x3C0398DA: Curl_perform (transfer.c:1917)

I'm going to investigate this later this evening.

Bye,
Dirk
Received on 2004-03-30