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.

Re: Name resolution timeout not respected, Curl_resolver_kill() hangs.

From: Woody via curl-library <curl-library_at_lists.haxx.se>
Date: Thu, 18 Nov 2021 07:59:02 +0100

Timothe Litt via curl-library <curl-library_at_lists.haxx.se> wrote:
> On 16-Nov-21 17:24, Daniel Stenberg via curl-library wrote:
>
> > On Tue, 16 Nov 2021, Woody wrote:
> >
> >> In case of error, couldn't we somehow "detach" the thread instead of
> >> skipping the join()? Would it not be cleaner?
> >
> > I suppose this is where my inexperience with thread programming shines
> > through, but yes, I think that sounds exactly what we need!
> >
> If you detach a thread, you need to take care that it doesn't hold any pointers to stack or heap variables in the parent that might be deallocated before the detached thread terminates.  If you miss this, you end up with a (usually difficult to debug) bit spray.
> ...
> Fixing this would be a good thing, but care is required to ensure that the cure isn't worse than the disease.

In the next days I'm going to look into the code to see where the thread is
created and look for a way to cleanly detach it (at least I will try to
understand if it's possible without a mighty effort). I'll keep you informed.

--
Best regards.
Woody from WiBu Systems AG.
-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2021-11-18