show_file_differences in Annotate history pane crashes

Bug #505987 reported by David Roberts
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Invalid
Undecided
Unassigned
Bazaar Explorer
Invalid
Medium
Unassigned
QBzr
Fix Released
Critical
Alexander Belchenko

Bug Description

Bazaar (bzr) 2.1.0b4 running on WinXP, installed with bzr-2.1.0b4-*setup.exe

qbzr (r1169) and explorer (r352) branched from lp: on day of this bug report.

From either WorkingTree or BrowseItems, invoke Show_Annotate via right-click.

In resulting [Q]annotate window, in the history (lower left) pane, left clicking (to select default action 'Show_file_differences')
crashes with the following report -

bzr: ERROR: exceptions.TypeError: Bit 0 of StaticTuple(u'news-20090601025455-1api4unhoxk91d49-2',) is not a string: u'news-20090601025455-1api4unhoxk91d49-2'

Traceback (most recent call last):
  File "C:/localapp/Program Files/Bazaar/plugins\qbzr\lib\trace.py", line 291, in reports_exception_decorate
  File "C:/localapp/Program Files/Bazaar/plugins\qbzr\lib\diffwindow.py", line 225, in initial_load
  File "C:/localapp/Program Files/Bazaar/plugins\qbzr\lib\diffwindow.py", line 233, in load_branch_info
  File "C:/localapp/Program Files/Bazaar/plugins\qbzr\lib\diff_arg.py", line 86, in get_diff_window_args
  File "C:/localapp/Program Files/Bazaar/plugins\qbzr\lib\diff_arg.py", line 79, in load_new_tree_and_paths
  File "bzrlib\tree.pyo", line 158, in id2path
  File "bzrlib\inventory.pyo", line 770, in id2path
  File "bzrlib\inventory.pyo", line 2056, in _iter_file_id_parents
  File "bzrlib\inventory.pyo", line 2016, in __getitem__
  File "bzrlib\chk_map.pyo", line 1028, in iteritems
  File "bzrlib\chk_map.pyo", line 1078, in _iter_nodes
  File "bzrlib\chk_map.pyo", line 1314, in _search_prefix_filter
  File "_chk_map_pyx.pyx", line 162, in bzrlib._chk_map_pyx._search_key_255
TypeError: Bit 0 of StaticTuple(u'news-20090601025455-1api4unhoxk91d49-2',) is not a string: u'news-20090601025455-1api4unhoxk91d49-2'

bzr 2.1.0b4 on python 2.5.4 (win32)
arguments: ['C:\\localapp\\Program Files\\Bazaar\\bzr.exe', 'qbrowse', '-r-1']
encoding: 'cp1252', fsenc: 'mbcs', lang: None
plugins:
  bzrtools C:\localapp\Program Files\Bazaar\plugins\bzrtools [2.1.0b1]
  explorer C:\localapp\Program Files\Bazaar\plugins\explorer [0.11.0dev]
  extmerge C:\localapp\Program Files\Bazaar\plugins\extmerge [unknown]
  launchpad C:\localapp\Program Files\Bazaar\plugins\launchpad [2.1.0b4]
  netrc_credential_store C:\localapp\Program Files\Bazaar\plugins\netrc_credential_store [2.1.0b4]
  qbzr C:\localapp\Program Files\Bazaar\plugins\qbzr [0.17.0]
  rebase C:\localapp\Program Files\Bazaar\plugins\rebase [0.5.5]
  upload C:\localapp\Program Files\Bazaar\plugins\upload [1.0.0dev]

Note that directly invoking 'bzr qannotate <file>' on the same file in the WT does NOT exhibit the same failure,
so this bug is being opened against bzr-explorer not qbzr.

Related branches

Revision history for this message
Alexander Belchenko (bialix) wrote :

Added bzr core to the Affected list, because the error occurs deep in the bzr internals.

Revision history for this message
Martin Pool (mbp) wrote :

Wow, that's a pretty low-level error, it looks almost like file or memory corruption. Is it consistently reproducible on this branch? Does 'bzr check' pass?

Changed in bzr:
status: New → Incomplete
Revision history for this message
John A Meinel (jameinel) wrote :

We are getting passed a Unicode string holding a file-id.

I'm pretty sure it is just going through one of the QBzr dialogs, given the "get_diff_window_args" call, and it certainly looks like the file_id is passed down from 'id2path'. We *could* add a 'str(file_id)' or "file_id.encode('utf-8')" on our end, but we're pretty good about ensuring we only have 'str' file-ids internally. I'd rather have the qbzr code do the type checking.

Revision history for this message
David Roberts (smartgpx) wrote :

Problem is consistently reproducible on a branch created by running 'bzr branch lp:bzr-explorer'

