cURL / Mailing Lists / curl-library / Single Mail


RE: Crashing on curl_easy_cleanup(cur);

From: Ben Helleman <>
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_cleanup(curl); // BOOM!
  return NULL;

// A picture is worth a 1000 words : )

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

Library Properties that are being included:
   libcurl.lib winmm.lib pthreadVSE.lib //

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

Hope that picture will help narrow things down.

Original Message-----
From: Daniel Stenberg [ <>]
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 = " <>" 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

 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
This email is sponsored by:ThinkGeek
Welcome to geek heaven.

This email is sponsored by:ThinkGeek
Welcome to geek heaven.

Received on 2002-10-15