AssertionError in bzrlib._groupcompress_pyx.DeltaIndex._populate_first_index

Bug #633336 reported by David Clymer
38
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Martin Packman

Bug Description

I created a new branch of a remote svn repository, and everything appeared to copy without error, but at some point during the re-packing phase, I got an AssertionError:

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 911, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 1111, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 689, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 704, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 1246, in run
    source_branch=br_from)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/svn/remote.py", line 112, in sprout
    return super(SvnRemoteAccess, self).sprout(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/bzrdir.py", line 1259, in sprout
    result_repo.fetch(source_repository, fetch_spec=fetch_spec)
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 1741, in fetch
    find_ghosts=find_ghosts, fetch_spec=fetch_spec)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/svn/fetch.py", line 1377, in fetch
    self.target.pack(hint=pack_hint)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 194, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/repofmt/pack_repo.py", line 2399, in pack
    self._pack_collection.pack(hint=hint, clean_obsolete_packs=clean_obsolete_packs)
  File "/usr/lib/python2.5/site-packages/bzrlib/repofmt/pack_repo.py", line 1585, in pack
    self._execute_pack_operations(pack_operations, OptimisingPacker)
  File "/usr/lib/python2.5/site-packages/bzrlib/repofmt/groupcompress_repo.py", line 690, in _execute_pack_operations
    result = packer.pack()
  File "/usr/lib/python2.5/site-packages/bzrlib/repofmt/pack_repo.py", line 746, in pack
    return self._create_pack_from_packs()
  File "/usr/lib/python2.5/site-packages/bzrlib/repofmt/groupcompress_repo.py", line 475, in _create_pack_from_packs
    self._copy_text_texts()
  File "/usr/lib/python2.5/site-packages/bzrlib/repofmt/groupcompress_repo.py", line 458, in _copy_text_texts
    'texts', self._get_progress_stream, 4)
  File "/usr/lib/python2.5/site-packages/bzrlib/repofmt/groupcompress_repo.py", line 399, in _copy_stream
    reuse_blocks=False):
  File "/usr/lib/python2.5/site-packages/bzrlib/groupcompress.py", line 1721, in _insert_record_stream
    nostore_sha=nostore_sha)
  File "/usr/lib/python2.5/site-packages/bzrlib/groupcompress.py", line 797, in compress
    start, end, type = self._compress(key, bytes, len(bytes) / 2, soft)
  File "/usr/lib/python2.5/site-packages/bzrlib/groupcompress.py", line 967, in _compress
    delta = self._delta_index.make_delta(bytes, max_delta_size)
  File "_groupcompress_pyx.pyx", line 227, in bzrlib._groupcompress_pyx.DeltaIndex.make_delta
  File "_groupcompress_pyx.pyx", line 205, in bzrlib._groupcompress_pyx.DeltaIndex._populate_first_index
AssertionError

I've attached my bzr.log for more context.

Tags: memory

Related branches

Revision history for this message
David Clymer (vezult) wrote :
Revision history for this message
David Clymer (vezult) wrote :

I failed to mention that I am using the hardy PPA of bzr, on GNU/Linux (Debian Lenny).

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

reassigning to bzr, at least it should be giving a more appropriate exception

affects: bzr-svn → bzr
Revision history for this message
Andrew Bennetts (spiv) wrote :

This is probably an out-of-memory error. We should report it better, and of course try to use less memory in the first place.

The line numbers in your traceback imply you are using bzr 2.1.x? If so, you may find upgrading to 2.2 or even better the current development version works better, as they have some improvements to reduce bzr's memory consumption in various situations.

Changed in bzr:
importance: Undecided → Medium
status: New → Confirmed
tags: added: memory
summary: - crash on new branch from svn
+ AssertionError in
+ bzrlib._groupcompress_pyx.DeltaIndex._populate_first_index
Revision history for this message
Andrew Bennetts (spiv) wrote :

The fetching-from-svn aspect is a bit unique, but I think this is essentially the same as the other out-of-memory during pack bugs we've seen. So I'm marking this as a dupe of bug 602614 (which already has a couple of other similar reports of that AssertionError during a pack marked as dupes of it).

Revision history for this message
Martin Pool (mbp) wrote :

Since the traceback is a bit different from bug 602614, I'm going to say this is actually a dupe of bug 728854. Perhaps they're easily fixed together.

Revision history for this message
Martin Pool (mbp) wrote :

also, that shows it can still be hit in 2.3.0

Revision history for this message
Martin Packman (gz) wrote :

Duping newer bug to this one rather than visa versa.

Will address this as per my suggestion bug 721897 comment 2 by raising a MemoryError rather than asserting. There's a slight issue in that the current API in diff-delta.c is ambiguous in the failure state, and the code in bzrlib is significantly diverged from the upstream in git.

Changed in bzr:
assignee: nobody → Martin [gz] (gz)
Martin Packman (gz)
Changed in bzr:
status: Confirmed → In Progress
Revision history for this message
Vikash Madhow (vikash-madhow) wrote :

Is there a work-around for this bug which is of critical importance to me since it is preventing to commit my work. Is it possible, for example for bazaar to commit without packing?

Revision history for this message
Vincent Ladeuil (vila) wrote :

@Vikash: There is a fix under review in the branch associated to this bug.

It requires recompiling the extensions so if you can do that, your feedback on the fix will be greatly appreciated.

You can also read the comments on the review: https://code.launchpad.net/~gz/bzr/create_delta_index_memoryerror_633336/+merge/52251

Revision history for this message
Martin Packman (gz) wrote :

The next version of Bazaar will correctly report this kind of failure as a MemoryError rather than an assertion.

For the underlying problems, see bug 109114 for large files taking lots of memory, and bug 602614 for OOM during autorepack.

Changed in bzr:
milestone: none → 2.4b2
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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