'bzr check' on the branch runs without error.

At the time of writing it seems this is the ONLY branch that I have tried that exhibits this error. (But it still occurs if I browse a copy that is not the live/running/executing code for explorer.) For instance, a branch of lp:qbzr taken under the same circumstances does not trigger the error.

A further discovery is that qbrowse used from the cli - not using explorer - will reproduce the error. (But as already stated, qannotate does not.)

So to reproduce -
bzr branch lp:bzr-explorer
cd bzr-explorer
bzr qbrowse
  Right-Click and Show_annotate a file
  in the lower-left history pane for that file double-click on a revision

Perhaps this bug does need to be raised against qbzr after all?

Revision history for this message
David Roberts (smartgpx) wrote :

I can report that the issue is not unique to a branch of bzr-explorer. It also occurs with a branch whose parent is bzr+ssh://bazaar.launchpad.net/~vcs-imports/emacs/trunk/

I have also found an old branch of lp:bzr-explorer at r251 - this bug is NOT apparent when exploring that branch. [Note: only exploring the branch, not executing the code in it.] (But perhaps not suprisingly, reverting today's branch back to the same revision and then 'exploring' it does not remove the trigger of the error.)

Revision history for this message
David Roberts (smartgpx) wrote :

What additional information is needed to elevate the status of this report from 'incomplete'?

Revision history for this message
Alexander Belchenko (bialix) wrote :

Me or other qbzr dev should look and try to reproduce the problem you describe to understand either the problem in qbzr or in bzr-explorer. We're lack of manpower these days.

Revision history for this message
David Roberts (smartgpx) wrote :

Still apparent on WinXP with bzr installed from bzr-2.1.0rc1-1-setup.exe, explorer 1.0.0dev r407, qbzr 0.18.0 r1190

It is in some way a 'sensitivity' to the content or format of the branch being explored. It is triggered inspecting a file in bzr-explorer r407, but NOT when inspecting qbzr r1190.

Changed in bzr-explorer:
importance: Undecided → Medium
status: New → Confirmed
Changed in qbzr:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Gordon Tyler (doxxx) wrote :

I can trigger this error by using Annotate on bzrlib/trace.py of the current bzr.dev.

Revision history for this message
Alexander Belchenko (bialix) wrote :

Thanks, Gordon, I can reproduce it now.

bzr: ERROR: exceptions.TypeError: Bit 0 of StaticTuple(u'trace.py-20050309040759-c8ed824bdcd4748a',) is not a string: u'trace.py-20050309040759-c8ed824bdcd4748a'

Traceback (most recent call last):
  File "C:\work\Bazaar\plugins\qbzr\lib\trace.py", line 291, in reports_exception_decorate
  File "C:\work\Bazaar\plugins\qbzr\lib\diffwindow.py", line 225, in initial_load
  File "C:\work\Bazaar\plugins\qbzr\lib\diffwindow.py", line 233, in load_branch_info
  File "C:\work\Bazaar\plugins\qbzr\lib\diff_arg.py", line 88, in get_diff_window_args
  File "C:\work\Bazaar\plugins\qbzr\lib\diff_arg.py", line 81, in load_new_tree_and_paths
  File "bzrlib\tree.pyo", line 158, in id2path
  File "bzrlib\inventory.pyo", line 770, in id2path
  File "bzrlib\inventory.pyo", line 2056, in _iter_file_id_parents
  File "bzrlib\inventory.pyo", line 2016, in __getitem__
  File "bzrlib\chk_map.pyo", line 1049, in iteritems
  File "bzrlib\chk_map.pyo", line 1099, in _iter_nodes
  File "bzrlib\chk_map.pyo", line 1335, in _search_prefix_filter
  File "_chk_map_pyx.pyx", line 162, in bzrlib._chk_map_pyx._search_key_255
TypeError: Bit 0 of StaticTuple(u'trace.py-20050309040759-c8ed824bdcd4748a',) is not a string: u'trace.py-20050309040759-c8ed824bdcd4748a'

Changed in bzr-explorer:
status: Confirmed → Invalid
Changed in qbzr:
importance: High → Critical
milestone: none → 0.18.3
Revision history for this message
Alexander Belchenko (bialix) wrote :

in treewidget.py:

    @ui_current_widget
    def show_file_annotate(self):
        """Show qannotate for selected file."""
        index = self.currentIndex()
        file_id = unicode(index.data(self.tree_model.FILEID).toString())
        path = unicode(index.data(self.tree_model.PATH).toString())

file_id should NEVER be unicode.

Changed in bzr:
status: Incomplete → Invalid
Changed in qbzr:
status: Confirmed → In Progress
assignee: nobody → Alexander Belchenko (bialix)
Changed in qbzr:
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.