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

Re: fsck errors on newly cloned, newly imported git repository

From
MHMike 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.
Previous: Mike Herrick
Message 5 of 5 in “fsck errors on newly cloned, newly imported git repository”
  1. Mike HerrickOct 24, 2010
  2. Drew NorthupOct 25, 2010
  3. Mike HerrickOct 25, 2010
  4. Mike HerrickOct 25, 2010
  5. Mike HerrickOct 28, 2010

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.