dirstate C helper MemoryError on bad dirstate file

Bug #153749 reported by Robert Collins
22
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Unassigned

Bug Description

with the C extension:
  File "_dirstate_helpers_c.pyx", line 694, in _dirstate_helpers_c._read_dirblocks_c
  File "_dirstate_helpers_c.pyx", line 661, in _dirstate_helpers_c.Reader._parse_dirblocks
  File "_dirstate_helpers_c.pyx", line 608, in _dirstate_helpers_c.Reader._get_entry
  File "_dirstate_helpers_c.pyx", line 502, in _dirstate_helpers_c.Reader.get_next_str
MemoryError

With the python helper:
  File "/usr/lib/python2.5/site-packages/bzrlib/_dirstate_helpers_py.py", line 203, in _read_dirblocks_py
    assert trailing == ''
AssertionError

While both fail, MemoryError is misleading to users.

Tags: dirstate
Revision history for this message
Monty Taylor (mordred) wrote :

Here's a copy of the dirstate file that caused the error. I've got a copy of the working tree in case anyone ever needs it.

Revision history for this message
Michael Gliwinski (tzeentch-gm) wrote :

I'm getting the same thing on bzr 0.90 on gutsy. Most operations fail with memory error, bzr check fails with 'Unprintable exception BzrCheckError...'. Tried creating another branch from the original one, but it too fails, this time with 'InstallFailed: Could not install revisions...'. This may be a damaged branch but I really don't know how it could have happened. I'm attaching a part of ~/.bzr.log and the dirstate file.

Revision history for this message
Michael Gliwinski (tzeentch-gm) wrote :
Revision history for this message
brettatoms (brettatoms) wrote :

In the middle of bzr returning from a 'bzr status" my computer locked up. Once I rebooted I started to get this error. Now "bzr status" and many other commands give this same error.

Here is the entire error message:
---------------------------------------------------
bzr: ERROR: exceptions.MemoryError:

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 806, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 762, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 492, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 772, in ignore_pipe
    result = func(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 189, in run
    to_file=self.outf, short=short, versioned=versioned)
  File "/usr/lib/python2.5/site-packages/bzrlib/status.py", line 114, in show_tree_status
    want_unversioned=want_unversioned)
  File "/usr/lib/python2.5/site-packages/bzrlib/tree.py", line 93, in changes_from
    want_unversioned=want_unversioned,
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 127, in read_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/tree.py", line 707, in compare
    want_unversioned=want_unversioned)
  File "/usr/lib/python2.5/site-packages/bzrlib/delta.py", line 217, in _compare_trees
    want_unversioned=want_unversioned):
  File "/usr/lib/python2.5/site-packages/bzrlib/workingtree_4.py", line 1793, in _iter_changes
    state._read_dirblocks_if_needed()
  File "/usr/lib/python2.5/site-packages/bzrlib/dirstate.py", line 1877, in _read_dirblocks_if_needed
    _read_dirblocks(self)
  File "_dirstate_helpers_c.pyx", line 694, in _dirstate_helpers_c._read_dirblocks_c
  File "_dirstate_helpers_c.pyx", line 661, in _dirstate_helpers_c.Reader._parse_dirblocks
  File "_dirstate_helpers_c.pyx", line 608, in _dirstate_helpers_c.Reader._get_entry
  File "_dirstate_helpers_c.pyx", line 502, in _dirstate_helpers_c.Reader.get_next_str
MemoryError

bzr 1.1.0 on python 2.5.1.final.0 (linux2)
arguments: ['/usr/bin/bzr', 'status']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  bzrtools /usr/lib/python2.5/site-packages/bzrlib/plugins/bzrtools [1.1.0]
  gtk /usr/lib/python2.5/site-packages/bzrlib/plugins/gtk [0.93.0]
  launchpad /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [unknown]
  multiparent /usr/lib/python2.5/site-packages/bzrlib/plugins/multiparent.pyc [unknown]
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.
--------------------------------

Revision history for this message
John A Meinel (jameinel) wrote :

It will now raise DirstateCorrupt errors, rather than MemoryError or SystemError.

Changed in bzr:
importance: Undecided → High
milestone: none → 1.7
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.