[Errno 12] Cannot allocate memory

Bug #780270 reported by Chris Whelan
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Apport
Invalid
Undecided
Unassigned
Duplicity
Invalid
Medium
Unassigned
Déjà Dup
Invalid
Undecided
Unassigned
Ubuntu
Invalid
Undecided
Unassigned

Bug Description

I have a couple months of backups made by BackInTime and wanted to see how much space Deja Dup's compression would save me on a single backup. Deja Dup is crashing on making a copy of this backup due to the length of the path name.

Traceback (most recent call last):
  File "/usr/bin/duplicity", line 1262, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 1255, in with_tempdir
    fn()
  File "/usr/bin/duplicity", line 1228, in main
    full_backup(col_stats)
  File "/usr/bin/duplicity", line 408, in full_backup
    bytes_written = dummy_backup(tarblock_iter)
  File "/usr/bin/duplicity", line 161, in dummy_backup
    while tarblock_iter.next():
  File "/usr/lib/python2.7/dist-packages/duplicity/diffdir.py", line 505, in next
    result = self.process(self.input_iter.next(), size)
  File "/usr/lib/python2.7/dist-packages/duplicity/diffdir.py", line 187, in get_delta_iter
    for new_path, sig_path in collated:
  File "/usr/lib/python2.7/dist-packages/duplicity/diffdir.py", line 279, in collate2iters
    for relem1 in riter1:
  File "/usr/lib/python2.7/dist-packages/duplicity/selection.py", line 174, in Iterate
    subpath, val = diryield_stack[-1].next()
  File "/usr/lib/python2.7/dist-packages/duplicity/selection.py", line 143, in diryield
    error_handler, Path.append, (path, filename))
  File "/usr/lib/python2.7/dist-packages/duplicity/robust.py", line 37, in check_common_error
    return function(*args)
  File "/usr/lib/python2.7/dist-packages/duplicity/path.py", line 507, in append
    return self.__class__(self.base, self.index + (ext,))
  File "/usr/lib/python2.7/dist-packages/duplicity/path.py", line 487, in __init__
    self.setdata()
  File "/usr/lib/python2.7/dist-packages/duplicity/path.py", line 492, in setdata
    self.stat = os.lstat(self.name)
OSError: [Errno 12] Cannot allocate memory: '/mnt/backups/backintime/glados/chris/1/20110509-000003-101/backup/home/chris/Courses/Quantum Conductance/Fractional quantization of the ballistic conductance in electron and hole systems - Magnusson.pdf'

I am using Ubuntu 11.04 with the following packages:
deja-dup 18.1.1-0ubuntu1
duplicity 0.6.13-0ubuntu1

Revision history for this message
Michael Terry (mterry) wrote :

Ken, this looks interesting.

If it was really choking on the length of the filename, I would expect errno 36, ENAMETOOLONG. But errno 12 is ENOMEM, which means the kernel ran out of memory... Seems a pretty lowlevel error.

Do you get this repeatably?

Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote : Re: [Bug 780270] Re: Deja Dup crashes on long path names
Download full text (3.2 KiB)

Actually, its not even that long of a filename. It is running out of
memory. That's a new one. It ran out when allocating a buffer for
os.lstat(), which is typically not that big.

On Mon, May 9, 2011 at 11:04 PM, Michael Terry
<email address hidden>wrote:

