git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tay Ray Chuan <rctay89@gmail.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Ali Polatel <polatel@gmail.com>, git@vger.kernel.org
Subject: Re: git clone http://git.savannah.gnu.org/cgit/xboard.git segfaults
Date: Wed, 26 Aug 2009 20:20:53 +0800	[thread overview]
Message-ID: <20090826202053.6e6442a6.rctay89@gmail.com> (raw)
In-Reply-To: <alpine.DEB.1.00.0908171620160.4991@intel-tinevez-2-302>

Hi,

On Mon, Aug 17, 2009 at 10:22 PM, Johannes Schindelin<Johannes.Schindelin@gmx.de> wrote:
> Seems that an object request is aborted, but the slot, and therefore the
> callback, is called nevertheless.  Tay, does that ring a bell?

thanks Johannes, your diagnosis was a vital clue.

Ali, could you see if this patch fixes it for you? On my side, I had
some difficulty reproducing your problem reliably (it happened
sometimes but not on other times).

--
Cheers,
Ray Chuan

-- >8 --
Subject: [PATCH] http.c: set slot callback members to NULL when releasing object

Set the members callback_func and callback_data of freq->slot to NULL
when releasing a http_object_request. release_active_slot() is also
invoked on the slot to remove the curl handle associated with the slot
from the multi stack (CURLM *curlm in http.c).

These prevent the callback function and data from being used in http
methods (like http.c::finish_active_slot()) after a
http_object_request has been free'd.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
 http.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/http.c b/http.c
index a2720d5..1ae19e0 100644
--- a/http.c
+++ b/http.c
 -1285,5 +1285,10 @@ void release_http_object_request(struct http_object_request *freq)
 		free(freq->url);
 		freq->url = NULL;
 	}
-	freq->slot = NULL;
+	if (freq->slot != NULL) {
+		freq->slot->callback_func = NULL;
+		freq->slot->callback_data = NULL;
+		release_active_slot(freq->slot);
+		freq->slot = NULL;
+	}
 }
--
1.6.4.193.gaceaa.dirty

  parent reply	other threads:[~2009-08-26 12:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-17 13:56 git clone http://git.savannah.gnu.org/cgit/xboard.git segfaults Ali Polatel
2009-08-17 14:17 ` Johannes Schindelin
2009-08-17 14:22   ` Johannes Schindelin
2009-08-17 14:40 ` Lars Hjemli
2009-08-26 12:20 ` Tay Ray Chuan [this message]
2009-08-26 13:12   ` Ali Polatel
2009-08-27  7:39     ` Johannes Schindelin
2009-08-29  0:07     ` Tay Ray Chuan
2009-08-29  0:53       ` Junio C Hamano
2009-08-29  1:10         ` Junio C Hamano
2009-08-29  2:03           ` Tay Ray Chuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090826202053.6e6442a6.rctay89@gmail.com \
    --to=rctay89@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=polatel@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).