git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Pitre <nico@cam.org>
To: Teemu Likonen <tlikonen@iki.fi>
Cc: Jeff King <peff@peff.net>, git@vger.kernel.org
Subject: Re: Segmentation fault on http clone, post-1.5.6
Date: Tue, 24 Jun 2008 17:24:49 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.1.10.0806241720440.2979@xanadu.home> (raw)
In-Reply-To: <20080624205556.GA3565@mithlond.arda.local>

On Tue, 24 Jun 2008, Teemu Likonen wrote:

> Nicolas Pitre wrote (2008-06-24 15:34 -0400):
> 
> > I'm trying to reproduce your segfault with current master
> > (v1.5.6-56-g29b0d01) but I just can't.
> > 
> > Can you provide a gdb backtrace of the segfault?
> 
> Let's hope I'm doing this right. Just installed gdb for the first time.
> I started with "gdb git" and then typed "run clone http://...".
> Eventually it gave this:

Excellent!

The problem is probably fixed with this:

diff --git a/sha1_file.c b/sha1_file.c
index a92f023..b7d1a82 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -844,6 +844,8 @@ struct packed_git *parse_pack_index(unsigned char *sha1)
 
 	strcpy(p->pack_name, path);
 	p->pack_size = 0;
+	p->num_bad_objects = 0;
+	p->bad_object_sha1 = NULL;
 	p->next = NULL;
 	p->windows = NULL;
 	p->pack_fd = -1;

Could you confirm it?

However I just don't like the fact that pack structures are allocated 
and initialized in two places, which makes it error prone as 
demonstrated here.  So I'll cook up a better patch that fixes the 
duplication issue.


Nicolas

  reply	other threads:[~2008-06-24 21:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-24 13:04 Segmentation fault on http clone, post-1.5.6 Teemu Likonen
2008-06-24 16:40 ` Jeff King
2008-06-24 18:57   ` Teemu Likonen
2008-06-24 19:34     ` Mike Hommey
2008-06-24 19:34     ` Nicolas Pitre
2008-06-24 20:55       ` Teemu Likonen
2008-06-24 21:24         ` Nicolas Pitre [this message]
2008-06-24 21:56           ` SZEDER Gábor

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=alpine.LFD.1.10.0806241720440.2979@xanadu.home \
    --to=nico@cam.org \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=tlikonen@iki.fi \
    /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).