JCDUS | 1 Feb 2006 09:07
Picon
Favicon

Integration in a DLL

Hi,

I made a DLL that sends HTTP POST requests using
LibCurl, but it seems like there's a problem as when I
try to call the exported functions from within my .Exe,
I get some EAccessViolations exceptions.

If I integrate the same functions in my app',
everything is allright.

I also integrated my functions in a "self-made"
libcurl, and I can use this DLL with success.

Have you got any idea why I can't use the DLL that
loads the libcurl DLL ?

thanks

P.S. : I use Libcurl 7.15.1 with Borland C++ Builder 6

	

	
		
___________________________________________________________________________ 
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour
appeler la France et l'international.
Téléchargez sur http://fr.messenger.yahoo.com

(Continue reading)

Rathi, Dinesh | 1 Feb 2006 11:44

Issue with ssl

Hi

            I am trying to make Post requests over https (using libcurl) but getting error “Unknown SSL protocol error in connection to <servername>:443”. I created a simple test application with libcurl and am able to make the post request and see response, however in my integrated application this unknown error comes. I am using libcurl-7.15.1 on AIX 5.

 

Any clue, what could be wrong. I switched on the verbose logging of curl and could see that my simple test application proceeds after connecting, verifies the cert etc. However my integrated application fails.

 

Thanks

Dinesh

oussema masmoudi | 1 Feb 2006 11:54
Picon
Favicon

Memory leak in libcurl

Hello everybody,
 
I use the 7.14.1 version of libcurl. Unfortunately I have memory leak problem related to the use of this library.
 
In more details, I use the easy interface. And after performing the download, I call the curl_easy_cleanup function. This is the only function I called to free resources allocated by libcurl?
 
In the memdump file, I have obtained:
 
FREE ERROR: No memory allocated: MEM http.c:935 free(0x81b2874)
FREE ERROR: No memory allocated: MEM url.c:185 free(0x81b27f4)
FREE ERROR: No memory allocated: MEM url.c:185 free(0x81b26ac)
FREE ERROR: No memory allocated: MEM url.c:185 free(0x81b2bc4)
FREE ERROR: No memory allocated: MEM url.c:185 free(0x81b24dc)
Close without open: FD url.c:1535 sclose(11)
FREE ERROR: No memory allocated: MEM url.c:185 free(0x81b2734)
FREE ERROR: No memory allocated: MEM url.c:185 free(0x81b2824)
FREE ERROR: No memory allocated: MEM url.c:185 free(0x81b23cc)
FREE ERROR: No memory allocated: MEM url.c:185 free(0x81a9b5c)
FREE ERROR: No memory allocated: MEM url.c:185 free(0x81b266c)
FREE ERROR: No memory allocated: MEM sslgen.c:138 free(0x81a9b1c)
FREE ERROR: No memory allocated: MEM url.c:1562 free(0x81b207c)
FREE ERROR: No memory allocated: MEM llist.c:130 free(0x81a989c)
FREE ERROR: No memory allocated: MEM llist.c:130 free(0x81a98bc)
FREE ERROR: No memory allocated: MEM llist.c:130 free(0x81a98dc)
FREE ERROR: No memory allocated: MEM hash.c:57 free(0x81b262c)
FREE ERROR: No memory allocated: MEM hostip4.c:109 free(0x81b4924)
FREE ERROR: No memory allocated: MEM hostip.c:497 free(0x81b25ec)
FREE ERROR: No memory allocated: MEM hash.c:61 free(0x81b260c)
FREE ERROR: No memory allocated: MEM llist.c:117 free(0x81b264c)
FREE ERROR: No memory allocated: MEM llist.c:130 free(0x81a98fc)
FREE ERROR: No memory allocated: MEM llist.c:130 free(0x81a991c)
FREE ERROR: No memory allocated: MEM llist.c:130 free(0x81a993c)
FREE ERROR: No memory allocated: MEM llist.c:130 free(0x81a995c)
FREE ERROR: No memory allocated: MEM hash.c:229 free(0x81a986c)
FREE ERROR: No memory allocated: MEM hash.c:264 free(0x81a7e74)
FREE ERROR: No memory allocated: MEM sslgen.c:345 free(0x81a997c)
FREE ERROR: No memory allocated: MEM url.c:185 free(0x81b268c)
FREE ERROR: No memory allocated: MEM url.c:225 free(0x81b284c)
FREE ERROR: No memory allocated: MEM url.c:185 free(0x81a84e4)
FREE ERROR: No memory allocated: MEM http_digest.c:447 free(0x81b277c)
FREE ERROR: No memory allocated: MEM http_digest.c:451 free(0x81a9afc)
FREE ERROR: No memory allocated: MEM http_digest.c:455 free(0x81b2754)
FREE ERROR: No memory allocated: MEM http_digest.c:463 free(0x81b27dc)
FREE ERROR: No memory allocated: MEM http_digest.c:467 free(0x81b27c4)
FREE ERROR: No memory allocated: MEM url.c:260 free(0x81a7e4c)
FREE ERROR: No memory allocated: MEM url.c:273 free(0x81a9cd4)
Leak detected: memory still allocated: 36521 bytes
At 81a89bc, there's 17 bytes.
 allocated by http_digest.c:118
