a few pointers needed for solving a bug

John Arbash Meinel john at arbash-meinel.com
Thu Mar 22 14:11:29 GMT 2007


> It could also be a PBKAC (problem between keyboard and chair), but I
> need to make sure :)

There should be no PEBKAC (problem exists ...) that results in an
internal assert. asserts are only used to trap developer errors.

It is a statement of "I assume things are this way", and obviously that
assumption is being violated.

My best guess as to why it doesn't always happen would be that it
depends on the filenames, and directory order. (It may also depend on
file-id values). So it would be a sorting order issue which causes the
bug to appear and disappear.



Sabin Iacob wrote:
> can someone take a look at https://launchpad.net/bugs/94037 and give me
> a few pointers?
> I am rather confused; I could reproduce it many times yesterday, did
> many installs in the mean while and it still came up, then today it
> suddenly disappeared, then appeared again on a fresh tree, plus some
> other one (please excuse me for abusing your software like this :P):
> 

...

> iacobs at moria ~/tmp/tst $ bzr init --dirstate-tags

I would guess that --dirstate or --dirstate-tags should perform the same
here. (since they use the same working tree format).

> iacobs at moria ~/tmp/tst $ bzr add .
> added some
> added some/test
> added some/test/dir
> added some/test/file
> added some/test/dir/file2
> iacobs at moria ~/tmp/tst $ bzr ci -m "boog take 1"
> added some
> added some/test
> added some/test/dir
> added some/test/dir/file2
> added some/test/file
> Committed revision 1.
> iacobs at moria ~/tmp/tst $ bzr mv some/test/* some/
> some/test/dir => some/dir
> some/test/file => some/file
> iacobs at moria ~/tmp/tst $ bzr rm some/test/
> iacobs at moria ~/tmp/tst $ rm -rf some/test/
> iacobs at moria ~/tmp/tst $ bzr ci -m "... and now you crash"
> renamed some/test/dir => some/dir
> bzr: ERROR: integrity error ? : mismatching tree_index, file_id and path
> iacobs at moria ~/tmp/tst $ bzr revert
> +N  some/test/
> R   some/dir/ => some/test/dir/
> R   some/file => some/test/file
> iacobs at moria ~/tmp/tst $ bzr mv some/test/* some/
> some/test/dir => some/dir
> some/test/file => some/file
> iacobs at moria ~/tmp/tst $ rm -rf some/test/
> iacobs at moria ~/tmp/tst $ bzr ci -m "... and now you crash"
> missing some/test
> bzr: ERROR: The file id dir-20070321101723-i1psulsgp9bfia34-3 is not
> present in the tree <WorkingTree4 of /home/iacobs/tmp/tst>.
> iacobs at moria ~/tmp/tst $ bzr revert
> +N  some/test/
> R   some/dir/ => some/test/dir/
> R   some/file => some/test/file
> bzr: ERROR: exceptions.AssertionError:
> 
> Traceback (most recent call last):
>  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 650,
> in run_bzr_catch_errors
>    return run_bzr(argv)
>  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 612,
> in run_bzr
>    ret = run(*run_argv)
>  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 304,
> in run_argv_aliases
>    return self.run(**all_cmd_args)
>  File "/usr/lib/python2.4/site-packages/bzrlib/builtins.py", line 2751,
> in run
>    not no_backup, pb, report_changes=True)
>  File "/usr/lib/python2.4/site-packages/bzrlib/mutabletree.py", line 38,
> in tree_write_locked
>    return unbound(self, *args, **kwargs)
>  File "/usr/lib/python2.4/site-packages/bzrlib/workingtree.py", line
> 1835, in revert
>    report_changes)
>  File "/usr/lib/python2.4/site-packages/bzrlib/transform.py", line 1428,
> in revert
>    tt.apply()
>  File "/usr/lib/python2.4/site-packages/bzrlib/transform.py", line 751,
> in apply
>    self._tree._write_inventory(inv)
>  File "/usr/lib/python2.4/site-packages/bzrlib/mutabletree.py", line 38,
> in tree_write_locked
>    return unbound(self, *args, **kwargs)
>  File "/usr/lib/python2.4/site-packages/bzrlib/workingtree_4.py", line
> 1207, in _write_inventory
>    self.current_dirstate().set_state_from_inventory(inv)
>  File "/usr/lib/python2.4/site-packages/bzrlib/dirstate.py", line 2007,
> in set_state_from_inventory
>    self._make_absent(current_old)
>  File "/usr/lib/python2.4/site-packages/bzrlib/dirstate.py", line 2055,
> in _make_absent
>    assert update_tree_details[0][0] != 'a' # absent
> AssertionError

^- Looking at this specific error, it seems to be related to my recent
bug fix.

 2366 Canonical.com Patch Queue Manager 2007-03-20
      (John Arbash Meinel) fix bug #93681 by not calling _make_absent
for removed entries.

You might try with bzr.dev 2365 and see if you can reproduce it, but it
fails with bzr.dev 2366.

You can do that with "cd path/to/bzr.dev; bzr revert -r 2365". That will
revert the contents to version 2365, and then you can go to 2366, and
then back to tip with "bzr revert".

John
=:->



More information about the bazaar mailing list