cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Windows RPC server busy. Libcurl Multithreading issues.

From: Gisle Vanem <giva_at_bgnett.no>
Date: Wed, 19 Jan 2005 11:05:29 +0100

"Jim N" wrote:

> Well, I've isolated the file and the error. The error occurs in file
> "dbgheap.c" on line 448 (See below):
>
> memset((void *)pbData(pHead), _bCleanLandFill, nSize);
>
> Here is a copy of the stack:
>
>> msvcr71d.dll!_heap_alloc_dbg(unsigned int nSize=2012580337, int
> nBlockUse=1310720, const char * szFileName=0x40000060, int
> nLine=2012581569) Line 448 + 0x18 C
> ntdll.dll!77f84cd3()
> mswsock.dll!71a5398b()

Looks to me your *program* has messed up some of the heap-structures.
Try to rebuild everything after putting this after <malloc.h>
  #define _CRTDBG_MAP_ALLOC
  #include <crtdbg.h>

This should give more details on bad pointers etc. And when the problem
(crash) still remains when you have switched to c-ares, tells me the problem
isn't in gethostbyname_thread.

> I used the latest version of curl-7.12.3. Compiled it normally with VC in
> Debug mode. Then used the libcurl in my multi-threaded program. If one
> thread is used works great. But at 50 threads it causes an exception
> every second or so.

I hope you've used the proper 'cl' flags; -MDd or -MTd (-ML/-MLd are not
thread-safe).

--gv
Received on 2005-01-19