apport-retrace crashed with OSError in _execute_child(): [Errno 12] Cannot allocate memory

Bug #981155 reported by Matt Rae
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Apport
Fix Released
Medium
Unassigned
apport (Ubuntu)
Fix Released
Medium
Martin Pitt

Bug Description

$ apport-retrace -g -R -S system _usr_sbin_apt-cacher-ng.116.crash
Traceback (most recent call last):
  File "/usr/bin/apport-retrace", line 296, in <module>
    report.add_package_info()
  File "/usr/lib/python2.7/dist-packages/apport/report.py", line 197, in add_package_info
    package = apport.fileutils.find_file_package(self['ExecutablePath'])
  File "/usr/lib/python2.7/dist-packages/apport/fileutils.py", line 81, in find_file_package
    return packaging.get_file_package(file)
  File "/usr/lib/python2.7/dist-packages/apport/packaging_impl.py", line 232, in get_file_package
    stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1133, in _execute_child
    self.pid = os.fork()
OSError: [Errno 12] Cannot allocate memory

ProblemType: Crash
DistroRelease: Ubuntu 11.10
Package: apport-retrace 1.23-0ubuntu4
ProcVersionSignature: Ubuntu 3.0.0-17.30-generic 3.0.22
Uname: Linux 3.0.0-17-generic x86_64
ApportLog:
 ERROR: apport (pid 8660) Fri Apr 13 11:17:55 2012: called for pid 8659, signal 6
 ERROR: apport (pid 8660) Fri Apr 13 11:17:55 2012: executable: /home/mrae/a.out (command line "./a.out")
 ERROR: apport (pid 8660) Fri Apr 13 11:17:55 2012: executable does not belong to a package, ignoring
ApportVersion: 1.23-0ubuntu4
Architecture: amd64
CrashReports: 600:1000:1000:13114:2012-04-13 13:47:48.508729000 -0700:2012-04-13 13:47:52.488691690 -0700:/var/crash/_usr_bin_apport-retrace.1000.crash
Date: Fri Apr 13 13:47:49 2012
ExecutablePath: /usr/bin/apport-retrace
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
InterpreterPath: /usr/bin/python2.7
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/bin/apport-retrace -g -R -S system _usr_sbin_apt-cacher-ng.116.crash
PythonArgs: ['/usr/bin/apport-retrace', '-g', '-R', '-S', 'system', '_usr_sbin_apt-cacher-ng.116.crash']
SourcePackage: apport
Title: apport-retrace crashed with OSError in _execute_child(): [Errno 12] Cannot allocate memory
UpgradeStatus: Upgraded to oneiric on 2012-01-23 (81 days ago)
UserGroups: adm admin cdrom dialout libvirtd lpadmin plugdev sambashare

Revision history for this message
Matt Rae (mattrae) wrote :
tags: removed: need-duplicate-check
Changed in apport (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Martin Pitt (pitti) wrote :

Indeed it seems that apport-retrace has a rather huge memory leak somewhere, I'll investigate this. Thanks for your report!

visibility: private → public
Changed in apport (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
status: New → Triaged
Revision history for this message
Martin Pitt (pitti) wrote :

Fixed in trunk r2451.

Changed in apport (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 2.5.1-0ubuntu1

---------------
apport (2.5.1-0ubuntu1) quantal; urgency=low

  * New upstream release:
    - test_recoverable_problem.py: Fix test for calling test runner with
      absolute path.
    - packaging-apt-dpkg.py: Fix crash on writing virtual_mapping.db when
      running with --sandbox-dir and -S system or giving no --cache.
    - REThread.py: Fix re-raising of exceptions in Python 3. Thanks Martin
      Packman! (LP: #1024836)
    - apport-retrace: Keep compressed CoreDump from .crash files instead of
      uncompressing them into memory. This dramatically reduces memory usage.
      (LP: #981155)
    - Add an apport.memdbg() function which prints out current memory usage if
      APPORT_MEMDEBUG is set. Annotate apport-retrace with it.
    - hookutils.py: Allow specifying a list of profile names when using
      attach_mac_events(). Thanks Marc Deslauriers.
    - hookutils.py, attach_root_command_outputs() and root_command_output():
      Drop usage of sudo, kdesudo, and gksu, and replace with pkexec. For
      attach_root_command_outputs(), use a wrapper and proper .policy file
      which explains the action and works under every environment; thus
      attach_root_command_outputs() is preferred over root_command_output()
      now, as it provides a better user experience.
    - Package hooks which want to send the report to a different crash
      database than "default" can now also give the database specification
      itself in the "CrashDB" field, not just the DB name. With this, packages
      do not need to ship a separate /etc/apport/crashdb.conf.d/ file. Please
      see doc/package-hooks.txt for details. (LP: #551330)
    - report.py, add_hooks_info(): If reporting against a package/program in
      /opt, also search for package hooks in the corresponding /opt directory.
      This allows such hooks to define a custom crash database and thus report
      bugs against their own project instead of against the distribution.
      (LP: #1020503)
  * debian/rules: Call dh_install with --list-missing, and ignore .pyc and
    .egg-info files.
  * debian/apport.install: Install new polkit .policy and root_info_wrapper
    files, and add policykit-1 Recommends.
  * debian/apport.install: Ship is-enabled script.
  * debian/apport-kde.install: Ship userpass.ui file.
  * Drop debian/apport-retrace.manpages and debian/apport.manpages and install
    the man pages from *.install instead. This works better with
    --list-missing.
  * debian/apport.install: Install 000record-status pm-utils script, to
    unbreak suspend failure detection.
 -- Martin Pitt <email address hidden> Wed, 22 Aug 2012 11:58:45 +0200

Changed in apport (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

This bug is back in trunk as of revision 2537. "apport-retrace" gobbles up over a gigabyte of memory again for most bugs, even those with 4Mb core dumps. It's been like that for some time (sorry for the late report).

Evan (ev)
Changed in apport:
importance: Undecided → Medium
Revision history for this message
Martin Pitt (pitti) wrote :

I cannot reproduce this. I ran apport with -S system and no cache directories (so it had to download everything). For xeyes (tiny report) I get

VmPeak: 169884 kB
VmSize: 168680 kB
VmLck: 0 kB
VmPin: 0 kB
VmHWM: 103936 kB
VmRSS: 102880 kB
VmData: 78200 kB
VmPeak: 166392 kB

and for gedit (large report, over 5 MB compressed core dump) I get

VmSize: 148744 kB
VmLck: 0 kB
VmPin: 0 kB
VmHWM: 104744 kB
VmRSS: 87296 kB
VmData: 82324 kB
VmStk: 136 kB
VmExe: 2176 kB
VmLib: 8152 kB
VmPTE: 300 kB
VmSwap: 0 kB

given the overhead of Python etc. a magnitude of 100 MB data is very reasonable. Also, the original problem here has been fixed and the fix is still in place. Can you please file a new bug report with an example crash that causes memory usage to explode? Thanks!

Changed in apport:
status: New → Fix Released
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

Thanks! I've reported my complains as bug 1086106, see you there :)

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.