http urllib hides programming errors related exceptions

Bug #160012 reported by Vincent Ladeuil
4
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Low
Vincent Ladeuil

Bug Description

The http urllib implementation may, in some rather rare occurrences, hides programming errors by catching too much exceptions and retrying the current request.

I encounter that one while working on the webdav plugin and even there writing the correct test was a bit hairy (now that the bug is fixed in webdav, I had to write no less than 5 broken classes to be able to reproduce it).

Bug filed so that the associated patch can be merged into bzr even if the corresponding tests only exists for webdav.

Vincent Ladeuil (vila)
Changed in bzr:
assignee: nobody → v-ladeuil
status: New → In Progress
importance: Undecided → Low
Revision history for this message
Vincent Ladeuil (vila) wrote :

I forgot to mention that the bug manifested itself because webdav was issuing write requests, whereas with read requests (as bzr uses the urllib implementation) the bug do not occurs.

Vincent Ladeuil (vila)
Changed in bzr:
status: In Progress → Fix Committed
Vincent Ladeuil (vila)
Changed in bzr:
status: Fix Committed → Fix Released
Revision history for this message
cbr (carsten-bleser-rasmussen) wrote :

I am running bzr on a laptop up against a server via openvpn,
and I using sftp under bzr.
OS system:
flyvemaskine:~> uname -a
Linux flyvemaskine 2.6.22-14-generic #1 SMP Tue Feb 12 07:42:25 UTC 2008 i686 GNU/Linux
Package system Ubuntu 8.04 TLS

If I try do status bzr return a seg-fault
 flyvemaskine:~/src/work/dversion> bzr status
Segmentation fault
flyvemaskine:~/src/work/dversion> bzr commit
Segmentation fault

A bzr check gives the following output

flyvemaskine:~/src/work/dversion> bzr check
checked branch file:///home/cbr/src/work/dversion/ format Bazaar Branch Format 6 (bzr 0.15)
checked repository <bzrlib.transport.local.LocalTransport url=file:///home/cbr/src/work/> format <RepositoryFormatKnitPack1>
    31 revisions
  2636 file-ids
  2347 unique file texts
 39349 repeated file texts
     0 unreferenced text versions
bzr: ERROR: exceptions.SystemError: Negative size passed to PyString_FromStringAndSize

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 834, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 790, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 492, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 2427, in run
    if len(list(repo_basis.iter_changes(tree_basis))):
  File "/usr/lib/python2.5/site-packages/bzrlib/tree.py", line 777, in iter_changes
    from_entries_by_dir = list(self.source.inventory.iter_entries_by_dir(
  File "/usr/lib/python2.5/site-packages/bzrlib/workingtree_4.py", line 1614, in _get_inventory
    self._generate_inventory()
  File "/usr/lib/python2.5/site-packages/bzrlib/workingtree_4.py", line 1473, in _generate_inventory
    self._dirstate._read_dirblocks_if_needed()
  File "/usr/lib/python2.5/site-packages/bzrlib/dirstate.py", line 1960, in _read_dirblocks_if_needed
    _read_dirblocks(self)
  File "_dirstate_helpers_c.pyx", line 694, in _dirstate_helpers_c._read_dirblocks_c
  File "_dirstate_helpers_c.pyx", line 661, in _dirstate_helpers_c.Reader._parse_dirblocks
  File "_dirstate_helpers_c.pyx", line 626, in _dirstate_helpers_c.Reader._get_entry
SystemError: Negative size passed to PyString_FromStringAndSize

bzr 1.3.1 on python 2.5.2.final.0 (linux2)
arguments: ['/usr/bin/bzr', 'check']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'da_DK.UTF-8'
plugins:
  gtk /usr/lib/python2.5/site-packages/bzrlib/plugins/gtk [0.93.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.

I have checkout the repository again and I have manually added the changed to the new checkout. I was able to make a commit the first time after I have added the changes, but the second time I tried to commit bzr breaks on seg-fault again.

Changed in bzr:
assignee: vila → nobody
status: Fix Released → New
Revision history for this message
Vincent Ladeuil (vila) wrote :

cbr, please fill a new bug with your specific case, your comment above has nothing to do with this bug.

Hence, your report will we totally ignored if you don't fill a new bug.

Also, don't change the assignee if 1) it's not you, 2) you don't intend to take over the previous assignee to fix the bug yourself.

Changed in bzr:
assignee: nobody → vila
Revision history for this message
Vincent Ladeuil (vila) wrote :

I just see you filled bug #226036, great. Please do the same with the issue you reported above.

Vincent Ladeuil (vila)
Changed in bzr:
status: New → Confirmed
Revision history for this message
Vincent Ladeuil (vila) wrote :

This was merged in bzr.dev revno 2965.

Changed in bzr:
status: Confirmed → 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.