cURL / Mailing Lists / curl-library / Single Mail

curl-library

libcurl with pthreads-win Was: what is the best way to preform http post request every N seconds endlessly

From: Yang Tse <yangsita_at_gmail.com>
Date: Fri, 4 Apr 2008 20:25:17 +0200

2008/4/2, Meir Yanovich wrote:

> im working with pthreads and the http request is invoked in separate
> thread the problem is
> that when im using threads when it comes to execute the cUrl api
> "curl_easy_perform"
> im getting error ( the one kind that just to the assembly ) and the
> call stuck looks like this :
> NTDLL! 77fa144b()
> NTDLL! 77fb6bcc()
> NTDLL! 77f81d44()
> KERNEL32! 7c4fb252()
> _CrtIsValidHeapPointer(const void * 0x00992dc0) line 1606
> _free_dbg_lk(void * 0x00992dc0, int 1) line 1011 + 9 bytes
> _free_dbg(void * 0x00992dc0, int 1) line 970 + 13 bytes
> free(void * 0x00992dc0) line 926 + 11 bytes
> destroy_thread_sync_data(thread_sync_data * 0x00b9ff70) line 183 + 15 bytes
> gethostbyname_thread(void * 0x00881140) line 321 + 9 bytes
> _threadstartex(void * 0x00882cd0) line 212 + 13 bytes
> KERNEL32! 7c4e987c()

Since there is a call to gethostbyname_thread() this indicates that
you've built libcurl with the "Windows threaded name resolver" which
is the default configuration. This implies that some Windows native
thread functions will be used when resolving hosts.

Mixing Windows native thread functions with pthreads-win's threads in
the same executable might be generating the error you've stack traced.

You can get rid of the Windows native thread function calls building
libcurl with c-ares which should be safer when using pthreads-win.
Otherwise you'll have to get your sleeves up and dig into libcurl's
hostthre.c and all the pthreads-win code.

-- 
-=[Yang]=-
Received on 2008-04-04