Discussion:
curl_easy_perform sometimes does not return while its thread uses10 0% cpu resources
"h9791521@docomo.ne.jp" via curl-library
2018-12-07 07:28:15 UTC
Permalink
Hello all

please help me.

I'm writing windows application that connects to the internet.
When I call curl_easy_perform, it sometimes does not return while its thread use 100% cpu resources.
It happenes sometimes, not always.

Does anybody know how to fix this issue?
I use libcurl 7.59.0 on windows.
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://cur
James Fuller via curl-library
2018-12-07 08:22:56 UTC
Permalink
pls provide more information

* example code showing usage (is it just a single curl_easy_perform or
are you doing parallel requests eg. curl_multi_select?)
* have you tried to simplify your code that illustrates problem ?
* version of windows
* have you checked network latency eg. no network issues ?

thanks Jim
Post by "***@docomo.ne.jp" via curl-library
Hello all
please help me.
I'm writing windows application that connects to the internet.
When I call curl_easy_perform, it sometimes does not return while its thread use 100% cpu resources.
It happenes sometimes, not always.
Does anybody know how to fix this issue?
I use libcurl 7.59.0 on windows.
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://c
"h9791521@docomo.ne.jp" via curl-library
2018-12-11 07:53:18 UTC
Permalink
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

Loading...