cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: threading problem on windows

From: Gisle Vanem <giva_at_bgnett.no>
Date: Sun, 4 Jul 2004 13:10:22 +0200

"Michael Mastroianni" said:

> When I run a lot of threads (like 150), I get blowups in
>
> gethostbyname_thread in hostthre.c
>
> in particular, I blow up on the line:
>
> he = gethostbyname (conn->async.hostname);

You mean it is NULL or some huge illegal value? I don't see how
that can happen. The get*_thread() functions doesn't modify that
string at all. Unless someone else stepping on 'conn->async'.

Do you have an example program I could try?

> I got c-ares, built it, gave my curllib project the directories, told it
> to link against libares.lib, and defined USE_ARES in the project settings.
> Still, I end up here.

That shouldn't happen; USE_THREAD_GET* isn't defined unless you defined
it outside setup.h youself. Looks like your debugger isn't giving you the true
story or the bug is elsewhere.

Try to build libcurl with -DCURLDEBUG and watch for allocation errors.
Look at src/main.c and curl_memdebug("memdump") for how that's done.

--gv
Received on 2004-07-04