From: mkoegler@auto.tuwien.ac.at (Martin Koegler)
To: Junio C Hamano <gitster@pobox.com>
Cc: Nicolas Pitre <nico@cam.org>, Simon Hausmann <simon@lst.de>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: git fsck segmentation fault
Date: Thu, 11 Dec 2008 07:27:53 +0100 [thread overview]
Message-ID: <20081211062753.GA17683@auto.tuwien.ac.at> (raw)
In-Reply-To: <7vljunwidr.fsf@gitster.siamese.dyndns.org>
On Wed, Dec 10, 2008 at 06:33:20PM -0800, Junio C Hamano wrote:
> mkoegler@auto.tuwien.ac.at (Martin Koegler) writes:
> A similar change would be needed for other callers of fsck_walk(), no?
> There seem to be one in builtin-unpack-objects.c (check_object calls
> fsck_walk as itself as the callback).
buitin-unpack-objects.c is different. First, its intended for the
small case [default unpack_limit is 100; it keeps the unpacked content
of trees/commits in memory], which will not overflow the
stack. Second, it may only write an object after all of its connected
objects have been written out. So it would need a totally different
logic.
> Another caller is in index-pack.c (sha1_object() calls fsck_walk with
> mark_link as the callback), but I do not think it would recurse for the
> depth of the history, so we are safe there.
mark_link only sets a flag on the direct connected objects, so yes, it
needs no change.
> I initially expected that the fix would be to introduce this "userspace
> work queue" (i.e. your objectstack) to be maintained on the
> fsck.c:fsck_walk() side (perhaps as an extra parameter to an actual queue
> for reentrancy), not by making the callee not to recurse, though.
fsck_walk has been designed to call a function on all directly
connected objected. There are callers, which expected this behaviour
(eg. index-pack, mark_used in fsck).
mfg Martin Kögler
next prev parent reply other threads:[~2008-12-11 6:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-27 17:14 git fsck segmentation fault Simon Hausmann
2008-11-27 17:47 ` Nicolas Pitre
2008-11-27 19:10 ` Simon Hausmann
2008-11-27 19:21 ` Simon Hausmann
2008-11-27 19:57 ` Nicolas Pitre
2008-11-28 8:19 ` Simon Hausmann
2008-12-09 19:09 ` Nicolas Pitre
2008-12-09 21:57 ` Martin Koegler
2008-12-10 7:53 ` Martin Koegler
2008-12-11 2:33 ` Junio C Hamano
2008-12-11 6:27 ` Martin Koegler [this message]
2008-12-11 6:42 ` 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=20081211062753.GA17683@auto.tuwien.ac.at \
--to=mkoegler@auto.tuwien.ac.at \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=nico@cam.org \
--cc=simon@lst.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).