cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Mysterious random crash demystified.

From: Gisle Vanem <giva_at_bgnett.no>
Date: Mon, 11 Oct 2004 16:25:35 +0200

<traian_at_burstcopy.com> wrote:

> 3. If the resolver thread exits from gethostbyname() [line 186 of
> hostthre.c] _AFTER_ the timeout has already caused my curl_easy_perform()
> to exit, and I have implicitly also called curl_easy_cleanup, it will
> crash with an access violation by trying to callback through
> Curl_addrinfo4_callback() with a by-now invalid conn parameter.
 
In that case one must fore the thread to stop. Try if this helps:

--- hostthre.c 6 Oct 2004 07:50:18 -0000 1.13
+++ hostthre.c 11 Oct 2004 14:11:41 -0000
@@ -360,6 +360,7 @@

   TRACE(("elapsed %lu ms\n", GetTickCount()-ticks));

+ TerminateThread(td->thread_hnd, 1);
   CloseHandle(td->thread_hnd);

   if(entry)

That should probably be added to Curl_close() somehow.

--gv
Received on 2004-10-11