At 81d996c, there's 12 bytes.
 allocated by llist.c:66
At 81d9314, there's 340 bytes.
 allocated by sslgen.c:508
At 81d9a54, there's 8 bytes.
 allocated by url.c:3259
At 81d9ad4, there's 5 bytes.
 allocated by http_digest.c:147
At 81c5a84, there's 20 bytes.
 allocated by url.c:349
At 81d994c, there's 13 bytes.
 allocated by hash.c:127
At 81a8924, there's 16 bytes.
 allocated by llist.c:49
At 81d9b1c, there's 9 bytes.
 allocated by url.c:3260
At 81d9aec, there's 30 bytes.
 allocated by transfer.c:767
At 81bf4f4, there's 16 bytes.
 allocated by llist.c:49
At 81a88e4, there's 16 bytes.
 allocated by llist.c:49
At 81bcf24, there's 247 bytes.
 allocated by http_digest.c:435
At 81d99ac, there's 10 bytes.
 allocated by http.c:1377
At 81d9b44, there's 18 bytes.
 allocated by transfer.c:2171
At 819ea64, there's 28 bytes.
 allocated by hash.c:74
At 81bf4d4, there's 16 bytes.
 allocated by llist.c:49
At 81a8904, there's 16 bytes.
 allocated by llist.c:49
At 81d947c, there's 828 bytes.
 allocated by url.c:2312
At 81d992c, there's 12 bytes.
 allocated by hash.c:124
At 819bf0c, there's 16 bytes.
 allocated by hash.c:96
At 819ea94, there's 16 bytes.
 allocated by llist.c:49
At 81a895c, there's 12 bytes.
 allocated by base64.c:164
At 81dbc14, there's 48 bytes.
 allocated by hostip4.c:412
At 81d98dc, there's 32 bytes.
 allocated by mprintf.c:1039
At 81d99cc, there's 116 bytes.
 allocated by http.c:1527
At 81d9abc, there's 4 bytes.
 allocated by http_digest.c:158
At 81d998c, there's 10 bytes.
 allocated by connect.c:451
At 81d990c, there's 12 bytes.
 allocated by hostip.c:316
At 81d9ebc, there's 256 bytes.
 allocated by url.c:2367
At 81cff64, there's 33688 bytes.
 allocated by url.c:290
At 81d9a74, there's 53 bytes.
 allocated by http_digest.c:107
At 81bce14, there's 256 bytes.
 allocated by url.c:306
At 81d97cc, there's 256 bytes.
 allocated by url.c:2372
At 81d9b6c, there's 12 bytes.
 allocated by http.c:827
At 81c57e4, there's 16 bytes.
 allocated by llist.c:49
At 81a897c, there's 41 bytes.
 allocated by sslgen.c:103
Open file descriptor created at connect.c:635
 
 
Thanks in advance for your help.
Ousséma MASMOUDI
 
 

Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international. Téléchargez la version beta.
oussema masmoudi | 1 Feb 2006 12:09
Picon
Favicon

RE: Memory leak in libcurl

I will give you more details. I use Linux Mandrake as OS and uclibc instead of glibc.
 
Could you please help me?

oussema masmoudi <masmoudi_99 <at> yahoo.fr> a écrit :
Hello everybody,
 
