cURL / Mailing Lists / curl-library / Single Mail

curl-library

segfault after curl_easy_cleanup via progress callback

From: Dave Reisner <d_at_falconindy.com>
Date: Wed, 10 Aug 2011 18:48:23 -0400

Hi all,

I received a bug report with backtrace [1] for a curl powered app that I
work on. It shows a segfault in a progress callback, which is triggered
_after_ curl_easy_cleanup has been called. Unfortunately, I can't
reproduce this, and it's still a development version of pacman with a
limited userbase. There's a half dozen devs using this on a daily basis,
and this is a routine operation that one of us would have surely run
into by now.

That said, the bug reporter was able to find another bug report[2] with
a very similar backtrace. Note that this bug report uses an earlier
version of curl, I believe 7.20, while we're using 7.21.7.

The documentation for curl_easy_cleanup states that further calls to the
handle are invalid after this call so I'm a bit confused as to why curl
would be hitting the progress callback at this point. This indirectly
_insists_ that the application touches the handle. Am I misunderstanding
the expectation of curl_easy_cleanup that it's _possible_ due to an
unfinished transfer that the progress callback may be hit one final
time?

In case it's relevant, I'll point to the where the majority of our curl
implementation lies [3], but I'm somewhat confident that pacman "does
the right thing" here.

If anyone can point me in the right direction, I've be hugely
appreciative.

Thanks,
Dave Reisner

[1] http://pastebin.com/Pef1Qedq
[2] http://www.crosswire.org/bugs/browse/API-128
[3] https://github.com/falconindy/pacman/blob/master/lib/libalpm/dload.c#L180
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-08-11