cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Questions on using the curl multi interface(som clarification)

From: lali .cpp <lali.cpp_at_gmail.com>
Date: Sun, 5 Sep 2010 11:33:05 +0530

>> CURLOPT_CONNECTTIMEOUT does not really work for the multi interface in
any released libcurl version. We're working on making sure it works
correctly for the next release.

Thanks a lot for this information. Does CURLOPT_TIMEOUT_MS work for multi
interface?

The reason for asking these questions is my application is randomly crashing
and I am guessing that the way I am using libcurl is incorrect. Here are the
backtraces of 3 crashes :-

(gdb) bt
#0 0x0000001d in ?? ()
#1 0x00bc0c84 in Curl_llist_remove (list=0x22fdf558, e=0x37974620,
user=0x22fded98) at llist.c:116
#2 0x00bc1272 in Curl_hash_clean_with_criterium (h=0x22fded98,
user=0x4e842c90,
    comp=0xba21f0 <hostcache_timestamp_remove>) at hash.c:258
#3 0x00ba2272 in Curl_hostcache_prune (data=0x2233e590) at hostip.c:239
#4 0x00bb0455 in Curl_disconnect (conn=0x2ccb6198) at url.c:2186
#5 0x00bb4294 in Curl_connect (data=0x2233e590, in_connect=0x3618c5dc,
asyncp=0x4e8434b6, protocol_done=0x4e8434b7)
    at url.c:2545
#6 0x00bc2436 in multi_runsingle (multi=0x2a65e370, easy=0x3618c5d0) at
multi.c:926
#7 0x00bc2b25 in curl_multi_perform (multi_handle=0x2a65e370,
running_handles=0x4e844164) at multi.c:1475

(gdb) bt
#0 0x001807a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1 0x003dd825 in raise () from /lib/tls/libc.so.6
#2 0x003df289 in abort () from /lib/tls/libc.so.6
#3 0x003d6da1 in __assert_fail () from /lib/tls/libc.so.6
#4 0x00d4a12d in Curl_resolv_unlock (data=0x9e21bdc, dns=0x33349004) at
hostip.c:678
#5 0x00d62cbc in Curl_done (connp=0xa054ec8, status=CURLE_OK,
premature=false) at url.c:4791
#6 0x00d777e9 in multi_runsingle (multi=0x37bd2604, easy=0xa054ebc) at
multi.c:1396
#7 0x00d77a19 in curl_multi_perform (multi_handle=0x37bd2604,
running_handles=0x62972fc4) at multi.c:1509

(gdb) bt
#0 0x0044c7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1 0x0048d8c5 in raise () from /lib/tls/libc.so.6
#2 0x0048f329 in abort () from /lib/tls/libc.so.6
#3 0x004c1dca in __libc_message () from /lib/tls/libc.so.6
#4 0x004c87cf in _int_free () from /lib/tls/libc.so.6
#5 0x004c8c4a in free () from /lib/tls/libc.so.6
#6 0x00a76b74 in Curl_safefree (ptr=0x36e8c5b0) at url.c:283
#7 0x00a77190 in conn_free (conn=0x39300010) at url.c:2141
#8 0x00a7752b in Curl_disconnect (conn=0x314fab40) at url.c:2254
#9 0x00a7b294 in Curl_connect (data=0x36eb17c0, in_connect=0x34103e04,
asyncp=0x87d288d6, protocol_done=0x87d288d7)
    at url.c:2545
#10 0x00a89436 in multi_runsingle (multi=0x360c1960, easy=0x34103df8) at
multi.c:926
#11 0x00a89b25 in curl_multi_perform (multi_handle=0x360c1960,
running_handles=0x87d28f84) at multi.c:1475

(The application functions are removed from the call trace as they would
make no sense)

As you can see that all these crashes originate from curl_multi_perform.

Can you give any hints, pointers etc? These crashes occur randomly,
sometimes in 2 days and sometimes after a week etc. Please note that I am
also using c-ares.

As you have mentioned CURLOPT_CONNECTTIMEOUT_MS doesn't work with multi
interface, so I will remove this option from easy handle. I was also setting
CURLOPT_TIMEOUT_MS(75ms) on the easy handles before adding these handles in
the multihandle(Sorry I didn't mention this in my last post). Can these
options be one of the possible causes of crashes?

As of now I am just shooting in the dark, looking for your help.

Thanks a lot for your prompt replies. Thank you very much :)

Regards
lali

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-09-05