curl / Mailing Lists / curl-library / Single Mail

curl-library

curl_multi_perform sometimes does not return while its thread uses1 00% cpu resources

From: <h9791521_at_docomo.ne.jp>
Date: Tue, 11 Dec 2018 16:53:18 +0900

Hello

When I call curl_multi_perform, it sometimes does not return while its thread uses 100% cpu resources.
It happenes sometimes, not always.
I use libcurl 7.59.0 on windows.

Here are the call stack I got when the event occurred.

[ 0]0x45c122fc - (libcurl.dll + 0x000222fc) 0001:000212b8 add_next_timeout 100222b8 f multi.obj
[ 1]0x45c14eb0 - (libcurl.dll + 0x00024eb0) 0001:00023df4 curl_multi_perform 10024df4 f multi.obj
[ 2]0x45c0ce4c - (libcurl.dll + 0x0001ce4c) 0001:0001bd70 easy_transfer 1001cd70 f easy.obj
[ 3]0x45c0cf88 - (libcurl.dll + 0x0001cf88) 0001:0001beac easy_perform 1001ceac f easy.obj

[ 0]0x45c1972c - (libcurl.dll + 0x0002972c) 0001:00028700 Curl_splaygetbest 10029700 f splay.obj
[ 1]0x45c14eb0 - (libcurl.dll + 0x00024eb0) 0001:00023df4 curl_multi_perform 10024df4 f multi.obj
[ 2]0x45c0ce4c - (libcurl.dll + 0x0001ce4c) 0001:0001bd70 easy_transfer 1001cd70 f easy.obj
[ 3]0x45c0cf88 - (libcurl.dll + 0x0001cf88) 0001:0001beac easy_perform 1001ceac f easy.obj

Apparantly the libcurl gets in the loop.

curl\lib\multi.c
curl_multi_perform
 do {
   multi->timetree = Curl_splaygetbest(now, multi->timetree, &t);
   if(t)
     /* the removed may have another timeout in queue */
     (void)add_next_timeout(now, multi, t->payload);

 } while(t);

I searched the curl-library archive, and I found a similar issue, but it was already fixed in 7.59.0.
I suspect &t will never get to NULL for some reason.

https://curl.haxx.se/mail/lib-2017-10/0011.html
The loop happens on systems where time_t is defined to an unsigned type.

Does anybody know how to avoid this or any workaround on this issue?

Best Regards,
TOSHI

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2018-12-11