pre-0.8: `bzr add' hangs with repository in /

Bug #37036 reported by Jos Backus
4
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Robert Collins

Bug Description

0.7 works as expected:

lizzy:/# uname -a
FreeBSD lizzy.catnook.local 7.0-CURRENT FreeBSD 7.0-CURRENT #20: Sun Mar 19
17:20:05 PST 2006 <email address hidden>:/usr/obj/usr/src/sys/LIZZY
i386
lizzy:/# echo $PYTHONPATH

lizzy:/# bzr version
bzr (bazaar-ng) 0.7
Copyright 2005,06 Canonical Development Ltd.
http://bazaar-ng.org/

bzr comes with ABSOLUTELY NO WARRANTY. bzr is free software, and
you may use, modify and redistribute it under the terms of the GNU
General Public License version 2 or later.
lizzy:/# bzr init
lizzy:/# bzr add etc/motd
added etc
added etc/motd
lizzy:/#

But with 0.8 rev 1599 at least, `bzr add' hangs in this case:

lizzy:/# echo $PYTHONPATH
/home/jos/bazaar-ng/src/bzr.dev/bzrlib
lizzy:/# /home/jos/bazaar-ng/src/bzr.dev/bzr version
bzr (bazaar-ng) 0.8pre
  bzr checkout, revision 1599
  nick: bzr.dev
  revid: <email address hidden>
Copyright 2005,06 Canonical Development Ltd.
http://bazaar-ng.org/

bzr comes with ABSOLUTELY NO WARRANTY. bzr is free software, and
you may use, modify and redistribute it under the terms of the GNU
General Public License version 2 or later.
lizzy:/# /home/jos/bazaar-ng/src/bzr.dev/bzr init
lizzy:/# /home/jos/bazaar-ng/src/bzr.dev/bzr add etc/motd
[Here I have to hit ^C as the command hangs]
^Cbzr: ERROR: exceptions.KeyboardInterrupt:
  at /usr/local/lib/python2.4/posixpath.py line 81
  in split
lizzy:/#

Revision history for this message
Jos Backus (jos-catnook) wrote :

.bzr.log backtrace:

bzr 0.8pre invoked on python 2.4.2.final.0 (freebsd7)
  arguments: ['/home/jos/bazaar-ng/src/bzr.dev/bzr', 'add', 'etc/motd']
  working dir: u'/'
looking for plugins in /home/jos/bazaar-ng/src/bzr.dev/bzrlib/plugins
Plugin name __init__ already loaded
Plugin name __init__ already loaded
looking for plugins in /home/jos/.bazaar/plugins
not a branch in: u'/etc/motd/' Not a branch: /etc/motd/
not a branch in: u'/etc/' Not a branch: /etc/
[ 2827] Fri 17:33:17.901 ERROR: exceptions.KeyboardInterrupt:
  at /usr/local/lib/python2.4/posixpath.py line 81
  in split
Traceback (most recent call last):
  File "/home/jos/bazaar-ng/src/bzr.dev/bzrlib/commands.py", line 653, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/home/jos/bazaar-ng/src/bzr.dev/bzrlib/commands.py", line 615, in run_bzr
    ret = run(*run_argv)
  File "/home/jos/bazaar-ng/src/bzr.dev/bzrlib/commands.py", line 246, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/jos/bazaar-ng/src/bzr.dev/bzrlib/builtins.py", line 258, in run
    action)
  File "/home/jos/bazaar-ng/src/bzr.dev/bzrlib/add.py", line 83, in smart_add
    tree = WorkingTree.open_containing(file_list[0])[0]
  File "/home/jos/bazaar-ng/src/bzr.dev/bzrlib/workingtree.py", line 319, in open_containing
    control, relpath = bzrdir.BzrDir.open_containing(path)
  File "/home/jos/bazaar-ng/src/bzr.dev/bzrlib/bzrdir.py", line 434, in open_containing
    return BzrDir.open_containing_from_transport(get_transport(url))
  File "/home/jos/bazaar-ng/src/bzr.dev/bzrlib/bzrdir.py", line 454, in open_containing_from_transport
    return format.open(a_transport), a_transport.relpath(url)
  File "/home/jos/bazaar-ng/src/bzr.dev/bzrlib/transport/local.py", line 74, in relpath
    return relpath(self.base[:-1], abspath)
  File "/home/jos/bazaar-ng/bzr.dev/bzrlib/osutils.py", line 594, in relpath
    head, tail = os.path.split(head)
  File "/usr/local/lib/python2.4/posixpath.py", line 81, in split
    return head, tail
KeyboardInterrupt

return code 3

Revision history for this message
Michael Ellerman (michael-ellerman) wrote :

So the bug is in LocalTransport.relpath() and/or osutils.relpath().

LocalTransport.relpath ()eventually does:
        return relpath(self.base[:-1], abspath)

where self.base == '/', this causes osutils.relpath() to loop forever testing len(head) >= len(base).

Not sure on the fix.

Changed in bzr:
status: Unconfirmed → Confirmed
Changed in bzr:
assignee: nobody → lifeless
status: Confirmed → Fix Committed
John A Meinel (jameinel)
Changed in bzr:
status: Fix Committed → Fix Released
Revision history for this message
Jos Backus (jos-catnook) wrote : Re: [Bug 37036] Re: pre-0.8: `bzr add' hangs with repository in /

Thanks John!

Jos

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.