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

Re: Odd behavior with git and cairo-devel repo

From
ANAndre Noll <maan@systemlinux.org>
Date
Jun 21, 2006, 02:46 UTC
Message-ID
<20060621024605.GO11245@skl-net.de>
In-Reply-To
<20060621010030.GP2820@artsapartment.org>
On 20:00, Art Haas wrote:
Show 5 quoted lines
> $ git clone git://git.cairographics.org/git/cairo cairo
> [ ... git clones the repo without problem ... ]
> $ cd cairo
> $ git fsck-objects
> Floating point exception

This is due to refs_hash_size being zero in mark_reachable(). Both "git fsck-objects --full" and "git repack -a -d" seem to work fine with the patch below (tested by cloning your repo).

--- Currently, we don't check refs_hash_size size and happily call lookup_object_refs() even if refs_hash_size is zero which leads to a division by zero in hash_obj().

Signed-off-by: Andre Noll <maan@systemlinux.org>
---
diff --git a/object-refs.c b/object-refs.c
index 8afa227..a7d49c6 100644
--- a/object-refs.c
+++ b/object-refs.c
@@ -127,6 +127,9 @@ void mark_reachable(struct object *obj, 
 
 	if (!track_object_refs)
 		die("cannot do reachability with object refs turned off");
+	/* nothing to lookup */
+	if (!refs_hash_size)
+		return;
 	/* If we've been here already, don't bother */
 	if (obj->flags & mask)
 		return;
-- 
The only person who always got his work done by Friday was Robinson Crusoe
Previous: Art HaasNext: Junio C Hamano
Message 2 of 7 in “Odd behavior with git and cairo-devel repo”
  1. Art HaasJun 21, 2006
  2. Andre NollJun 21, 2006
  3. Junio C HamanoJun 21, 2006
  4. Art HaasJun 21, 2006
  5. Andre NollJun 21, 2006
  6. Linus TorvaldsJun 21, 2006
  7. Junio C HamanoJun 21, 2006

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.