[Bug 3754] New: hg verify doesn't detect a specific corrupted .i file

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Mon Jan 7 12:30:01 CST 2013


http://bz.selenic.com/show_bug.cgi?id=3754

          Priority: normal
            Bug ID: 3754
                CC: mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: hg verify doesn't detect a specific corrupted .i file
          Severity: bug
    Classification: Unclassified
                OS: Windows
          Reporter: edmudama at gmail.com
          Hardware: PC
            Status: UNCONFIRMED
           Version: 2.2.2
         Component: Mercurial
           Product: Mercurial

Created attachment 1703
  --> http://bz.selenic.com/attachment.cgi?id=1703&action=edit
test repository for hg verify debug

I was asked by a coworker how to prove that a copied mercurial repository was
valid, and suggested hg verify.  However, to test that theory, I went and
edited a few bytes of a .i file to confirm that the corruption would be caught
and hg verify didn't complain.

I've reduced this down to a dummy repository which shows this issue which I am
attaching.

To reproduce, edit offset 0x1A8 within .hg/store/data/dummyfile.i and change
that byte to something other than zero.  (I used 0x61 which is the 'a'
character)

c:\work\testx>hg verify
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
1 files, 4 changesets, 4 total revisions



In this specific instance, hg debugindex will throw the following traceback:

c:\work\testx>hg debugindex dummyfile
   rev    offset  length   base linkrev nodeid       p1           p2
     0         0      67      0       0 36093c0a7eae 000000000000 000000000000
     1        67      62      0       1 657799c9432e 36093c0a7eae 000000000000
     2       129      84      0       2 8d6c704b2bf7 657799c9432e 000000000000
** unknown exception encountered, please report by visiting
**  http://mercurial.selenic.com/wiki/BugTracker
** Python 2.6.6 (r266:84297, Aug 24 2010, 18:13:38) [MSC v.1500 64 bit (AMD64)]
** Mercurial Distributed SCM (version 2.2.2)
** Extensions loaded:
Traceback (most recent call last):
  File "hg", line 42, in <module>
  File "mercurial\dispatch.pyo", line 27, in run
  File "mercurial\dispatch.pyo", line 64, in dispatch
  File "mercurial\dispatch.pyo", line 87, in _runcatch
  File "mercurial\dispatch.pyo", line 696, in _dispatch
  File "mercurial\dispatch.pyo", line 472, in runcommand
  File "mercurial\dispatch.pyo", line 786, in _runcommand
  File "mercurial\dispatch.pyo", line 757, in checkargs
  File "mercurial\dispatch.pyo", line 693, in <lambda>
  File "mercurial\util.pyo", line 463, in check
  File "mercurial\commands.pyo", line 1886, in debugindex
  File "mercurial\revlog.pyo", line 347, in chainbase
IndexError: revlog index out of range

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list