cURL / Mailing Lists / curl-library / Single Mail

curl-library

ARES

From: Giuseppe Attardi <attardi_at_di.unipi.it>
Date: Sat, 27 Sep 2003 10:38:18 +0200

I have run into another problem with ARES.
When using it cURL crashes within hash.c at the line:

      if (comp(user, he->ptr)) {

with

(gdb) p he
$9 = (curl_hash_element *) 0xf0422000
(gdb) p *he
Cannot access memory at address 0xf0422000
(gdb) p *le
$8 = {ptr = 0xf0422000, prev = 0x4b63f808, next = 0x8}
(gdb) p i
$13 = 1
(gdb) p h.slots
$14 = 7

This is the stack trace:

#0 Curl_hash_clean_with_criterium (h=0x82b4068, user=0x431343ec,
    comp=0x812a464 <hostcache_timestamp_remove>) at hash.c:260
#1 0x0812a4b0 in hostcache_prune (hostcache=0x82b4068, cache_timeout=60,
    now=1064649236) at hostip.c:193
#2 0x0812a55b in cache_resolv_response (data=0x8f29210, addr=0x8fb1660,
    hostname=0x8dbe210 "search.tiscali.it", port=80) at hostip.c:251
#3 0x0812a99b in host_callback (arg=0x82c7098, status=0, hostent=0x8fb1580)
    at hostip.c:513
#4 0x0813c436 in end_hquery (hquery=0x8e4a000, status=0, host=0x8fb1580)
    at ares_gethostbyname.c:145
#5 0x0813c3f5 in host_callback (arg=0x8e4a000, status=0,
    abuf=0x4313459c "ÕH\201\200", alen=254) at ares_gethostbyname.c:134
#6 0x0813e663 in end_squery (squery=0x8f030c0, status=0,
    abuf=0x4313459c "ÕH\201\200", alen=254) at ares_search.c:175
#7 0x0813e63f in search_callback (arg=0x8f030c0, status=0,
    abuf=0x4313459c "ÕH\201\200", alen=254) at ares_search.c:168
#8 0x0813f22b in qcallback (arg=0x8e89608, status=0,
    abuf=0x4313459c "ÕH\201\200", alen=254) at ares_query.c:103
#9 0x0813e396 in end_query (channel=0x8a64ab8, query=0x8a54300, status=0,
    abuf=0x4313459c "ÕH\201\200", alen=254) at ares_process.c:583
#10 0x0813dc3c in read_udp_packets (channel=0x8a64ab8, read_fds=0x4313489c,
    now=1064649236) at ares_process.c:246
#11 0x0813d84e in ares_process (channel=0x8a64ab8, read_fds=0x4313489c,
    write_fds=0x4313481c) at ares_process.c:60
#12 0x0812a7a8 in Curl_is_resolved (conn=0x82c7098, done=0x43134956 "\035")
    at hostip.c:419
#13 0x08129f6b in curl_multi_perform (multi_handle=0x82b2098,
    running_handles=0x43134a44) at multi.c:374

and here are the options I use:

  curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteContentCallback);
  curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, ProcessHeader);
  curl_easy_setopt(curl, CURLOPT_USERAGENT, USER_AGENT);
  curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, CRAWL_TIMEOUT);
  curl_easy_setopt(curl, CURLOPT_TIMEOUT, CRAWL_TIMEOUT*10);
  curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, CRAWL_LOW_SPEED_LIMIT);
  curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, CRAWL_LOW_SPEED_TIME);
  curl_easy_setopt(curl, CURLOPT_PASSWDFUNCTION, PasswdCallback);
  curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);

I am not using

  curl_easy_setopt(curl, CURLOPT_DNS_USE_GLOBAL_CACHE, 1);

Is this correct?

-- Beppe

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-09-27