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

RE: error: wrong index file size in /usr/local/src/jffs2_mtd_patches/.git/objects/pack/pack-da39a3ee5e6b4b0d32 55bfef95601890afd80709.idx

From
TTjernlund <tjernlund@tjernlund.se>
Date
Jun 26, 2007, 21:14 UTC
Message-ID
<001601c7b837$067d1040$0e67a8c0@Jocke>
In-Reply-To
<alpine.LFD.0.98.0706261341190.8675@woody.linux-foundation.org>
Show 28 quoted lines
> -----Original Message-----
> From: Linus Torvalds [mailto:torvalds@linux-foundation.org] 
> Sent: den 26 juni 2007 22:45
> To: Tjernlund
> Cc: git@vger.kernel.org
> Subject: Re: error: wrong index file size in 
> /usr/local/src/jffs2_mtd_patches/.git/objects/pack/pack-da39a3
> ee5e6b4b0d32 55bfef95601890afd80709.idx
> 
> 
> 
> On Tue, 26 Jun 2007, Tjernlund wrote:
> >
> > Did this and got a small error that I don't think should be there:
> 
> Heh. I think I see what's wrong..
> 
> > Indexing 0 objects...
> > remote: Total 0 (delta 0), reused 0 (delta 0)
> 
> Ok, there were no objects that weren't in the reference repo. 
> So far so 
> good.
> 
> But:
> 
> > error: wrong index file size in 
> /usr/local/src/jffs2_mtd_patches/.git/objects/pack/pack-da39a3
ee5e6b4b0d3255bfef95601890afd80709.idx
Show 30 quoted lines
> 
> I think this is because of that zero size:
> 
>                 /*
>                  * Minimum size:
>                  *  - 8 bytes of header
>                  *  - 256 index entries 4 bytes each
>                  *  - 20-byte sha1 entry * nr
>                  *  - 4-byte crc entry * nr
>                  *  - 4-byte offset entry * nr
>                  *  - 20-byte SHA1 of the packfile
>                  *  - 20-byte SHA1 file checksum
>                  * And after the 4-byte offset table might be a
>                  * variable sized table containing 8-byte entries
>                  * for offsets larger than 2^31.
>                  */
>                 unsigned long min_size = 8 + 4*256 + nr*(20 + 
> 4 + 4) + 20 + 20;
>                 if (idx_size < min_size || idx_size > 
> min_size + (nr - 1)*8) {
> 
> Notice the "(nr - 1)*8" thing. And notice how "nr-1" 
> underflows when nr is 
> zero..
> 
> I bet it goes away if you remove the "-1", or if you do 
> something like 
> this (totally untested!) patch.
> 
> 		Linus
[SNIP patch]
Tested your patch and the error went away, many thanks
 Jocke 
Previous: Linus TorvaldsNext: David Woodhouse
Message 3 of 4 in “error: wrong index file size in /usr/local/src/jffs2_mtd_patches/.git/objects/pack/pack-da39a3ee5e6b4b0d3255bfef95601890afd80709.idx”
  1. TjernlundJun 26, 2007
  2. Linus TorvaldsJun 26, 2007
  3. TjernlundJun 26, 2007
  4. David WoodhouseJun 26, 2007

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.