bugrdiff-backup - Bugs: bug #27121, rdiff-backup crashes if a file...

 
 

bug #27121: rdiff-backup crashes if a file handle is unexpectedly closed

Submitted by:  Jérôme Poulin <ticpu>
Submitted on:  Mon 27 Jul 2009 07:28:37 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 27 Jul 2009 07:28:37 PM UTC, original submission:

I know it's not something common, but I was seeing a very big file being backed up and I didn't want to wait for the full transfer to finish, the backup was started a while ago so I didn't want to restart to include a new exclude, I entered python in gdb and closed the file handle, to my surprise, instead of just skipping the file, Python gave a nice backtrace (and finally I added an exclude.)
I guess a try/except should be added for IOErrors around those lines even if it's not something common so rdiff-backup can handle such case.

Processing changed file root/some/very/big/file
Exception '[Errno 9] Bad file descriptor' raised of class '<type 'exceptions.IOError'>':
File "/usr/lib/python2.5/site-packages/rdiff_backup/robust.py", line 32, in check_common_error
try: return function(*args)
File "/usr/lib/python2.5/site-packages/rdiff_backup/rpath.py", line 1415, in read
def read(self, length = -1): return self.file.read(length)
File "/usr/lib/python2.5/site-packages/rdiff_backup/hash.py", line 47, in read
buf = self.fileobj.read(length)

Sending back exception [Errno 9] Bad file descriptor of type <type 'exceptions.IOError'>:
File "/usr/lib/python2.5/site-packages/rdiff_backup/connection.py", line 335, in answer_request
result = apply(eval(request.function_string), argument_list)
File "/usr/lib/python2.5/site-packages/rdiff_backup/connection.py", line 485, in readfromid
if length is None: return cls.vfiles[id].read()
File "/usr/lib/python2.5/site-packages/rdiff_backup/iterfile.py", line 302, in read
if not self.addtobuffer(): break
File "/usr/lib/python2.5/site-packages/rdiff_backup/iterfile.py", line 318, in addtobuffer
self.addfromfile("c")
File "/usr/lib/python2.5/site-packages/rdiff_backup/iterfile.py", line 224, in addfromfile
[Globals.blocksize])
File "/usr/lib/python2.5/site-packages/rdiff_backup/robust.py", line 32, in check_common_error
try: return function(*args)
File "/usr/lib/python2.5/site-packages/rdiff_backup/rpath.py", line 1415, in read
def read(self, length = -1): return self.file.read(length)
File "/usr/lib/python2.5/site-packages/rdiff_backup/hash.py", line 47, in read
buf = self.fileobj.read(length)

Exception '[Errno 9] Bad file descriptor' raised of class '<type 'exceptions.IOError'>':
File "/usr/lib/python2.5/site-packages/rdiff_backup/robust.py", line 32, in check_common_error
try: return function(*args)
File "/usr/lib/python2.5/site-packages/rdiff_backup/rpath.py", line 105, in copy
if rpin.isreg(): return copy_reg_file(rpin, rpout, compress)
File "/usr/lib/python2.5/site-packages/rdiff_backup/rpath.py", line 133, in copy_reg_file
return rpout.write_from_fileobj(rpin.open("rb"), compress = compress)
File "/usr/lib/python2.5/site-packages/rdiff_backup/rpath.py", line 1195, in write_from_fileobj
copyfileobj(fp, outfp)
File "/usr/lib/python2.5/site-packages/rdiff_backup/rpath.py", line 62, in copyfileobj
inbuf = inputfp.read(blocksize)
File "/usr/lib/python2.5/site-packages/rdiff_backup/rpath.py", line 1415, in read
def read(self, length = -1): return self.file.read(length)
File "/usr/lib/python2.5/site-packages/rdiff_backup/iterfile.py", line 118, in read
if not self.addtobuffer(): break
File "/usr/lib/python2.5/site-packages/rdiff_backup/iterfile.py", line 133, in addtobuffer
type, data = self.iwf._get()
File "/usr/lib/python2.5/site-packages/rdiff_backup/iterfile.py", line 414, in _get
if not self.buf: self.buf += self.file.read()
File "/usr/lib/python2.5/site-packages/rdiff_backup/connection.py", line 518, in read
return self.connection.VirtualFile.readfromid(self.id, length)
File "/usr/lib/python2.5/site-packages/rdiff_backup/connection.py", line 450, in _call_
return apply(self.connection.reval, (self.name,) + args)
File "/usr/lib/python2.5/site-packages/rdiff_backup/connection.py", line 370, in reval
if isinstance(result, Exception): raise result