I use the 7.14.1 version of libcurl. Unfortunately I have memory leak problem related to the use of this library.
 
In more details, I use the easy interface. And after performing the download, I call the curl_easy_cleanup function. This is the only function I called to free resources allocated by libcurl?
 
In the memdump file, I have obtained:
 
FREE ERROR: No memory allocated: MEM http.c:935 free(0x81b2874)
FREE ERROR: No memory allocated: MEM url.c:185 free(0x81b27f4)
FREE ERROR: No memory allocated: MEM url.c:185 free(0x81b26ac)
FREE ERROR: No memory allocated: MEM url.c:185 free(0x81b2bc4)
FREE ERROR: No memory allocated: MEM url.c:185 free(0x81b24dc)
Close without open: FD url.c:1535 sclose(11)
FREE ERROR: No memory allocated: MEM url.c:185 free(0x81b2734)
FREE ERROR: No memory allocated: MEM url! .c:185 free(0x81b2824)
FREE ERROR: No memory allocated: MEM url.c:185 free(0x81b23cc)
FREE ERROR: No memory allocated: MEM url.c:185 free(0x81a9b5c)
FREE ERROR: No memory allocated: MEM url.c:185 free(0x81b266c)
FREE ERROR: No memory allocated: MEM sslgen.c:138 free(0x81a9b1c)
FREE ERROR: No memory allocated: MEM url.c:1562 free(0x81b207c)
FREE ERROR: No memory allocated: MEM llist.c:130 free(0x81a989c)
FREE ERROR: No memory allocated: MEM llist.c:130 free(0x81a98bc)
FREE ERROR: No memory allocated: MEM llist.c:130 free(0x81a98dc)
FREE ERROR: No memory allocated: MEM hash.c:57 free(0x81b262c)
FREE ERROR: No memory allocated: MEM hostip4.c:109 free(0x81b4924)
FREE ERROR: No memory allocated: MEM hostip.c:497 free(0x81b25ec)
FREE ERROR: No memory allocated: MEM hash.c:61 free(0x81b260c)
FREE ERROR: No memory allocated: MEM llist.c:117 free(0x81b264c)
FREE ERROR: No memory allocated: MEM llist.c:130 free(0x81a98fc)
FREE ERROR: No memory al! located: MEM llist.c:130 free(0x81a991c)
FREE ERROR: No memory allocated: MEM llist.c:130 free(0x81a993c)
FREE ERROR: No memory allocated: MEM llist.c:130 free(0x81a995c)
FREE ERROR: No memory allocated: MEM hash.c:229 free(0x81a986c)
FREE ERROR: No memory allocated: MEM hash.c:264 free(0x81a7e74)
FREE ERROR: No memory allocated: MEM sslgen.c:345 free(0x81a997c)
FREE ERROR: No memory allocated: MEM url.c:185 free(0x81b268c)
FREE ERROR: No memory allocated: MEM url.c:225 free(0x81b284c)
FREE ERROR: No memory allocated: MEM url.c:185 free(0x81a84e4)
FREE ERROR: No memory allocated: MEM http_digest.c:447 free(0x81b277c)
FREE ERROR: No memory allocated: MEM http_digest.c:451 free(0x81a9afc)
FREE ERROR: No memory allocated: MEM http_digest.c:455 free(0x81b2754)
FREE ERROR: No memory allocated: MEM http_digest.c:463 free(0x81b27dc)
FREE ERROR: No memory allocated: MEM http_digest.c:467 free(0x81b27c4)
FREE ERROR: No memory allocated: MEM url.c:260 free(0x81a7e4c)
FREE ERROR: No memory allocated: MEM url.c:273 free(0x81a9cd4)
Leak detected: memory still allocated: 36521 bytes
At 81a89bc, there's 17 bytes.
 allocated by http_digest.c:118
At 81d996c, there's 12 bytes.
 allocated by llist.c:66
At 81d9314, there's 340 bytes.
 allocated by sslgen.c:508
At 81d9a54, there's 8 bytes.
 allocated by url.c:3259
At 81d9ad4, there's 5 bytes.
 allocated by http_digest.c:147
At 81c5a84, there's 20 bytes.
 allocated by url.c:349
