* Debugging corrupt object generation
@ 2007-11-01 22:57 Julian Phillips
2007-11-01 23:57 ` Nicolas Pitre
0 siblings, 1 reply; 4+ messages in thread
From: Julian Phillips @ 2007-11-01 22:57 UTC (permalink / raw)
To: git
I have been trying to import a repository using fast-import, and as part
of this I have extended fast-import to support copying a path from any
arbitrary commit. This works fine on my small test repository.
However, when I run against my (vastly more complicated) real work
repository things don't go so well. I get a few thousand commits in, and
then it breaks. It appears that I have somehow managed to create a
corrupt object or something.
After a certain commit, and attempt to use that commit generates a "fatal:
unable to apply delta". This appears to be coming from unpack_delta_entry
in sha1_file.c.
Can anyone give me any hints as to how I find out what is causing the
problem? I'm not even sure what it is that isn't working ... and all
attempts to replicate the problem with my test repository have failed.
--
Julian
---
...the prevailing Catholic odor - incense, wax, centuries of mild bleating
from the lips of the flock.
-- Thomas Pynchon, _Gravity's Rainbow_
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Debugging corrupt object generation
2007-11-01 22:57 Debugging corrupt object generation Julian Phillips
@ 2007-11-01 23:57 ` Nicolas Pitre
2007-11-02 0:26 ` Julian Phillips
0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Pitre @ 2007-11-01 23:57 UTC (permalink / raw)
To: Julian Phillips; +Cc: git
On Thu, 1 Nov 2007, Julian Phillips wrote:
> I have been trying to import a repository using fast-import, and as part of
> this I have extended fast-import to support copying a path from any arbitrary
> commit. This works fine on my small test repository.
>
> However, when I run against my (vastly more complicated) real work repository
> things don't go so well. I get a few thousand commits in, and then it breaks.
> It appears that I have somehow managed to create a corrupt object or
> something.
>
> After a certain commit, and attempt to use that commit generates a "fatal:
> unable to apply delta". This appears to be coming from unpack_delta_entry
> in sha1_file.c.
I suppose you mean "fatal: failed to apply delta", because "unable to
apply delta" doesn't appear anywhere in the current source tree.
> Can anyone give me any hints as to how I find out what is causing the
> problem? I'm not even sure what it is that isn't working ... and all
> attempts to replicate the problem with my test repository have failed.
Well, something is screwed for sure. Some object you're requesting is
made of a delta, and that delta is bad, therefore patch_delta() returns
NULL (you could instrument it to determine exactly why).
Maybe fast-import hasn't flushed the needed data to the pack yet?
Nicolas
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Debugging corrupt object generation
2007-11-01 23:57 ` Nicolas Pitre
@ 2007-11-02 0:26 ` Julian Phillips
2007-11-02 5:15 ` Shawn O. Pearce
0 siblings, 1 reply; 4+ messages in thread
From: Julian Phillips @ 2007-11-02 0:26 UTC (permalink / raw)
To: Nicolas Pitre; +Cc: git
On Thu, 1 Nov 2007, Nicolas Pitre wrote:
> On Thu, 1 Nov 2007, Julian Phillips wrote:
>
>> After a certain commit, and attempt to use that commit generates a "fatal:
>> unable to apply delta". This appears to be coming from unpack_delta_entry
>> in sha1_file.c.
>
> I suppose you mean "fatal: failed to apply delta", because "unable to
> apply delta" doesn't appear anywhere in the current source tree.
I did indeed. Read 'n' type never seems to be as reliable as copy 'n'
paste ...
>> Can anyone give me any hints as to how I find out what is causing the
>> problem? I'm not even sure what it is that isn't working ... and all
>> attempts to replicate the problem with my test repository have failed.
>
> Well, something is screwed for sure. Some object you're requesting is
> made of a delta, and that delta is bad, therefore patch_delta() returns
> NULL (you could instrument it to determine exactly why).
Ah, ok - that sounds like it might be useful. I guess that looking at the
opposite side where fast-import is creating the data might also prove
fruitful.
> Maybe fast-import hasn't flushed the needed data to the pack yet?
Well, fast-import completes quite happily and outputs the normal summary
status. I can look at logs and trees etc provided that I don't try and
look at one particular part of the tree on one particular commit. I
think the problem is that I've managed to do something inside fast-import
that corrupts one particular tree object (though I've no idea what that
might be).
I shall have to start instrumenting and try again.
Thanks.
--
Julian
---
Many changes of mind and mood; do not hesitate too long.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Debugging corrupt object generation
2007-11-02 0:26 ` Julian Phillips
@ 2007-11-02 5:15 ` Shawn O. Pearce
0 siblings, 0 replies; 4+ messages in thread
From: Shawn O. Pearce @ 2007-11-02 5:15 UTC (permalink / raw)
To: Julian Phillips; +Cc: Nicolas Pitre, git
Julian Phillips <julian@quantumfyre.co.uk> wrote:
> On Thu, 1 Nov 2007, Nicolas Pitre wrote:
> >
> >Maybe fast-import hasn't flushed the needed data to the pack yet?
>
> Well, fast-import completes quite happily and outputs the normal summary
> status. I can look at logs and trees etc provided that I don't try and
> look at one particular part of the tree on one particular commit. I
> think the problem is that I've managed to do something inside fast-import
> that corrupts one particular tree object (though I've no idea what that
> might be).
Ahhh. I'm betting you messed up the version 0 and version 1 arrays
inside of the struct tree_entry. This could cause the delta
generator to look at the wrong base information when it creates
the delta, thus causing the delta to be created for a different
base than what the object is actually using in the packfile.
The version[0] is meant to hold the mode and SHA-1 of the tree_entry
in the base object. The version[1] is meant to hold the current
mode and SHA-1 of the tree_entry in the new object. A mode of 0
means the entry doesn't exist in that particular tree; so an add
is shown as "version[0].mode = 0; version[1].mode = 0100644".
Look at the store_tree function, this is where we regenerate the
canonical representation of both the version[0] and the version[1]
trees so the store_object function can generate a delta. Note that
we assume the base object name is root->versions[0].sha1. Maybe the
version[0] array doesn't actually match the tree named by that sha1?
--
Shawn.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-11-02 5:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-01 22:57 Debugging corrupt object generation Julian Phillips
2007-11-01 23:57 ` Nicolas Pitre
2007-11-02 0:26 ` Julian Phillips
2007-11-02 5:15 ` Shawn O. Pearce
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox