cURL / Mailing Lists / curl-library / Single Mail

curl-library

crash of statically linked libcurl on windows

From: Serge Skorokhodov <ucayalyfish_at_gmail.com>
Date: Tue, 31 Jul 2007 21:02:50 +0400

Hi,

I'm using libcurl+libcurlpp in a Win32 service that uses HTTPS. If I
build the app with static libcurl, then errors of freeing bad memory
blocks appear systematically. Here is the example of stack trace from
the debugger:

msvcr71d.dll!_CrtIsValidHeapPointer(const void * pUserData=0x01d6ba68)
 Line 1807 C
         msvcr71d.dll!_free_dbg_lk(void * pUserData=0x01d6ba68, int
nBlockUse=1) Line 1132 + 0x9 C
         msvcr71d.dll!_free_dbg(void * pUserData=0x01d6ba68, int nBlockUse=1)
 Line 1070 + 0xd C
         msvcr71d.dll!free(void * pUserData=0x01d6ba68) Line 1025 + 0xb C
         Pay.exe!Curl_safefree(void * ptr=0x01d6ba68) Line 210 + 0xc C
         Pay.exe!CreateConnection(SessionHandle * data=0x02060068,
connectdata * * in_connect=0x0225c58c, Curl_dns_entry * *
addr=0x0225c500, unsigned char * async=0x0225c53f) Line 3826 + 0xf C
         Pay.exe!Curl_connect(SessionHandle * data=0x02060068, connectdata *
* in_connect=0x0225c58c, unsigned char * asyncp=0x0225c53f, unsigned
char * protocol_done=0x0225c533) Line 4154 + 0x15 C
         Pay.exe!Curl_connect_host(SessionHandle * data=0x02060068,
connectdata * * conn=0x0225c58c) Line 2320 + 0x15 C
         Pay.exe!Curl_perform(SessionHandle * data=0x02060068) Line 2411 + 0xd C
         Pay.exe!curl_easy_perform(void * curl=0x02060068) Line 492 + 0x9 C

It seems that _CrtIsValidHeapPointer considers the pointer to come
from another heap.:(

I've tried libcurl versions 7.15.3, 7.16.3 and 7.16.4 and checked
twice that both my application and libcurl use the same runtime
library and other code generation/C++ language settings. I suspect
that remnants of MFC left in this legacy service application can play
a role but failed to reproduce errors in a smaller app.

Switching to libcurl dll eliminates the errors.

Any suggestions?

TIA

-- 
The fish that is singing in Ucayaly river...
Received on 2007-07-31