At 81d994c, there's 13 bytes.
 allocated by hash.c:127
At 81a8924, there's 16 bytes.
 allocated by llist.c:49
At 81d9b1c, there's 9 bytes.
 allocated by url.c:3260
At 81d9aec, there's 30 bytes.
 allocated by transfer.c:767
At 81bf4f4, there's 16 bytes.
 allocated by llist.c:49
At 81a88e4, there's 16 bytes.
 allocated by llist.c:49
At 81bcf24, there's 247 bytes.
 ! allocated by http_digest.c:435
At 81d99ac, there's 10 bytes.
 allocated by http.c:1377
At 81d9b44, there's 18 bytes.
 allocated by transfer.c:2171
At 819ea64, there's 28 bytes.
 allocated by hash.c:74
At 81bf4d4, there's 16 bytes.
 allocated by llist.c:49
At 81a8904, there's 16 bytes.
 allocated by llist.c:49
At 81d947c, there's 828 bytes.
 allocated by url.c:2312
At 81d992c, there's 12 bytes.
 allocated by hash.c:124
At 819bf0c, there's 16 bytes.
 allocated by hash.c:96
At 819ea94, there's 16 bytes.
 allocated by llist.c:49
At 81a895c, there's 12 bytes.
 allocated by base64.c:164
At 81dbc14, there's 48 bytes.
 allocated by hostip4.c:412
At 81d98dc, there's 32 bytes.
 allocated by mprintf.c:1039
At 81d99cc, there's 116 bytes.
 allocated by http.c:1527
At 81d9abc, there's 4 bytes.
 allocated by http_digest.c:158
At 81d998c, there'! s 10 bytes.
 allocated by connect.c:451
At 81d990c, there's 12 bytes.
 allocated by hostip.c:316
At 81d9ebc, there's 256 bytes.
 allocated by url.c:2367
At 81cff64, there's 33688 bytes.
 allocated by url.c:290
At 81d9a74, there's 53 bytes.
 allocated by http_digest.c:107
At 81bce14, there's 256 bytes.
 allocated by url.c:306
At 81d97cc, there's 256 bytes.
 allocated by url.c:2372
At 81d9b6c, there's 12 bytes.
 allocated by http.c:827
At 81c57e4, there's 16 bytes.
 allocated by llist.c:49
At 81a897c, there's 41 bytes.
 allocated by sslgen.c:103
Open file descriptor created at connect.c:635
 
 
Thanks in advance for your help.
Ousséma MASMOUDI
 
 
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international. Téléchargez la version beta.

Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international. Téléchargez la version beta.
Daniel Stenberg | 1 Feb 2006 12:35
Picon
Favicon
Gravatar

Re: Memory leak in libcurl

On Wed, 1 Feb 2006, oussema masmoudi wrote:

>  I use the 7.14.1 version of libcurl. Unfortunately I have memory leak 
> problem related to the use of this library.
>
>  In more details, I use the easy interface. And after performing the 
> download, I call the curl_easy_cleanup function. This is the only function I 
> called to free resources allocated by libcurl?

First, please try 7.15.1. Then, please show us a little example source code 
that can repeat your problem/leak.

--

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html

Daniel Stenberg | 1 Feb 2006 12:36
Picon
Favicon
Gravatar

Re: Issue with ssl

On Wed, 1 Feb 2006, Rathi, Dinesh wrote:

>            I am trying to make Post requests over https (using libcurl) but 
> getting error "Unknown SSL protocol error in connection to 
> <servername>:443". I created a simple test application with libcurl and am 
> able to make the post request and see response, however in my integrated 
> application this unknown error comes.

When working against the same server?

> Any clue, what could be wrong. I switched on the verbose logging of curl and 
> could see that my simple test application proceeds after connecting, 
> verifies the cert etc. However my integrated application fails.

Are you using the exact same libcurl options?

--

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html

Rathi, Dinesh | 1 Feb 2006 12:41

RE: Issue with ssl


On Wed, 1 Feb 2006, Rathi, Dinesh wrote:

>            I am trying to make Post requests over https (using
libcurl) but 
> getting error "Unknown SSL protocol error in connection to 
> <servername>:443". I created a simple test application with libcurl
and am 
> able to make the post request and see response, however in my
integrated 
> application this unknown error comes.

