Re: fsck errors on newly cloned, newly imported git repository
- From
- Mike Herrick <mike.herrick@gmail.com>
- Date
- Oct 28, 2010, 23:40 UTC
- Message-ID
- <AANLkTimr_11_F7WJK3Uv8N=ORqDYfrLTGyHB7c-npNaU@mail.gmail.com>
- In-Reply-To
- <AANLkTinfDh5_-u6nJc=MMs_vPQGuBPhOT-TqgVOvAMPo@mail.gmail.com>
Following up to my own post, after some serious debugging, it turned out that the libcrypto library was to blame.
I found that after the clone, a git index-pack on the pack-file would generate a different index each time (from the same pack-file). I narrowed it down to this routine returning an incorrect sha1 on "bad" machines:
static void write_sha1_file_prepare(const void *buf, unsigned long len,
const char *type, unsigned char *sha1,
char *hdr, int *hdrlen)
{
git_SHA_CTX c; /* Generate the header */
*hdrlen = sprintf(hdr, "%s %lu", type, len)+1; /* Sha1.. */
git_SHA1_Init(&c);
git_SHA1_Update(&c, hdr, *hdrlen);
git_SHA1_Update(&c, buf, len);
git_SHA1_Final(sha1, &c);
}Upgrading the libcrypto solved the problem on both machines.
FYI, the offending versions were openssl-0.9.7a-26 and openssl-0.9.7a-35 (these were Fedora Core 2 vintage). Hopefully no-one has any systems this old lying around any longer.
Mike.