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

Re: Can't build first git commit

From
Jeff King <peff@peff.net>
Date
Mar 6, 2019, 21:57 UTC
Message-ID
<20190306215752.GC32630@sigill.intra.peff.net>
In-Reply-To
<1551905579.1727.8.camel@libero.it>
On Wed, Mar 06, 2019 at 09:52:59PM +0100, Fabio Aiuto wrote:
Show 17 quoted lines
> Found this error
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x00401628 in verify_hdr (hdr=0x0, size=32) at read-cache.c:192
> 192		if (hdr->signature != CACHE_SIGNATURE)
> 
> when tracing on line
> 
> static int verify_hdr(struct cache_header *hdr, unsigned long size)
> {
> 	SHA_CTX c;
> 	unsigned char sha1[20];
> 
> 	if (hdr->signature != CACHE_SIGNATURE)<--- this line
> 
> inside file read-cache.c
> What's going on?

Well, hdr is NULL, so you can't dereference it. Without knowing more about how you called it, it's hard to say. But do note that the index format has been updated once or twice (as well as the pack format). You probably can't just chdir into a clone made by a recent Git and expect ancient versions to read it.

You'll have to start a repo from scratch, or clone an existing with the old version (which will be tricky; you might have to use a modern upload-pack to represent the server side, but I think that first version doesn't even have any fetch capabilities at all).

It might also be possible to convince modern Git to write out in old formats that ancient Git will understand, but I don't know the right config knobs to tweak offhand.

-Peff
Previous: Fabio AiutoNext: Jeff King
Message 16 of 18 in “Can't build first git commit”
  1. Fabio AiutoMar 4, 2019
  2. Santiago TorresMar 4, 2019
  3. Fabio AiutoMar 4, 2019
  4. Santiago TorresMar 4, 2019
  5. asymptosisMar 4, 2019
  6. Jonathan NiederMar 4, 2019
  7. Jeff KingMar 4, 2019
  8. Fabio AiutoMar 5, 2019
  9. Jeff KingMar 5, 2019
  10. Fabio AiutoMar 6, 2019
  11. Jeff KingMar 6, 2019
  12. Fabio AiutoMar 6, 2019
  13. Santiago TorresMar 6, 2019
  14. Jeff KingMar 6, 2019
  15. Fabio AiutoMar 6, 2019
  16. Jeff KingMar 6, 2019
  17. Jeff KingMar 7, 2019
  18. Fabio AiutoMar 7, 2019

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.