When working against the same server?
[Dinesh] Yes.

> Any clue, what could be wrong. I switched on the verbose logging of
curl and 
> could see that my simple test application proceeds after connecting, 
> verifies the cert etc. However my integrated application fails.

Are you using the exact same libcurl options?
[Dinesh] I did that, however one difference could be multiple threads vs
single thread. I am now making my test application multi-threaded.
--

-- 
  Commercial curl and libcurl Technical Support:
http://haxx.se/curl.html

Rathi, Dinesh | 1 Feb 2006 12:45

RE: Issue with ssl

Indeed some issue with multi-threading environment. I got the same error
in my sample app as well. I remember vaguely about some ssl context
function for multiple threads etc. Can that be the case over here?

Thanks
Dinesh

-----Original Message-----
From: curl-library-bounces <at> cool.haxx.se
[mailto:curl-library-bounces <at> cool.haxx.se] On Behalf Of Daniel Stenberg
Sent: Wednesday, February 01, 2006 5:07 PM
To: libcurl development
Subject: Re: Issue with ssl

On Wed, 1 Feb 2006, Rathi, Dinesh wrote:

>            I am trying to make Post requests over https (using
libcurl) but 
> getting error "Unknown SSL protocol error in connection to 
> <servername>:443". I created a simple test application with libcurl
and am 
> able to make the post request and see response, however in my
integrated 
> application this unknown error comes.

When working against the same server?

> Any clue, what could be wrong. I switched on the verbose logging of
curl and 
> could see that my simple test application proceeds after connecting, 
> verifies the cert etc. However my integrated application fails.

Are you using the exact same libcurl options?

--

-- 
  Commercial curl and libcurl Technical Support:
http://haxx.se/curl.html

Daniel Stenberg | 1 Feb 2006 12:51
Picon
Favicon
Gravatar

Re: Integration in a DLL

On Wed, 1 Feb 2006, JCDUS wrote:

> I made a DLL that sends HTTP POST requests using LibCurl, but it seems like 
> there's a problem as when I try to call the exported functions from within 
> my .Exe, I get some EAccessViolations exceptions.

To me, this sounds like you've mixed some kind of memory areas or libc things 
or so that you need to take care of with those Windows compilers.

> I also integrated my functions in a "self-made" libcurl, and I can use this 
> DLL with success.

Exactly how does this differ from the first approach?

> Have you got any idea why I can't use the DLL that loads the libcurl DLL ?

Can you possibly show us a tiny example that fails and include details on how 
you build the DLLs? I don't much about Windows building, but I figure someone 
else might be able to spot something if you provide details.

--

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html

Rathi, Dinesh | 1 Feb 2006 12:58

RE: Integration in a DLL

One of the common crashes on windows with dlls comes when you have
different C runtime libraries for your dlls and exes and do a new in dll
code and delete in exe or vice-versa. This results in an invalid heap
memory kind of crash. You can rectify it by making sure that all dlls/
exes are using multithreaded C runtime dll.

Thanks
Dinesh

-----Original Message-----
From: curl-library-bounces <at> cool.haxx.se
[mailto:curl-library-bounces <at> cool.haxx.se] On Behalf Of Daniel Stenberg
Sent: Wednesday, February 01, 2006 5:21 PM
To: libcurl development
Subject: Re: Integration in a DLL

On Wed, 1 Feb 2006, JCDUS wrote:

> I made a DLL that sends HTTP POST requests using LibCurl, but it seems
like 
> there's a problem as when I try to call the exported functions from
within 
> my .Exe, I get some EAccessViolations exceptions.

To me, this sounds like you've mixed some kind of memory areas or libc
things 
or so that you need to take care of with those Windows compilers.

> I also integrated my functions in a "self-made" libcurl, and I can use
this 
> DLL with success.

Exactly how does this differ from the first approach?

> Have you got any idea why I can't use the DLL that loads the libcurl
DLL ?

Can you possibly show us a tiny example that fails and include details
on how 
you build the DLLs? I don't much about Windows building, but I figure
someone 
else might be able to spot something if you provide details.

--

-- 
  Commercial curl and libcurl Technical Support:
http://haxx.se/curl.html


Gmane