> Ken, this looks interesting.
>
> If it was really choking on the length of the filename, I would expect
> errno 36, ENAMETOOLONG. But errno 12 is ENOMEM, which means the kernel
> ran out of memory... Seems a pretty lowlevel error.
>
> Do you get this repeatably?
>
> ** Also affects: duplicity
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are subscribed to
> Duplicity.
> https://bugs.launchpad.net/bugs/780270
>
> Title:
> Deja Dup crashes on long path names
>
> Status in Déjà Dup Backup Tool:
> New
> Status in Duplicity - Bandwidth Efficient Encrypted Backup:
> New
>
> Bug description:
> I have a couple months of backups made by BackInTime and wanted to see
> how much space Deja Dup's compression would save me on a single
> backup. Deja Dup is crashing on making a copy of this backup due to
> the length of the path name.
>
> Traceback (most recent call last):
> File "/usr/bin/duplicity", line 1262, in <module>
> with_tempdir(main)
> File "/usr/bin/duplicity", line 1255, in with_tempdir
> fn()
> File "/usr/bin/duplicity", line 1228, in main
> full_backup(col_stats)
> File "/usr/bin/duplicity", line 408, in full_backup
> bytes_written = dummy_backup(tarblock_iter)
> File "/usr/bin/duplicity", line 161, in dummy_backup
> while tarblock_iter.next():
> File "/usr/lib/python2.7/dist-packages/duplicity/diffdir.py", line 505,
> in next
> result = self.process(self.input_iter.next(), size)
> File "/usr/lib/python2.7/dist-packages/duplicity/diffdir.py", line 187,
> in get_delta_iter
> for new_path, sig_path in collated:
> File "/usr/lib/python2.7/dist-packages/duplicity/diffdir.py", line 279,
> in collate2iters
> for relem1 in riter1:
> File "/usr/lib/python2.7/dist-packages/duplicity/selection.py", line
> 174, in Iterate
> subpath, val = diryield_stack[-1].next()
> File "/usr/lib/python2.7/dist-packages/duplicity/selection.py", line
> 143, in diryield
> error_handler, Path.append, (path, filename))
> File "/usr/lib/python2.7/dist-packages/duplicity/robust.py", line 37, in
> check_common_error
> return function(*args)
> File "/usr/lib/python2.7/dist-packages/duplicity/path.py", line 507, in
> append
> return self.__class__(self.base, self.index + (ext,))
> File "/usr/lib/python2.7/dist-packages/duplicity/path.py", line 487, in
> __init__
> self.setdata()
> File "/usr/lib/python2.7/dist-packages/duplicity/path.py", line 492, in
> setdata
> self.stat = os.lstat(self.name)
> OSError: [Errno 12] Cannot allocate memory:
> '/mnt/backups/backintime/glados/chris/1/20110509-000003-101/backup/home/chris/Courses/Quantum
> Conductance/Fractional quantization of the ballistic conductance in electron
> and hole systems - Magnusson.pdf'
>
> I am using Ubuntu 11.04 with the following packages:
> deja-dup 18.1.1-0ubuntu1
...

Read more...

Michael Terry (mterry)
summary: - Deja Dup crashes on long path names
+ [Errno 12] Cannot allocate memory
Changed in deja-dup:
status: New → Incomplete
Changed in duplicity:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Duplicity because there has been no activity for 60 days.]

Changed in duplicity:
status: Incomplete → Expired
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Déjà Dup because there has been no activity for 60 days.]

Changed in deja-dup:
status: Incomplete → Expired
Revision history for this message
Terry (terry-kryogenic) wrote :

I get hit by this bug as soon as my backup reaches about 15GB. The duplicity process is using approx 30MB memory at the time according to top.

-v9 gives no more information about the error than the details above. I'm doing an strace now.

Changed in duplicity:
status: Expired → Confirmed
Revision history for this message
Terry (terry-kryogenic) wrote :

After having been forced to upgrade strace due to strace crashing several times, here we are.

Duplicity ended with the following:

Traceback (most recent call last):
  File "/usr/bin/duplicity", line 1351, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 1334, in with_tempdir
    fn()
  File "/usr/bin/duplicity", line 1309, in main
    full_backup(col_stats)
  File "/usr/bin/duplicity", line 473, in full_backup
    globals.backend)
  File "/usr/bin/duplicity", line 351, in write_multivol
    globals.gpg_profile, globals.volsize)
  File "/usr/lib/python2.5/site-packages/duplicity/gpg.py", line 320, in GPGWriteFile
    data = block_iter.next(min(block_size, bytes_to_go)).data
  File "/usr/lib/python2.5/site-packages/duplicity/diffdir.py", line 507, in next
    result = self.process(self.input_iter.next(), size)
  File "/usr/lib/python2.5/site-packages/duplicity/diffdir.py", line 188, in get_delta_iter
    for new_path, sig_path in collated:
  File "/usr/lib/python2.5/site-packages/duplicity/diffdir.py", line 281, in collate2iters
    for relem1 in riter1:
  File "/usr/lib/python2.5/site-packages/duplicity/selection.py", line 175, in Iterate
    subpath, val = diryield_stack[-1].next()
  File "/usr/lib/python2.5/site-packages/duplicity/selection.py", line 142, in diryield
    for filename in robust.listpath(path):
  File "/usr/lib/python2.5/site-packages/duplicity/robust.py", line 61, in listpath
    dir_listing = check_common_error(error_handler, path.listdir)
  File "/usr/lib/python2.5/site-packages/duplicity/robust.py", line 37, in check_common_error
    return function(*args)
  File "/usr/lib/python2.5/site-packages/duplicity/path.py", line 524, in listdir
    return os.listdir(self.name)
