All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Noll <maan@systemlinux.org>
To: Art Haas <ahaas@airmail.net>
Cc: git@vger.kernel.org
Subject: Re: Odd behavior with git and cairo-devel repo
Date: Wed, 21 Jun 2006 04:46:05 +0200	[thread overview]
Message-ID: <20060621024605.GO11245@skl-net.de> (raw)
In-Reply-To: <20060621010030.GP2820@artsapartment.org>

[-- Attachment #1: Type: text/plain, Size: 1129 bytes --]

On 20:00, Art Haas wrote:

> $ 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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2006-06-21  2:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-21  1:00 Odd behavior with git and cairo-devel repo Art Haas
2006-06-21  2:46 ` Andre Noll [this message]
2006-06-21 11:01   ` Junio C Hamano
2006-06-21 12:06   ` Art Haas
2006-06-21 17:46     ` Andre Noll
2006-06-21 18:01       ` Linus Torvalds
2006-06-21 19:43         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060621024605.GO11245@skl-net.de \
    --to=maan@systemlinux.org \
    --cc=ahaas@airmail.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.