cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Crashing on curl_easy_cleanup(cur);

From: Ben Helleman <Ben.Helleman_at_adobe.com>
Date: Tue, 15 Oct 2002 08:36:56 -0400

Yes, the examples that are provided result in this issue as well. For
instance the example:

void *pull_one_url(void *url)
{
  CURL *curl;
  curl = curl_easy_init();
  curl_easy_setopt(curl, CURLOPT_URL, url);
  curl_easy_perform(curl);
  curl_easy_cleanup(curl); // BOOM!
  return NULL;
}

// A picture is worth a 1000 words : )

System Properties:
    libcurl-7.9.8
    Windows XP
    Service Pack 1
    Visual Studio 6.0 Enterprise Edition

Library Properties that are being included:
   libcurl.lib winmm.lib pthreadVSE.lib //
http://sources.redhat.com/pthreads-win32/
<http://sources.redhat.com/pthreads-win32/>

After Clicking Abort --> Debug --> It wants the file DBGHEAP.C

_______________________
 
Hope that picture will help narrow things down.
 
BH
 

Original Message-----
From: Daniel Stenberg [ <mailto:daniel_at_haxx.se> mailto:daniel_at_haxx.se]
Sent: Tuesday, October 15, 2002 7:59 AM
To: libcurl Mailing list
Subject: Re: Crashing on curl_easy_cleanup(cur);

On Tue, 15 Oct 2002, Ben Helleman wrote:

> Hi there, I've been having issues when trying to use curl's
> curl_easy_cleanup(curl); What has been happening if I execute the
> following:

> ----------------
> CURL *curl;
> curl = curl_easy_init();
> curl_easy_setopt(curl, CURLOPT_URL, url); // url = " <http://cnn.com>
http://cnn.com" for
> instance
> curl_easy_perform(curl);
> curl_easy_cleanup(curl); //************************
> ----------------
>
> the easy_cleanup(curl) crashes my execution.

So, are all the source examples crashing too then? This is the way to use
libcurl, and if curl_easy_cleanup() would crash this easily I would expect a
few more people than you would have come shouting here. I believe your
problem is trickier than this.

What libcurl version is this?

> If I remove the curl_easy_cleanup(curl); line the program runs fine.

Right, but leaks memory.

> I thought that each thread needs to clean itself up, so its best to call
> curl_easy_cleanup() after each thread's turn.

That's indeed the correct thing to do.

> Any suggestions what might be going on?

Something bugs! ;-)

> The above snippet of code is located in a function outside of main. In my
> main I perform: curl_global_init(CURL_GLOBAL_WIN32); and after all threads
> have joined I do a curl_global_cleanup();

Can please provide us with an as tiny program as possible that still repeats
this problem? Just the bare essentials.

Also, it always help if you can tell us what operating system you're using
and possibly which compiler and other facts you think might be interesting
here.

--
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
 <http://thinkgeek.com/sf> http://thinkgeek.com/sf

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

assertion.gif
Received on 2002-10-15