cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[ curl-Bugs-3145445 ] segfault when adding entry to cache

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Mon, 27 Dec 2010 09:15:03 +0000

Bugs item #3145445, was opened at 2010-12-26 23:16
Message generated for change (Comment added) made by bagder
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3145445&group_id=976

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: name resolving/DNS
Group: crash
>Status: Closed
Resolution: Accepted
Priority: 5
Private: No
Submitted By: Pedro Larroy (plarroy)
Assigned to: Daniel Stenberg (bagder)
Summary: segfault when adding entry to cache

Initial Comment:
(gdb) bt
#0 0x000000000040ab68 in Curl_hash_add (h=0x0, key=0x974c5e8, key_len=15, p=0x26c1698) at hash.c:149
#1 0x00000000004148ed in Curl_cache_addr (data=0x9a2bd78, addr=0x3866478, hostname=0x26c1428 "zeldman.com", port=80) at hostip.c:359
#2 0x0000000000411366 in Curl_addrinfo_callback (conn=0x26c0b78, status=24, ai=0x0) at hostasyn.c:155
#3 0x0000000000410e66 in ares_query_completed_cb (arg=0x26c0b78, status=24, timeouts=0, hostent=0x0) at hostares.c:339
#4 0x000000000045dfe3 in end_hquery (hquery=0x26c1520, status=24, host=0x0) at ares_gethostbyname.c:230
#5 0x000000000045dd81 in next_lookup (hquery=0x26c1520, status_code=24) at ares_gethostbyname.c:174
#6 0x000000000045dfa2 in host_callback (arg=0x26c1520, status=24, timeouts=0, abuf=0x0, alen=0) at ares_gethostbyname.c:224
#7 0x0000000000465e59 in qcallback (arg=0x2859430, status=24, timeouts=0, abuf=0x0, alen=0) at ares_query.c:151
#8 0x000000000045d55d in ares_cancel (channel=0x9a511c0) at ares_cancel.c:38
#9 0x000000000042cc9c in Curl_done (connp=0x974c640, status=CURLE_OPERATION_TIMEDOUT, premature=false) at url.c:5215
#10 0x000000000040bbff in curl_multi_remove_handle (multi_handle=0x68dc98, curl_handle=0x9a2bd78) at multi.c:684
#11 0x000000000040652a in check_multi_info (g=0x7fffffffdcd0) at hiperfifo.c:150
#12 0x000000000040660f in event_cb (fd=52, kind=2, userp=0x7fffffffdcd0) at hiperfifo.c:173
#13 0x00007ffff7745344 in event_base_loop () from /usr/lib/libevent-1.4.so.2
#14 0x0000000000407068 in main (argc=1, argv=0x7fffffffded8) at hiperfifo.c:405

(gdb) up
#1 0x00000000004148ed in Curl_cache_addr (data=0x9a2bd78, addr=0x3866478, hostname=0x26c1428 "zeldman.com", port=80) at hostip.c:359
359 dns2 = Curl_hash_add(data->dns.hostcache, entry_id, entry_len+1,
(gdb) p data->dns.hostcache
$1 = (struct curl_hash *) 0x0
(gdb)

curl was 9f64bbd
c-ares was 766a5aa

curl built with:
--enable-debug
--enable-ares=[..]
--prefix=[...]
--disable-ldap
--without-libssh2

c-ares:
--enable-debug
--prefix=[...]

Reproducing:
with hiperfifo with the following patch:
diff --git a/docs/examples/hiperfifo.c b/docs/examples/hiperfifo.c
index a885c0c..b7e45dd 100644
--- a/docs/examples/hiperfifo.c
+++ b/docs/examples/hiperfifo.c
@@ -316,6 +316,9 @@ static void new_conn(char *url, GlobalInfo *g )
   curl_easy_setopt(conn->easy, CURLOPT_NOPROGRESS, 0L);
   curl_easy_setopt(conn->easy, CURLOPT_PROGRESSFUNCTION, prog_cb);
   curl_easy_setopt(conn->easy, CURLOPT_PROGRESSDATA, conn);
+ curl_easy_setopt(conn->easy, CURLOPT_CONNECTTIMEOUT, 30);
+ curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_TIME, 60);
+ curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_LIMIT, 512);
   fprintf(MSG_OUT,
           "Adding easy %p to multi %p (%s)\n", conn->easy, g->multi, url);
   rc = curl_multi_add_handle(g->multi, conn->easy);

feed hiperfifo with the following urls:

zcat feds.txt.gz > hiper.fifo

And thus reproduce.

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2010-12-27 10:15

Message:
Thanks for the report, this problem is now fixed in the git repository.

To try it out, you either checkout/update your git clone:
http://curl.haxx.se/source.html

or you try tomorrow's daily snapshot: http://curl.haxx.se/snapshots/

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2010-12-26 23:47

Message:
Thanks, I've managed to repeat it and I have some ideas of what might be
the cause...

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3145445&group_id=976
Received on 2010-12-27

These mail archives are generated by hypermail.

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

File upload with ASP.NET