cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: calling curl_multi_cleanup reusing a detached, cleaned easy handle

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 29 Sep 2012 15:55:11 +0200 (CEST)

On Tue, 25 Sep 2012, Sam Deane wrote:

> I'm seeing something very similar to the bug described in this message:
>
> http://curl.haxx.se/mail/lib-2009-10/0162.html
>
> Basically I have an easy handle, attach it to a multi, perform an ftp
> related operation, remove the easy handle from the multi, call
> curl_easy_cleanup() on the easy handle, then later call curl_multi_cleanup()
> on the multi handle.
>
> At this point the CURLOPT_DEBUGFUNCTION callback that I had registered on
> the easy handle is called.
>
> The easy handle passed in to this callback matches the one that I had
> previously removed from the multi.
>
> Is this a known issue?

Thanks for bringing this back to my attention!

I don't think we have it mentioned in the KNOWN_BUGS document and we don't
have any open bug report in the bug tracker for this issue.

If you want to help out to get this issue fixed, you can work on converting
your scenario into a curl test case that repeats the problem.

I suggest that the correct fix would be to clear all callbacks that are
associated with the specific handle when curl_easy_cleanup() is called - as
that's probably what a user expects. The fact that libcurl sometimes hold on
to a handle for internal reasons could be kept a secret from the application's
point of view.

I would like a test case for this to verify the fix against and to make sure
we don't get regressions in the future.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-09-29