git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Segmentation fault on http clone, post-1.5.6

From
Nicolas Pitre <nico@cam.org>
Date
Jun 24, 2008, 21:24 UTC
Message-ID
<alpine.LFD.1.10.0806241720440.2979@xanadu.home>
In-Reply-To
<20080624205556.GA3565@mithlond.arda.local>
On Tue, 24 Jun 2008, Teemu Likonen wrote:
Show 10 quoted lines
> 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
Previous: Teemu LikonenNext: SZEDER Gábor
Message 7 of 8 in “Segmentation fault on http clone, post-1.5.6”
  1. Teemu LikonenJun 24, 2008
  2. Jeff KingJun 24, 2008
  3. Teemu LikonenJun 24, 2008
  4. Mike HommeyJun 24, 2008
  5. Nicolas PitreJun 24, 2008
  6. Teemu LikonenJun 24, 2008
  7. Nicolas PitreJun 24, 2008
  8. SZEDER GáborJun 24, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.