OverflowError in _dirstate_helpers pack_stat

Bug #706957 reported by tomer poliner
60
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Martin Packman
2.4
Fix Released
Medium
Martin Packman

Bug Description

after adding the first folder
winxp

Related branches

Revision history for this message
Craig Hewetson (craighewetson-deactivatedaccount) wrote :

Thanks for logging the bug but more info is needed:
Was there an error message? If there is attach it to this bug. or was the UI disabled?
What version of qbzr do you have installed? (output of: bzr plugins)

Revision history for this message
tomer poliner (tomerp) wrote :
Download full text (3.6 KiB)

sorry for not giving enough details... here are some more details:

qbzr version is 0.19.2 - (i downloaded bazaar 2.2 today,,,)

error message:

bzr: ERROR: exceptions.OverflowError: can't convert negative value to unsigned long

Traceback (most recent call last):
  File "C:/Program Files/Bazaar/plugins\explorer\lib\explorer.py", line 1450, in callable_with_cleanup
  File "C:/Program Files/Bazaar/plugins\explorer\lib\explorer.py", line 1618, in _open_location_task
  File "C:/Program Files/Bazaar/plugins\explorer\lib\location_viewer.py", line 161, in add_location
  File "C:/Program Files/Bazaar/plugins\explorer\lib\location.py", line 178, in view
  File "C:/Program Files/Bazaar/plugins\explorer\lib\view_workingtree.py", line 72, in ui
  File "C:/Program Files/Bazaar/plugins\explorer\lib\html_report_view.py", line 51, in ui
  File "C:/Program Files/Bazaar/plugins\explorer\lib\html_report_view.py", line 55, in refresh_view
  File "C:/Program Files/Bazaar/plugins\explorer\lib\view_workingtree.py", line 97, in report_text
  File "C:/Program Files/Bazaar/plugins\explorer\lib\status_report.py", line 195, in __init__
  File "C:/Program Files/Bazaar/plugins\explorer\lib\status_report.py", line 212, in _collect_data
  File "C:/Program Files/Bazaar/plugins\explorer\lib\status_data.py", line 43, in get_status_info
  File "C:/Program Files/Bazaar/plugins\explorer\lib\status_data.py", line 61, in changes_between_trees
  File "bzrlib\tree.pyo", line 94, in changes_from
  File "bzrlib\decorators.pyo", line 140, in read_locked
  File "bzrlib\tree.pyo", line 1002, in compare
  File "bzrlib\delta.pyo", line 126, in _compare_trees
  File "_dirstate_helpers_pyx.pyx", line 1410, in bzrlib._dirstate_helpers_pyx.ProcessEntryC.__next__ (bzrlib\_dirstate_helpers_pyx.c:11953)
  File "_dirstate_helpers_pyx.pyx", line 1683, in bzrlib._dirstate_helpers_pyx.ProcessEntryC._iter_next (bzrlib\_dirstate_helpers_pyx.c:14740)
  File "_dirstate_helpers_pyx.pyx", line 1782, in bzrlib._dirstate_helpers_pyx.ProcessEntryC._loop_one_block (bzrlib\_dirstate_helpers_pyx.c:15630)
  File "_dirstate_helpers_pyx.pyx", line 1107, in bzrlib._dirstate_helpers_pyx.ProcessEntryC._process_entry (bzrlib\_dirstate_helpers_pyx.c:8056)
  File "_dirstate_helpers_pyx.pyx", line 843, in bzrlib._dirstate_helpers_pyx._update_entry (bzrlib\_dirstate_helpers_pyx.c:5746)
  File "_dirstate_helpers_pyx.pyx", line 797, in bzrlib._dirstate_helpers_pyx._pack_stat (bzrlib\_dirstate_helpers_pyx.c:5444)
OverflowError: can't convert negative value to unsigned long

bzr 2.2.2 on python 2.6.4 (win32)
arguments: ['C:\\Program Files\\Bazaar\\bzrw.exe', 'explorer']
encoding: 'cp1255', fsenc: 'mbcs', lang: None
plugins:
  bzrtools C:\Program Files\Bazaar\plugins\bzrtools [2.2.0]
  colo C:\Program Files\Bazaar\plugins\colo [0.1.0]
  explorer C:\Program Files\Bazaar\plugins\explorer [1.1.1]
  fastimport C:\Program Files\Bazaar\plugins\fastimport [0.9.0dev]
  launchpad C:\Program Files\Bazaar\plugins\launchpad [2.2.2]
  loom C:\Program Files\Bazaar\plugins\loom [2.2.1dev]
  netrc_credential_store C:\Program Files\Bazaar\plugins\netrc_credential_stor...

Read more...

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

If anything, this is probably a core bzr bug.

I think line "_dirstate_helpers_pyx.pyx", line 797 in the 2.2 branch is where it's packing the ctime field. It's certainly possible that could be negative. We should probably do a kind of reinterpret cast into an unsigned int.

tomer, can you confirm whether there's a file with a far-distant timestamp in this tree?

affects: qbzr → bzr
summary: - cant commit
+ OverflowError in _dirstate_helpers pack_stat
tags: added: dirstate easy pyrex
Changed in bzr:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
tomer poliner (tomerp) wrote :

i checked the folder through windows explorer and the oldest file is from 2006.
another thing that might be important - some of the files named are in Hebrew.

Revision history for this message
Siggi Bjarnason (siggi-bjarnason) wrote :

I ran into this error when there were files in my existing directory that somehow had no modified time stamp. I copied them into new files and deleted the original and the error went away.

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 706957] Re: OverflowError in _dirstate_helpers pack_stat

On 8 February 2011 16:51, Siggi Bjarnason <email address hidden> wrote:
> I ran into this error when there were files in my existing directory
> that somehow had no modified time stamp. I copied them into new files
> and deleted the original and the error went away.

Thanks for identifying that! I did not realize you could have files
with no modification time.

I would guess that Windows is returning -1 and that causes the
problem. Perhaps the cleanest thing is to fold it to 0, so that if we
ever compare the values it will sort as very old. (I don't think we do
at present.)

Revision history for this message
Siggi Bjarnason (siggi-bjarnason) wrote :

I don't think it is normal to have a file have no time stamp, I don't think I've every seen this before and I have no idea how these became this way. I have copies of them in a backup directory I tried to zip them up and WinZip crashed. I've attached one of the files, not sure if this anomaly is preserved. I can keep them around in case you need me to test a fix. I think testing for this condition and replacing the date with any random date you consider valid is a great solution.
Sort of a
if (! isvalidDate(modifiedTime))
{
   ModifiedTime = "1/1/1999";
}

Revision history for this message
Siggi Bjarnason (siggi-bjarnason) wrote :

Also just discovered that while the file has no modified time for some strange reason, it does have valid created and accessed time stamps, you could just grab one of those. Attached is a screenshot of the properties dialog box for this file for me.

Revision history for this message
Nabeel (nabeel-sulieman) wrote :

I managed to overcome this issue by "touching" all the files that were giving me this problem.

Too bad touch doesn't have a recursive mode :-P

Martin Packman (gz)
Changed in bzr:
assignee: nobody → Martin Packman (gz)
status: Confirmed → In Progress
Martin Pool (mbp)
Changed in bzr:
milestone: none → 2.5b2
Martin Packman (gz)
Changed in bzr:
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.