Sending back exception [Errno 9] Bad file descriptor of type <type 'exceptions.IOError'>:
File "/usr/lib/python2.5/site-packages/rdiff_backup/connection.py", line 335, in answer_request
result = apply(eval(request.function_string), argument_list)
File "/usr/lib/python2.5/site-packages/rdiff_backup/backup.py", line 243, in patch_and_increment
ITR(diff.index, diff)
File "/usr/lib/python2.5/site-packages/rdiff_backup/rorpiter.py", line 281, in _call_
last_branch.fast_process(*args)
File "/usr/lib/python2.5/site-packages/rdiff_backup/backup.py", line 692, in fast_process
if self.patch_to_temp(mirror_rp, diff_rorp, tf):
File "/usr/lib/python2.5/site-packages/rdiff_backup/backup.py", line 553, in patch_to_temp
result = self.patch_snapshot_to_temp(diff_rorp, new)
File "/usr/lib/python2.5/site-packages/rdiff_backup/backup.py", line 582, in patch_snapshot_to_temp
(diff_rorp, new))
File "/usr/lib/python2.5/site-packages/rdiff_backup/robust.py", line 32, in check_common_error
try: return function(*args)
File "/usr/lib/python2.5/site-packages/rdiff_backup/rpath.py", line 105, in copy
if rpin.isreg(): return copy_reg_file(rpin, rpout, compress)
File "/usr/lib/python2.5/site-packages/rdiff_backup/rpath.py", line 133, in copy_reg_file
return rpout.write_from_fileobj(rpin.open("rb"), compress = compress)
File "/usr/lib/python2.5/site-packages/rdiff_backup/rpath.py", line 1195, in write_from_fileobj
copyfileobj(fp, outfp)
File "/usr/lib/python2.5/site-packages/rdiff_backup/rpath.py", line 62, in copyfileobj
inbuf = inputfp.read(blocksize)
File "/usr/lib/python2.5/site-packages/rdiff_backup/rpath.py", line 1415, in read
def read(self, length = -1): return self.file.read(length)
File "/usr/lib/python2.5/site-packages/rdiff_backup/iterfile.py", line 118, in read
if not self.addtobuffer(): break
File "/usr/lib/python2.5/site-packages/rdiff_backup/iterfile.py", line 133, in addtobuffer
type, data = self.iwf._get()
File "/usr/lib/python2.5/site-packages/rdiff_backup/iterfile.py", line 414, in _get
if not self.buf: self.buf += self.file.read()
File "/usr/lib/python2.5/site-packages/rdiff_backup/connection.py", line 518, in read
return self.connection.VirtualFile.readfromid(self.id, length)
File "/usr/lib/python2.5/site-packages/rdiff_backup/connection.py", line 450, in _call_
return apply(self.connection.reval, (self.name,) + args)
File "/usr/lib/python2.5/site-packages/rdiff_backup/connection.py", line 370, in reval
if isinstance(result, Exception): raise result

Exception '[Errno 9] Bad file descriptor' raised of class '<type 'exceptions.IOError'>':
File "/usr/lib/python2.5/site-packages/rdiff_backup/Main.py", line 304, in error_check_Main
try: Main(arglist)
File "/usr/lib/python2.5/site-packages/rdiff_backup/Main.py", line 324, in Main
take_action(rps)
File "/usr/lib/python2.5/site-packages/rdiff_backup/Main.py", line 280, in take_action
elif action == "backup": Backup(rps[0], rps[1])
File "/usr/lib/python2.5/site-packages/rdiff_backup/Main.py", line 343, in Backup
backup.Mirror_and_increment(rpin, rpout, incdir)
File "/usr/lib/python2.5/site-packages/rdiff_backup/backup.py", line 51, in Mirror_and_increment
DestS.patch_and_increment(dest_rpath, source_diffiter, inc_rpath)
File "/usr/lib/python2.5/site-packages/rdiff_backup/connection.py", line 450, in _call_
return apply(self.connection.reval, (self.name,) + args)
File "/usr/lib/python2.5/site-packages/rdiff_backup/connection.py", line 370, in reval
if isinstance(result, Exception): raise result

Traceback (most recent call last):
File "/usr/bin/rdiff-backup", line 30, in <module>
rdiff_backup.Main.error_check_Main(sys.argv[1:])
File "/usr/lib/python2.5/site-packages/rdiff_backup/Main.py", line 304, in error_check_Main
try: Main(arglist)
File "/usr/lib/python2.5/site-packages/rdiff_backup/Main.py", line 324, in Main
take_action(rps)
File "/usr/lib/python2.5/site-packages/rdiff_backup/Main.py", line 280, in take_action
elif action == "backup": Backup(rps[0], rps[1])
File "/usr/lib/python2.5/site-packages/rdiff_backup/Main.py", line 343, in Backup
backup.Mirror_and_increment(rpin, rpout, incdir)
File "/usr/lib/python2.5/site-packages/rdiff_backup/backup.py", line 51, in Mirror_and_increment
DestS.patch_and_increment(dest_rpath, source_diffiter, inc_rpath)
File "/usr/lib/python2.5/site-packages/rdiff_backup/connection.py", line 450, in _call_
return apply(self.connection.reval, (self.name,) + args)
File "/usr/lib/python2.5/site-packages/rdiff_backup/connection.py", line 370, in reval
if isinstance(result, Exception): raise result
IOError: [Errno 9] Bad file descriptor
Fatal Error: Lost connection to the remote system

Jérôme Poulin <ticpu>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by ticpu (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup1