curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Multi Threaded Resolver Hanging on Application Shutdown

From: Tanner, Matt via curl-library <curl-library_at_cool.haxx.se>
Date: Thu, 24 Jun 2021 14:53:16 +0000

We have a multi-threaded embedded linux application that uses curl 7.76.1 for https client requests with easy handles and the multi threaded resolver (AsynchDNS feature). We're seeing intermittent hangs in curl during application shut-down. Its in the resolver. I was wondering if any obvious mis-uses of the library jumped out for anyone, or known bugs. Here is the last few calls on the stack:

__GI___pthread_timedjoin_ex() at pthread_join_common.c:84 0x36f9587c
Curl_thread_join() at 0x36ba1bd4
destroy_async_data.isra() at 0x36b987a8
Curl_resolver_is_resolved() at 0x36b98bf4
multi_runsingle() at 0x36bc3d5c
curl_multi_perform() at 0x36bc46d8

We are setting CURLOPT_NOSIGNAL to 1.
I have confirmed curl_global_cleanup is not being called prematurely.
There are legacy areas of our app that do not use curl and are calling getaddrinfo directly in other threads. Could that be a problem?
Its possible we could try the c-ares backend, but I need to try and get a feel for the root cause before starting the process of adding another third-party library.

Thanks in advance for any help!
Matthew Tanner




-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.se/mail/etiquette.html
Received on 2021-06-24