Segmentation fault and crash using bzr on generated SVN repository and working copy

Bug #319313 reported by Wesley J. Landaker
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar Subversion Plugin
Fix Released
Undecided
Jelmer Vernooij
subvertpy
Fix Released
Undecided
Jelmer Vernooij

Bug Description

UPDATE: the second crash is split out into bzr-svn bug #319317 and involves symlinks to/from Unicode filenames. So this bug can be considered only about the segfault.

Using a generated SVN repository and working copy, I'm able to get bzr-svn to segfault and crash. This looks like two different problems, but they are triggered with essentially the same test case. We can split this into two bugs if you'd rather.

I'm using bzr.dev head + my bugfix to bug #317644, bzr-svn 0.5 head, subvertpy head.

Details:

The SVN repository is generated, and has no semantic meaning, but is valid.
The SVN working copy is put into an unexpected, but normal and recoverable state, where a file has unexpectedly changed status, as illustrated below:

$ svn status
R 򉣒𿯸򓒼𡦇򯥯񎸡񿢫󘳒󼑘󥢉/𪚱𪖎񭞦􊤂𚮝󤚊񊌕󻄋󿑭
R 򉣒𿯸򓒼𡦇򯥯񎸡񿢫󘳒󼑘󥢉/󌛾񬰜򹷴𡦧򽷏𩕶􌰦/񲖞񨹴񁓦䮥񿺙5
A 򉣒𿯸򓒼𡦇򯥯񎸡񿢫󘳒󼑘󥢉/򾋥򡣱򂔷󶮗𦈘򃖨漂󽑖󴞰򽇘/󼸗󰻋򣲕󂳞􈙪򹀩񄢠􅎉񎊲
A 򉣒𿯸򓒼𡦇򯥯񎸡񿢫󘳒󼑘󥢉/򾋥򡣱򂔷󶮗𦈘򃖨漂󽑖󴞰򽇘/󼸗󰻋򣲕󂳞􈙪򹀩񄢠􅎉񎊲/󤦷􎁌󫭒
A 򉣒𿯸򓒼𡦇򯥯񎸡񿢫󘳒󼑘󥢉/򺻙􆵍𧧄󧧔򇏒񁪒򁰨񤏷󃵧񹜂
A 򉣒𿯸򓒼𡦇򯥯񎸡񿢫󘳒󼑘󥢉/𱼆󺰼򟽰򫓫􏃻􅺜򼖮󲻒򑭙񘘺/𜷕򉨕򛖭
A 򰜋󩺧򷒏𦮤孿󂠩񌒅󍁢
$ svn commit -m "This won't work"
svn: Commit failed (details follow):
svn: Entry '/home/wjlanda/work/foss/bzr/svn-rnd/tmpWl3oWP/wc/򉣒𿯸򓒼𡦇򯥯񎸡񿢫󘳒󼑘󥢉/󌛾񬰜򹷴𡦧򽷏𩕶􌰦/񲖞񨹴񁓦䮥񿺙5' has unexpectedly changed special status

When trying to use bzr on this SVN working copy, I get a segmentation fault:

$ bzr up
Segmentation fault

If I then fix the working copy to get it out of the unexpected changed status state, then bzr crashes with a different error, but not a segfault:
$ svn revert 򉣒𿯸򓒼𡦇򯥯񎸡񿢫󘳒󼑘/󌛾񬰜򹷴𡦧򽷏𩕶􌰦/񲖞񨹴񁓦䮥񿺙
Reverted '򉣒𿯸򓒼𡦇򯥯񎸡񿢫󘳒󼑘󥢉/󌛾񬰜򹷴𡦧򽷏𩕶􌰦/񲖞񨹴񁓦䮥񿺙5'
$ svn commit -m "Commit"
Replacing 򉣒𿯸򓒼𡦇򯥯񎸡񿢫󘳒󼑘󥢉/𪚱𪖎񭞦􊤂𚮝󤚊񊌕󻄋󿑭
Adding 򉣒𿯸򓒼𡦇򯥯񎸡񿢫󘳒󼑘󥢉/𱼆󺰼򟽰򫓫􏃻􅺜򼖮󲻒򑭙񘘺/𜷕򉨕򛖭
Adding 򉣒𿯸򓒼𡦇򯥯񎸡񿢫󘳒󼑘󥢉/򺻙􆵍𧧄󧧔򇏒񁪒򁰨񤏷󃵧񹜂
Adding 򉣒𿯸򓒼𡦇򯥯񎸡񿢫󘳒󼑘󥢉/򾋥򡣱򂔷󶮗𦈘򃖨漂󽑖󴞰򽇘/󼸗󰻋򣲕󂳞􈙪򹀩񄢠􅎉񎊲
Adding 򉣒𿯸򓒼𡦇򯥯񎸡񿢫󘳒󼑘󥢉/򾋥򡣱򂔷󶮗𦈘򃖨漂󽑖󴞰򽇘/󼸗󰻋򣲕󂳞􈙪򹀩񄢠􅎉񎊲/󤦷􎁌󫭒
Adding 򰜋󩺧򷒏𦮤孿󂠩񌒅󍁢
Transmitting file data ...
Committed revision 85.
$ bzr up
bzr: ERROR: exceptions.UnicodeEncodeError: 'ascii' codec can't encode characters in position 49-53: ordinal not in range(128)

