cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: static link libcurl with VS2010 causes crash

From: Gisle Vanem <gvanem_at_broadpark.no>
Date: Tue, 21 Feb 2012 09:39:11 +0100

"JonathonS" <thejunkjon_at_gmail.com> wrote:

> stack below of the crash.
>
> msvcr100d.dll!_free() + 0x10 bytes
> xx.dll!destroy_async_data(Curl_async * async=0x003f2aa0) Line 326 + 0xe bytes C

What excactly is it trying to free? Who allocated the data? You must
make sure that the allocator and the code that does the free() uses the
same C-runtime. Same rule applies to passing 'FILE*' pointers between
such boundaries.

> I made sure to build everything using the same runtimes (/MD runtimes
> as DLL).

Did you make sure to build OpenSSL with '/MD' too?
You could try to run under WinDbg and trace your program (command
'wt' if I remember correctly).

> I am all out of ideas on what could be wrong with my build
> of libcurl. I am statically linking both openssl and libcurl which I
> built myself.

Statically or dynamically linking should make no difference regarding
the rules of passing pointers between boundaries.

--gv
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-02-21