Argh!!!

Phillip Neiswanger sigsegv at prodigy.net
Thu Mar 15 23:14:57 UTC 2007


Sorry guys.  I can no longer help in this matter.  I simply had to get  
going again, and I took other comments made reguarding this problem to  
mean there wasn't any hope in recovering the history, so I deleted the  
broken repository and started afresh.
--
phil

On Thu, 15 Mar 2007 12:56:15 -0600, Matt Mackall <mpm at selenic.com> wrote:

> On Wed, Mar 14, 2007 at 01:04:33AM -0600, Phillip Neiswanger wrote:
>> prompt> hg status
> ...
>>     self.manifest = manifest.manifest(self.sopener, v)
> ...
>>     e = struct.unpack(self.indexformat, cur)
>> struct.error: unpack str size does not match format
>
> Ok, we've somehow gotten a short string here. This shouldn't happen as
> we've got checks in place.
>
>> prompt> hg recover
>> rolling back interrupted transaction
>> checking changesets
>> checking manifests
>> manifest index contains 19 extra bytes
>
> Those extra 19 bytes are a problem. A clone --pull at this point would
> have fixed things.
>
>> I commit as root and the commit appears to work just fine.
>
> Oops. We've appended data onto a corrupt entry. Now we've got an entry
> which is 19 bytes of garbage plus (64-19) bytes of your new entry,
> giving us an utterly meaningless entry. This would be mostly harmless
> except we use the data length part the entry to skip past the interleaved
> data. I suspect we're getting a giant negative length which is
> confusing us. Try this patch:
>
> diff -r 3be4785f8994 mercurial/revlog.py
> --- a/mercurial/revlog.py       Wed Mar 14 19:13:04 2007 -0500
> +++ b/mercurial/revlog.py       Thu Mar 15 13:57:57 2007 -0500
> @@ -425,10 +425,13 @@ class revlog(object):
>                  self.nodemap[e[-1]] = n
>                  n += 1
>                  if inline:
> +                    if e[1] < 0:
> +                        break
>                      off += e[1]
>                      if off > l:
>                          # some things don't seek well, just read it
>                          fp.read(off - l)
> +                        break
>              if not st:
>                  break
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/




More information about the Mercurial mailing list