Traceback (most recent call last):
  File "/home/wjlanda/lib/python/bzrlib/commands.py", line 893, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/home/wjlanda/lib/python/bzrlib/commands.py", line 839, in run_bzr
    ret = run(*run_argv)
  File "/home/wjlanda/lib/python/bzrlib/commands.py", line 539, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/wjlanda/lib/python/bzrlib/builtins.py", line 1189, in run
    tree = WorkingTree.open_containing(dir)[0]
  File "/home/wjlanda/lib/python/bzrlib/workingtree.py", line 333, in open_containing
    return control.open_workingtree(), relpath
  File "/home/wjlanda/.bazaar/plugins/svn/workingtree.py", line 830, in open_workingtree
    return SvnWorkingTree(self, self.local_path, self.open_branch())
  File "/home/wjlanda/.bazaar/plugins/svn/workingtree.py", line 114, in __init__
    self._update_base_revnum(max_rev)
  File "/home/wjlanda/.bazaar/plugins/svn/workingtree.py", line 551, in _update_base_revnum
    self.read_working_inventory()
  File "/home/wjlanda/.bazaar/plugins/svn/workingtree.py", line 422, in read_working_inventory
    add_dir_to_inv(u"", rootwc, None)
  File "/home/wjlanda/.bazaar/plugins/svn/workingtree.py", line 416, in add_dir_to_inv
    add_file_to_inv(subrelpath, subid, subrevid, id)
  File "/home/wjlanda/.bazaar/plugins/svn/workingtree.py", line 307, in add_file_to_inv
    file.symlink_target = os.readlink(self.abspath(relpath))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 49-53: ordinal not in range(128)

bzr 1.12dev on python 2.5.2 (linux2)
arguments: ['/home/wjlanda/bin/bzr', 'up']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  bisect /home/wjlanda/.bazaar/plugins/bisect [1.1.0.pre.0]
  bzrtools /usr/lib/python2.5/site-packages/bzrlib/plugins/bzrtools [1.11]
  cvsps_import /usr/lib/python2.5/site-packages/bzrlib/plugins/cvsps_import [unknown]
  gtk /home/wjlanda/.bazaar/plugins/gtk [0.96.0.dev.1]
  launchpad /home/wjlanda/lib/python/bzrlib/plugins/launchpad [unknown]
  loom /usr/lib/python2.5/site-packages/bzrlib/plugins/loom [1.4dev]
  netrc_credential_store /home/wjlanda/lib/python/bzrlib/plugins/netrc_credential_store [unknown]
  qbzr /home/wjlanda/.bazaar/plugins/qbzr [0.9.7dev]
  rebase /usr/lib/python2.5/site-packages/bzrlib/plugins/rebase [0.4.2]
  search /usr/lib/python2.5/site-packages/bzrlib/plugins/search [1.7dev]
  stats /usr/lib/python2.5/site-packages/bzrlib/plugins/stats [unknown]
  svn /home/wjlanda/.bazaar/plugins/svn [0.5rc1]
  upload /usr/lib/python2.5/site-packages/bzrlib/plugins/upload [0.1]
*** 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.

Revision history for this message
Wesley J. Landaker (wjl) wrote :
Revision history for this message
Wesley J. Landaker (wjl) wrote :

Just a note: to reproduce this, you'll need to unpack the tarball with a UTF-8 locale and you may have to "svn switch --relocate" the wc since it stores a hardcoded path.

Revision history for this message
Wesley J. Landaker (wjl) wrote :

If my strace-fu is good enough, I think the segfault is coming from subvertpy, so I've linked it there.

Wesley J. Landaker (wjl)
description: updated
Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 319313] [NEW] Segmentation fault and crash using bzr on generated SVN repository and working copy

  affects subvertpy
  status fixreleased

Fixed in subvertpy trunk. Thanks for the very detailed bugreport!
--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/
Jabber: <email address hidden>

Changed in subvertpy:
status: New → Fix Released
Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 319313] [NEW] Segmentation fault and crash using bzr on generated SVN repository and working copy

  affects bzr-svn
  status fixreleased
--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/
Jabber: <email address hidden>

Changed in bzr-svn:
status: New → Fix Released
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
assignee: nobody → Jelmer Vernooij (jelmer)
Changed in subvertpy:
assignee: nobody → Jelmer Vernooij (jelmer)
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.