cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Crash during gethostbyname in libcurl

From: Sebastien Trottier <strot_at_paraxip.com>
Date: Thu, 15 Mar 2007 16:55:50 -0400

Hi Daniel,
Is the memset fix you mentioned in your first response for this thread the
change from "memset(tsd, 0, sizeof(tsd));" to "memset(tsd, 0,
sizeof(*tsd));" in hostthre.c::init_thread_sync_data() ? Do you think it
could be related to the reported crash? From what I see, the only effect the
invalid size for the memset before could have is to trigger calls to
CloseHandle() on an invalid handle in case the DuplicateHandle() calls in
init_thread_sync_data() fails.

The crash looks more like a synchronization issue between the asynchronous
IPv4 resolver on win32 and the client thread. We are not using the "share"
interface and the dns host cache is protected by mutex only when using a
share. Could the nullification of the dns hostcache in
curl_multi_remove_handle() happen at the same time that the callback
(addrinfo_callback) from the resolver thread try to insert the newly
resolved hostname?

My impression is that curl_multi_remove_handle() can be called at any time
when using the multi interface to abort a transfer. I'm going to try to
reproduce the problem in our lab.

Thanks for your help and for your work,
Seb

> -----Original Message-----
> From: Daniel Stenberg [mailto:daniel_at_haxx.se]
> Sent: Wednesday, March 14, 2007 5:36 PM
> To: strot_at_paraxip.com; libcurl development
> Subject: Re: Crash during gethostbyname in libcurl
>
>
> On Wed, 14 Mar 2007, Sebastien Trottier wrote:
>
> > Our product uses libcurl 7.15.4 and one of our customer got a
> crash with the
> > same exact stack trace then the one reported by Rom Walton on
> Jan 10, 2007.
>
> [...]
>
> > Anybody had a chance to isolate the problem? I don't see any
> mention of it
> > in the known bugs list or release notes.
>
> Right, we never got any further responses in that thread so I
> guess the bug
> isn't appearing in later versions, he fixed it but never told us
> or perhaps he
> jumped ship.
>
> My suggestion from then still stands, and trying a later version
> also makes
> sense.
>
> --
> Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.446 / Virus Database: 268.18.11/721 - Release Date:
> 3/13/2007 4:51 PM
>
Received on 2007-03-15