bzr crashed with ValueError in _add_index()

Bug #627202 reported by Ted Gould
86
This bug affects 12 people
Affects Status Importance Assigned to Milestone
bzr search plugin
Fix Released
High
Martin Pool
bzr-search (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: bzr

Updating a branch from an LP repository I got a "math domain" error.

ProblemType: Crash
DistroRelease: Ubuntu 10.10
Package: bzr 2.2.0-1
ProcVersionSignature: Ubuntu 2.6.35-19.28-generic 2.6.35.3
Uname: Linux 2.6.35-19-generic x86_64
NonfreeKernelModules: nvidia wl
Architecture: amd64
BzrDebugFlags: set()
BzrVersion: 2.2.0
CommandLine: ['/usr/bin/bzr', 'pull']
CrashDb: bzr
Date: Mon Aug 30 22:07:11 2010
EcryptfsInUse: Yes
ExecutablePath: /usr/bin/bzr
FileSystemEncoding: UTF-8
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release amd64 (20100429)
InterpreterPath: /usr/bin/python2.6
Locale: en_US.utf8
Platform: Linux-2.6.35-19-generic-x86_64-with-Ubuntu-10.10-maverick
ProcCmdline: /usr/bin/python /usr/bin/bzr pull
ProcEnviron:
 SHELL=/bin/bash
 LANG=en_US.utf8
PythonVersion: 2.6.6
SourcePackage: bzr
Title: bzr crashed with ValueError in _add_index()
UserEncoding: UTF-8
UserGroups: adm admin audio cdrom dialout dip fax floppy fuse libvirtd lpadmin netdev plugdev sambashare tape video

Related branches

Revision history for this message
Ted Gould (ted) wrote :
visibility: private → public
Revision history for this message
Andrew Bennetts (spiv) wrote :

This appears to be due to the bzr-search plugin. A workaround would be to set BZR_DISABLE_PLUGINS=search in your environment.

affects: bzr (Ubuntu) → bzr-search (Ubuntu)
tags: removed: need-duplicate-check
Daniel Hahler (blueyed)
Changed in bzr-search:
status: New → Confirmed
Revision history for this message
Martin Pool (mbp) wrote :

Hi, because it's getting so many dupes and seems easy.

Changed in bzr-search:
assignee: nobody → Martin Pool (mbp)
importance: Undecided → High
Revision history for this message
Martin Pool (mbp) wrote :

So the reason this happens seems fairly obvious: we repacked 0 revisions and log(0) -> blam.

This ought to be reproducible but I can't work out quite how it is getting hit.

I tried this:

=== modified file 'tests/test_index.py'
--- tests/test_index.py 2010-05-14 14:57:37 +0000
+++ tests/test_index.py 2011-02-01 04:07:02 +0000
@@ -1,5 +1,6 @@
 # search, a bzr plugin for searching within bzr branches/repositories.
 # Copyright (C) 2008 Robert Collins
+# Copyright (C) 2011 Martin Pool
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License version 2 as published
@@ -637,6 +638,17 @@

 class TestAutoIndex(TestCaseWithTransport):

+ def test_index_empty_branch(self):
+ """No problems with indexing an empty repository.
+
+ See <http://pad.lv/627202>
+ """
+ # Indexing a repository
+ tree = self.make_branch_and_tree("foo")
+ search_index = index.init_index(tree.branch)
+ search_index.index_branch(tree.branch, tree.last_revision())
+ search_index.index_branch(tree.branch, tree.last_revision())
+
     def test_no_index_no_error(self):
         tree = self.make_branch_and_tree("foo")
         search._install_hooks()

I might just try a blind fix for it.

Martin Pool (mbp)
Changed in bzr-search:
status: Confirmed → In Progress
Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 627202] Re: bzr crashed with ValueError in _add_index()

not repacked 0, 0 *in the repo* and 0 repacked. I'M guessing a stacked
branch would let one trigger this, but the fix, though smelly is
functional.

Changed in bzr-search:
status: In Progress → Fix Released
Jelmer Vernooij (jelmer)
Changed in bzr-search (Ubuntu):
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bzr-search - 1.7.0~bzr86-1

---------------
bzr-search (1.7.0~bzr86-1) unstable; urgency=low

  * New upstream snapshot.
   + Fixes math domain error. LP: #627202
  * Add build dependency on python-bzrlib.tests, for compatibility with
    newer versions of bzr.
 -- Ubuntu Archive Auto-Sync <email address hidden> Tue, 03 May 2011 08:10:03 +0000

Changed in bzr-search (Ubuntu):
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

Remote bug watches

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