cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Windows RPC server busy. Libcurl Multithreading issues.

From: Jim N <jim_at_bluedojo.com>
Date: Tue, 18 Jan 2005 16:43:48 -0800 (PST)

Daniel,

> The debugger shows some error in some heap allocation/deallocation routine.

You said:

Do you happen to have any more details?

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()
.
.
.
kernel32.dll!77e79d58()
libcurl.dll!_CrtIsValidHeapPointer(const void * pUserData=0x0034799b)
Line 1807 C
kernel32.dll!77e79d58()
libcurl.dll!gethostbyname_thread(void * arg=0x003df198) Line 203 + 0x12 C
libcurl.dll!_threadstartex(void * ptd=0x003dfd80) Line 241 + 0xd C
kernel32.dll!77e802ed()
ntdll.dll!77f588ad()

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'm trying out some of your suggestions and I've download libcurl 7.12.3
> and built it in VC. I didn't use Ares as an option yet (since Gisle
> mentioned it should me working since 7.12.2)
>
> It still causes an exception in the file "hostthre.c" at line 189 in the
> function "gethostbyname_thread()" See below:
>
> static unsigned __stdcall gethostbyname_thread (void *arg)
> {
> struct connectdata *conn = (struct connectdata*) arg;
> struct thread_data *td = (struct thread_data*) conn->async.os_specific;
> struct hostent *he;
> int rc = 0;
>
> /* Duplicate the passed mutex handle.
> * This allows us to use it even after the container gets destroyed
> * due to a resolver timeout.
> */
> HANDLE mutex_waiting = NULL;
> if (!DuplicateHandle(GetCurrentProcess(), td->mutex_waiting,
> GetCurrentProcess(), &mutex_waiting, 0, FALSE,
> DUPLICATE_SAME_ACCESS)) {
> //**************
> EXCEPTION OCCURS HERE!
> "First-chance exception at 0x77e6d756 in Program.exe: 0x000006BB: The RPC
> server is too busy to complete this operation."
> *****************//
> /* failed to duplicate the mutex, no point in continuing */
> return 0;
> }
>
>
> I am going to try and use Ares tonite if I have time. I am actually on
> lunch break at home working on this since this is not a work related
> project. I'm new to this email list so hopefully this email works
> correctly, since I've had a little trouble emailing to the list.
>
> Thanks.
>
>> As I said, my test program works just fine with a standard windows build
>> Of 7.12.3, so I think it was fixed :)
>>
>>
>>
>> -----Original Message-----
>> From: curl-library-bounces_at_cool.haxx.se
>> [mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Gisle Vanem
>> Sent: Tuesday, January 18, 2005 8:54 AM
>> To: libcurl development
>> Subject: Re: Windows RPC server busy. Libcurl Multithreading issues.
>>
>> "Michael Mastroianni" wrote:
>>
>>> With 7.12.0, not using Ares, it would blow up every time.
>>
>> The threaded resolver code was hopefully fixed in 7.12.2 by
>> Traian Nicolescu's patches.
>>
>> --gv
>>
>
Received on 2005-01-19