OSError: [Errno 12] Cannot allocate memory: '/home/customers/mail/foo/foo@foo/new'

Attached is the last 1000 lines of the strace.

Revision history for this message
Terry (terry-kryogenic) wrote :

I'm currently running duplicity on Ubuntu 11.10 (Python 2.7.2) and the memory usage is far far less than on Debian Lenny, 0.8MB infact and still holding.

I'm thinking perhaps this is an issue in Python-2.5.2 instead? I've seen bug reports relating to make test failing with memory leak errors on 64bit. I'm no expert on Python, though. I'm going to try to install Python-2.7 along side 2.5 on the Lenny machine and see what I get from that.

I would be interested in knowing if anyone could confirm if this is a Python issue or not. Seems that way to me anyway.

Revision history for this message
Terry (terry-kryogenic) wrote :

Interestingly, running against Python 2.7 on the same system resulted in memory usage of over 40MB but never exited prematurely with ENOMEM like it does with Python 2.5. The system became pretty unstable though. I guess the problem is more of a low level thing and definitely specific to older distributions like Debian Lenny. Shame, I really like duplicity but will have to wait until we upgrade our servers next year.

I'm happy to assist further with this issue, just let me know.

Revision history for this message
bongo (bong0) wrote :

I have a similar error, though the error backtrace doesn't look exactly the same as in the original report:

Traceback (most recent call last):
  File "/usr/bin/duplicity", line 1347, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 1330, in with_tempdir
    fn()
  File "/usr/bin/duplicity", line 1300, in main
    full_backup(col_stats)
  File "/usr/bin/duplicity", line 469, in full_backup
    globals.backend)
  File "/usr/bin/duplicity", line 347, in write_multivol
    globals.gpg_profile, globals.volsize)
  File "/usr/lib/python2.7/site-packages/duplicity/gpg.py", line 313, in GPGWriteFile
    file = GPGFile(True, path.Path(filename), profile)
  File "/usr/lib/python2.7/site-packages/duplicity/gpg.py", line 143, in __init__
    'logger': self.logger_fp})
  File "/usr/lib/python2.7/site-packages/duplicity/GnuPGInterface.py", line 365, in run
    create_fhs, attach_fhs)
  File "/usr/lib/python2.7/site-packages/duplicity/GnuPGInterface.py", line 407, in _attach_fork_exec
    process.pid = os.fork()
OSError: [Errno 12] Cannot allocate memory

Revision history for this message
Arun Raghavan (arunraghavan) wrote :

I hit this reliably on every (full) backup. I'm using Python 2.7 so the earlier comment about Python versions does not hold here.

deja-dup -- 18.1.1
duplicity -- 0.6.17

Revision history for this message
Benjamin (nailartcenter) wrote :

uccured under Ubuntu 12.04 while Apport Window opens and the swap gone over 1,2GB. RAM was already full. My RAM is 1,5GB.

After some time comes this issue:

An error occurred while attempting to process this problem report:

[Errno 12] Cannot allocate memory

before crashed Unity and apport was going send a report... Bugreport don't sent out..

tags: added: oneiric precise
Changed in ubuntu:
status: New → Invalid
Changed in deja-dup:
status: Expired → Confirmed
Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

I have tried to reproduce this on the 0.6.19 version and cannot. I think we fixed it with the introduction of an up-to-date tarfile.py or with any number of changes since this bug was reported. Could someone else verify that this is fixed.

Changed in duplicity:
status: Confirmed → Incomplete
Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

Judging from where this is reported above, it may have been caused by a packaging error. Duplicity requires it's own GnuPGInterface.py, not the released version.

Revision history for this message
Evan (ev) wrote :

This is not a bug in apport.

Changed in apport:
status: New → Invalid
Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

Closing this bug since it appears to be a packaging error, not a bug in duplicity.

Changed in duplicity:
importance: Undecided → Medium
status: Incomplete → Invalid
Revision history for this message
Vej (vej) wrote :

Closing for deja-dup cause this seems to be fixed in the meantime.

Changed in deja-dup:
status: Confirmed → Invalid
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.