[Pkg-bazaar-maint] Bug#563741: bzr explodes messily on filenames containing LF

Ben Harris bjh21 at bjh21.me.uk
Mon Jan 4 23:38:16 UTC 2010


Package: bzr
Version: 1.5-1.1
Version: 2.0.2-1
Version: 2.0.3-1

If I try to commit a new file whose name contains a newline character, bzr 
explodes with a stack trace and asks me to file a bug report.  I don't 
expect bzr to be able to actually record such a silly filename, but it 
would be nice if it failed a little more gracefully.  Sample session 
(using 1.5-1.1) below.  Forcing the repository format gets a similar error 
out of 2.0.2-1, while using the default format gets a different (and 
marginally more helpful) stack trace.

chiark:~$ mkdir foo
chiark:~$ cd foo
chiark:~/foo$ bzr init --pack-0.92
chiark:~/foo$ touch "$(printf 'xxx\nyyy')"
chiark:~/foo$ bzr add "$(printf 'xxx\nyyy')"
added "xxx
yyy"
chiark:~/foo$ bzr commit -m "silly filename"
Committing to: /u2/bjharris/foo/
added xxx
yyy
bzr: ERROR: bzrlib.errors.KnitCorrupt: Knit <bzrlib.knit._PackAccess object at 0x882f6ec> corrupt: incorrect number of lines 4 != 3 for version {bjharris at chiark-20100104231636-4ynpdychlq525n8w}

Traceback (most recent call last):
   File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 846, in run_bzr_catch_errors
     return run_bzr(argv)
   File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 797, in run_bzr
     ret = run(*run_argv)
   File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 499, in run_argv_aliases
     return self.run(**all_cmd_args)
   File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 2364, in run
     author=author)
   File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 165, in write_locked
     return unbound(self, *args, **kwargs)
   File "/usr/lib/python2.5/site-packages/bzrlib/workingtree_4.py", line 240, in commit
     result = WorkingTree3.commit(self, message, revprops, *args, **kwargs)
   File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 165, in write_locked
     return unbound(self, *args, **kwargs)
   File "/usr/lib/python2.5/site-packages/bzrlib/mutabletree.py", line 197, in commit
     revprops=revprops, *args, **kwargs)
   File "/usr/lib/python2.5/site-packages/bzrlib/commit.py", line 372, in commit
     self.rev_id = self.builder.commit(self.message)
   File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 137, in commit
     self.new_inventory, self._config)
   File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 558, in add_revision
     rev.inventory_sha1 = inventory_vf.get_sha1s([revision_id])[0]
   File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 766, in get_sha1s
     record_map = self._get_record_map(version_ids)
   File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 1129, in _get_record_map
     self._data.read_records_iter(records):
   File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 2530, in read_records_iter
     content, digest = self._parse_record(version_id, data)
   File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 2477, in _parse_record
     version_id))
KnitCorrupt: Knit <bzrlib.knit._PackAccess object at 0x882f6ec> corrupt: 
incorrect number of lines 4 != 3 for version 
{bjharris at chiark-20100104231636-4ynpdychlq525n8w}

bzr 1.5 on python 2.5.2 (linux2)
arguments: ['/usr/bin/bzr', 'commit', '-m', 'silly filename']
encoding: 'ANSI_X3.4-1968', fsenc: 'ANSI_X3.4-1968', lang: None
plugins:
   bzrtools             /usr/lib/python2.5/site-packages/bzrlib/plugins/bzrtools [1.5.0]
   launchpad            /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [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.

Possibly-relevant packages:
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
pn  bzr-gtk        <none>         (no description available)
pn  bzr-svn        <none>         (no description available)
ii  bzrtools       1.5.0-1        Collection of tools for bzr
ii  libc6          2.7-18         GNU C Library: Shared libraries
ii  python         2.5.2-3        An interactive high-level object-oriented la
ii  python-central 0.6.8          register and build utility for Python packag
ii  python-paramik 1.7.4-0.1      Make ssh v2 connections with python
ii  python-pycurl  7.18.2-1       Python bindings to libcurl
pn  xdg-utils      <none>         (no description available)

Kernel version:
Linux chiark 2.6.16.60 #1 SMP Sun Feb 10 14:48:32 GMT 2008 i686 GNU/Linux

.bzr.log is attached.

-- 
Ben Harris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .bzr.log
Type: text/x-log
Size: 4314 bytes
Desc: .bzr.log demonstrating problem
URL: <http://lists.alioth.debian.org/pipermail/pkg-bazaar-maint/attachments/20100104/685bd1d8/attachment.bin>


More information about the Pkg-bazaar-maint mailing list