curl / Mailing Lists / curl-library / Single Mail


Curl and c-ares block during curl_multi_remove_handle

From: Evgen Bodunov via curl-library <>
Date: Tue, 13 Nov 2018 16:44:09 +0300

Hello everyone.

Please help me find out where I’m wrong. I’m using libcurl 7.62 build with "--disable-shared --enable-debug --enable-ares --enable-ipv6 --with-darwinssl” and libcares build with “--enable-debug --enable-nonblocking”. And I’m using it in iOS application. When I turn on network link conditioner and set dns delay to 15 seconds. It’s stuck in curl_multi_remove_handle.

Stack is following:
* thread #14, name = 'NetworkQueue'
    frame #0: 0x00000001bbb9b350 libsystem_kernel.dylib`__select + 8
    frame #1: 0x0000000103691cd4 GalileoPro`Curl_poll(ufds=0x000000016d975518, nfds=1, timeout_ms=1000) at select.c:526
    frame #2: 0x00000001036a62d4 GalileoPro`waitperform(conn=0x000000010b84c208, timeout_ms=1000) at asyn-ares.c:279
    frame #3: 0x00000001036a65a4 GalileoPro`Curl_resolver_wait_resolv(conn=0x000000010b84c208, entry=0x0000000000000000) at asyn-ares.c:395
    frame #4: 0x00000001036894c4 GalileoPro`multi_done(connp=0x0000000109823818, status=CURLE_OK, premature=true) at multi.c:541
    frame #5: 0x00000001036890d4 GalileoPro`curl_multi_remove_handle(multi=0x0000000105c32c58, data=0x0000000109823808) at multi.c:727
    frame #6: 0x0000000103497bb4 GalileoPro`NetworkQueue::worker(this=0x0000000104356278) at NetworkQueue.cpp:88
  * frame #7: 0x0000000103499cc8 GalileoPro`NetworkQueue::_worker(ptr=0x0000000104356278) at NetworkQueue.cpp:169
    frame #8: 0x00000001bbc1f2ac libsystem_pthread.dylib`_pthread_body + 128
    frame #9: 0x00000001bbc1f20c libsystem_pthread.dylib`_pthread_start + 48
    frame #10: 0x00000001bbc22cf4 libsystem_pthread.dylib`thread_start + 4

I believe something wrong happened when Curl_resolver_wait_resolv called with entry=nullptr and it’s still wait’s for a second just to make sure there is no data yet. This happened when I remove cancelled tasks from curl_multi.

Evgen Bodunov.
Received on 2018-11-13