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 15:34:45 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.1.10.0806241524480.2979@xanadu.home> (raw)
In-Reply-To: <20080624185723.GA3368@mithlond.arda.local>

On Tue, 24 Jun 2008, Teemu Likonen wrote:

> Jeff King wrote (2008-06-24 12:40 -0400):
> 
> > On Tue, Jun 24, 2008 at 04:04:57PM +0300, Teemu Likonen wrote:
> > 
> > > With the current "master" branch version (29b0d0191) I get
> > > segmentation fault when trying to clone a git repo with http
> > > protocol. Tried a couple of times and it's always reproducible. You
> > > can test with the following repository (about 5.5 MB):
> > > 
> > >   git clone http://www.iki.fi/tlikonen/voikko.git
> > 
> > I can't reproduce the segfault here.
> > 
> > > I also build git from the tag v1.5.6 and it seems to work fine, so
> > > I guess the bug was introduced after 1.5.6.
> > 
> > That sounds like an excellent opportunity to learn about git-bisect.
> > Can you try bisecting the bug and reporting back the problematic
> > commit?
> 
> Indeed. I have now officially bisected the problem and the first bad or
> problematic commit is 8eca0b47 "implement some resilience against pack
> corruptions" (hence Cc to Nicolas, the author). This is always
> reproducible in my Debian 4.0 box.

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?  What my patch does is 
to return NULL in all cases when an object exists but can't be read 
instead of dying.  So if some user of read_sha1_file() is not checking 
for a returned null pointer then a null pointer dereference is most 
likely.

Note that read_sha1_file() could have returned NULL even before my 
patch, but not necessarily in all cases.


Nicolas

  parent reply	other threads:[~2008-06-24 19:35 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 [this message]
2008-06-24 20:55       ` Teemu Likonen
2008-06-24 21:24         ` Nicolas Pitre
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.0806241524480.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).