Ubuntu

whoopsie process is leaking memory

Reported by Roman Yepishev on 2012-05-12
42
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Whoopsie Daisy
Fix Released
Medium
glib2.0 (Ubuntu)
High
Evan Dandrea
Precise
High
Unassigned
Quantal
High
Evan Dandrea

Bug Description

Impact: stable update from the upstream serie including a fix for a leak affecting the default Ubuntu bug reporting tool (whoopsie)

Development Fix: the fix is in upstream glib git and will be in q with the next update

Stable Fix: the fix is a one liner, the new version has some extra changes

Test Case: watch the whoopsie memory usage over time, it should be stable

Regression Potential: it's glib, the update should be carefully tested

I have a 12.04 server running for 7 days and today I noticed some things started to be swapped out.
top shows:
  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
 1975 whoopsie 20 0 2649m 1.4g 484 S 0 18.5 14:05.67 whoopsie
with 1.4g residential memory.

There were 2 crashed applications, facter with .crash file is 2.8Mb and landscape-sysinfo of 17K so it does not look like it is related.
I will keep the process running in case i can provide more information and will monitor the process to see whether it is leaking memory.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: whoopsie 0.1.32
ProcVersionSignature: Ubuntu 3.2.0-24.37-generic 3.2.14
Uname: Linux 3.2.0-24-generic x86_64
ApportVersion: 2.0.1-0ubuntu7
Architecture: amd64
CrashReports:
 640:0:111:17379:2012-05-05 10:59:39.677061820 +0300:2012-05-05 10:59:39.673061820 +0300:/var/crash/_usr_bin_landscape-sysinfo.0.crash
 640:0:111:2838166:2012-05-07 00:54:24.435092602 +0300:2012-05-07 00:54:19.759092709 +0300:/var/crash/_usr_bin_facter.0.crash
Date: Sat May 12 21:41:18 2012
InstallationMedia: Ubuntu-Server 12.04 LTS "Precise Pangolin" - Release amd64 (20120424.1)
SourcePackage: whoopsie-daisy
UpgradeStatus: No upgrade log present (probably fresh install)

Roman Yepishev (rye) wrote :
Roman Yepishev (rye) wrote :

The process keeps growing, now at 1.5gb, attaching the strace for 5 seconds.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in whoopsie-daisy (Ubuntu):
status: New → Confirmed
Roman Yepishev (rye) wrote :

==12580== LEAK SUMMARY:
==12580== definitely lost: 10,060,860 bytes in 9,559 blocks
==12580== indirectly lost: 240 bytes in 10 blocks
==12580== possibly lost: 104,174,131 bytes in 151,412 blocks
==12580== still reachable: 416,562 bytes in 1,273 blocks
==12580== suppressed: 0 bytes in 0 blocks

During last 14 hours the process gained 100 Mb. Attaching valgrind output (installed debug symbols for glib and rebuilt whoopsie to get unstripped version).

Roman Yepishev (rye) on 2012-05-17
summary: - whoopsie-daisy process sits idling and eats 1.4Gb of RAM
+ whoopsie process is leaking memory
Roman Yepishev (rye) wrote :

Attaching /var/crash per ev's request

Evan Dandrea (ev) on 2012-05-17
Changed in whoopsie-daisy (Ubuntu):
assignee: nobody → Evan Dandrea (ev)
importance: Undecided → High
milestone: none → quantal-alpha-1
Evan Dandrea (ev) on 2012-05-18
Changed in whoopsie-daisy (Ubuntu):
status: Confirmed → Invalid
Changed in glib2.0 (Ubuntu):
assignee: nobody → Evan Dandrea (ev)
importance: Undecided → High
milestone: none → quantal-alpha-1
status: New → Confirmed
Changed in whoopsie-daisy (Ubuntu Precise):
status: New → Invalid
status: Invalid → Confirmed
Changed in whoopsie-daisy (Ubuntu Quantal):
status: Invalid → Confirmed
Changed in glib2.0 (Ubuntu Precise):
status: New → Confirmed
Sebastien Bacher (seb128) wrote :

The main leak there seems to be:

==12580== 10,059,776 bytes in 9,557 blocks are definitely lost in loss record 1,071 of 1,074
==12580== at 0x4C2B7B2: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12580== by 0x541DAF6: g_realloc (gmem.c:224)
==12580== by 0x53ECC67: g_ptr_array_maybe_expand (garray.c:1093)
==12580== by 0x53EDC22: g_ptr_array_add (garray.c:1350)
==12580== by 0x4EC77C7: read_netlink_messages (gnetworkmonitornetlink.c:237)
==12580== by 0x4E9F7F5: socket_source_dispatch (gsocket.c:3168)
==12580== by 0x5417C99: g_main_context_dispatch (gmain.c:2515)
==12580== by 0x541805F: g_main_context_iterate.isra.23 (gmain.c:3123)
==12580== by 0x5418459: g_main_loop_run (gmain.c:3317)
==12580== by 0x402EA8: main (whoopsie.c:934)

Sebastien Bacher (seb128) wrote :

The bug has been fixed upstream:
http://git.gnome.org/browse/glib/commit/?id=17e95c59c9f7b1cd023aabb3645c70b9f1f37577

Setting "fix commited" for quantal since that's going to be included in the next version, we will also include the fix in the glib SRU that should be uploaded next week to precise (update to the current stable version)

Changed in glib2.0 (Ubuntu Quantal):
status: Confirmed → Fix Committed
Changed in whoopsie-daisy:
importance: Unknown → Medium
status: Unknown → Fix Released
Evan Dandrea (ev) wrote :

Indeed. And apologies, I hadn't seen your reply to this bug and went ahead and uploaded it to -proposed.

Chris Halse Rogers (raof) wrote :

I've rejected the current glib2.0 in the queue so that the full upstream stable SRU can go through more easily.

Changed in glib2.0 (Ubuntu Precise):
status: Confirmed → Fix Committed
importance: Undecided → High
Changed in whoopsie-daisy (Ubuntu Precise):
importance: Undecided → High
description: updated
description: updated
description: updated
Clint Byrum (clint-fewbar) wrote :

This is a huge diff, not just "a few minor changes" IMO. Its sort of shocking that glib adds so much in a a few "patch" releases. I know some of these things are for non-Linux platforms, but its really quite hard to separate them out.

If this is just a one line fix, why aren't we just cherry picking the one line fix for this bug? Thats typically how we control regression potential. I'm digging through the diff (34,000 lines!) but at this point I can't really justify the time to review it all.

Can somebody update the test case to include a comprehensive test plan so we can get enough test coverage, or re-upload with just the fix for this bug?

Sebastien Bacher (seb128) wrote :

Clint:

you can see the details of the commits on http://git.gnome.org/browse/glib/log/?h=glib-2-32

summary of the .news:

* GApplication: can now have a NULL application ID

* g_clear_object: fix warnings when using it on C++ (due to lack of
  ability to implicitly cast void*)

* GDBus:
 - add our own implementation of the message bus for use on Windows only
 - fix up a few bugs that use of this bus uncovered in GDBus
 - escape nonce files in dbus addressess (think 'c:\')
 - support initial underscores in dbus codegen namespace (for private)

* Fix misdetection of GNUstep as Cocoa (for the MacOS GSettings backend)

* make sure configure fails if AC_CHECK_ALIGNOF cannot detect the alignment

* GAppInfo: overwrite the DISPLAY only if it is set in the launch context

* glib/tests/date: force US locale running the GDateTime tests

* GSocketControlMessage: Don't warn about unknown messages

* Resources:
 - fix broken use of GVDB on big endian machines
 - set a 'display name' so that pretty file names appear in Gtk CSS
   warning messages

* GMainContext:
 - block child sources when blocking the parent
 - introduce more testcases for child sources

* Bug fixed:
 619026 avoid warning in gutils.h when using gcc with -Wconversion
 669260 Open/Save dialog hangs waiting for data with libsoup
 671249 GApplication: Allow a null application_id?
 672786 goa-daemon: action in notification doesn't work
 673409 g_resource_lookup_data may return stale data pointer
 674172 glib-2.32.1 misdetects GNUstep as Cocoa
 674345 cssprovider: Make sure to print out file name in css warnings
 674483 broken configure results when cross-compiling with gcc >= 4.5

* Bug fixes:
 Correct a typo in the ELF configure check
 Reset LIBS after the ELF configure check
 Fix GIO/GObject Visual C++ projects
 gio: fix error handling in async case of GProxy...
 GConverterInputStream: fix an infinite loop...

* Translation updates

------

The new version is shipped in Debian testing and fedora, a big part of the diff is the dbus server added for win32 (it's not used on linux)

Testing ... there is nothing specific to test out of the fact that the desktop keeps running normally

Sebastien Bacher (seb128) wrote :

Clint, on the diff when filtering out "noise":

$ debdiff --exclude *win32* --exclude tests* --exclude Makefile.in --exclude po --exclude docs --exclude ChangeLog --exclude configure --exclude *generated* glib2.0_2.32.1-0ubuntu2.dsc glib2.0_2.32.3-0ubuntu1.dsc | diffstat
...
 INSTALL | 4
 NEWS | 75
 README | 2
 configure.ac | 16
 debian/changelog | 12
 debian/control | 2
 debian/control.in | 2
 debian/patches/git_powerpc_gresources.patch | 28
 debian/patches/gnetworkmonitor_dont_leak_networks.patch | 21
 debian/patches/series | 2
 gio/Makefile.am | 25
 gio/dbus-daemon.xml | 76
 gio/gapplication.c | 57
 gio/gapplicationimpl-dbus.c | 6
 gio/gconverterinputstream.c | 12
 gio/gdbus-2.0/codegen/config.py | 2
 gio/gdbus-2.0/codegen/utils.py | 7
 gio/gdbusaddress.c | 306 ++
 gio/gdbusdaemon.c | 1752 ++++++++++++++++
 gio/gdbusdaemon.h | 19
 gio/gdbusprivate.c | 42
 gio/gdbusserver.c | 5
 gio/gdesktopappinfo.c | 3
 gio/gio.rc | 8
 gio/gioenums.h | 9
 gio/giomodule-priv.h | 4
 gio/giomodule.c | 6
 gio/gproxyaddressenumerator.c | 95
 gio/gresource.c | 5
 gio/gresourcefile.c | 1
 gio/gsocketcontrolmessage.c | 11
 glib/glib.rc | 8
 glib/gmain.c | 35
 glib/gutils.h | 2
 gmodule/gmodule.rc | 8
 gobject/gobject.h | 4
 gobject/gobject.rc | 8
 gthread/gthread.rc | 8
 38 files changed, 2543 insertions(+), 145 deletions(-)

so the diff is around 2690 lines, 1771 of those being the gdbusdaemon for win32 use, it means the remaining diff is around 900 lines of actual changes, it's not trivial but far from the 34k you listed

Download full text (4.3 KiB)

Excerpts from Sebastien Bacher's message of 2012-05-31 08:54:24 UTC:
> Clint, on the diff when filtering out "noise":
>
> $ debdiff --exclude *win32* --exclude tests* --exclude Makefile.in --exclude po --exclude docs --exclude ChangeLog --exclude configure --exclude *generated* glib2.0_2.32.1-0ubuntu2.dsc glib2.0_2.32.3-0ubuntu1.dsc | diffstat
> ...
> INSTALL | 4
> NEWS | 75
> README | 2
> configure.ac | 16
> debian/changelog | 12
> debian/control | 2
> debian/control.in | 2
> debian/patches/git_powerpc_gresources.patch | 28
> debian/patches/gnetworkmonitor_dont_leak_networks.patch | 21
> debian/patches/series | 2
> gio/Makefile.am | 25
> gio/dbus-daemon.xml | 76
> gio/gapplication.c | 57
> gio/gapplicationimpl-dbus.c | 6
> gio/gconverterinputstream.c | 12
> gio/gdbus-2.0/codegen/config.py | 2
> gio/gdbus-2.0/codegen/utils.py | 7
> gio/gdbusaddress.c | 306 ++
> gio/gdbusdaemon.c | 1752 ++++++++++++++++
> gio/gdbusdaemon.h | 19
> gio/gdbusprivate.c | 42
> gio/gdbusserver.c | 5
> gio/gdesktopappinfo.c | 3
> gio/gio.rc | 8
> gio/gioenums.h | 9
> gio/giomodule-priv.h | 4
> gio/giomodule.c | 6
> gio/gproxyaddressenumerator.c | 95
> gio/gresource.c | 5
> gio/gresourcefile.c | 1
> gio/gsocketcontrolmessage.c | 11
> glib/glib.rc | 8
> glib/gmain.c | 35
> glib/gutils.h | 2
> gmodule/gmodule.rc | 8
> gobject/gobject.h | 4
> gobject/gobject.rc | 8
> gthread/gthread.rc | 8
> 38 files changed, 2543 insertions(+), 145 deletions(-)
>
> so the diff is around 2690 lines, 1771 of those being the gdbusdaemon
> for win32 use, it means the remaining diff is around 900 lines of actual
> changes, it's not trivial but far from the 34k you listed
>

Agreed. Tha...

Read more...

Steve Langasek (vorlon) on 2012-05-31
Changed in glib2.0 (Ubuntu Precise):
milestone: none → ubuntu-12.04.1
Sebastien Bacher (seb128) wrote :

summary of the changes

small bug fixes, including (which we would probably backport):
* "GSocketControlMessage: Don't warn about unknown messages"
http://git.gnome.org/browse/glib/commit/?h=glib-2-32&id=9b1a9ed4ce326d4ebfca68b2a98ddb4d8110e5e7

* "gmain: block child sources when blocking the parent"
http://git.gnome.org/browse/glib/commit/?h=glib-2-32&id=b1d447bd664bcbc607811c7920b67856d4f551e6
* "resourcefile: Set display name"
http://git.gnome.org/browse/glib/commit/?h=glib-2-32&id=ad35c6cae1ad065bc46968b1169c18e624dd8ada

* "Support initial underscores in dbus codegen namespace"
http://git.gnome.org/browse/glib/commit/?h=glib-2-32&id=5051aaca68eacf280ce48d1500a19cccf2125fc8

* "gdbus: Escape nonce files in dbus addressess"
http://git.gnome.org/browse/glib/commit/?h=glib-2-32&id=27352d96e28cf9e65bce12e2250a679261872aae

* "Fix g_clear_object macro with C++ compilers"
http://git.gnome.org/browse/glib/commit/?h=glib-2-32&id=d92736ab032bb650b1d115042e2a0ff965175940

* "GApplication: allow null application_id"
http://git.gnome.org/browse/glib/commit/?h=glib-2-32&id=7e9306e84e3cfc9b9e43991bd6d1978a77463349

* "gio: fix error handling in async case of GProxyAddressEnumerator"
http://git.gnome.org/browse/glib/commit/?h=glib-2-32&id=b62b5a3d8c67e3245e6d642207d07cafe3943fc2

* "GConverterInputStream: fix an infinite loop when fill_buffer returns an error"
http://git.gnome.org/browse/glib/commit/?h=glib-2-32&id=6799e4a73a93c4c6c2e3fbfbd44f05e5a5e26bcf

translations updates: 18
win32 specific fixes: 9
tests cases improvements: 3
change we already backported: 1
build system fixes (including other platforms): 8

Sebastien Bacher (seb128) wrote :

The previous summary is basically the diff between the versions (add the patch Evan backported), what strategy the SRU team suggest to get that update in?

Hello Roman, or anyone else affected,

Accepted glib2.0 into precise-proposed. The package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Changed in whoopsie-daisy (Ubuntu):
milestone: quantal-alpha-1 → quantal-alpha-2
Changed in glib2.0 (Ubuntu):
milestone: quantal-alpha-1 → quantal-alpha-2
Roman Yepishev (rye) wrote :

Left the same system running with the new glib package running overnight - whoopsie is at 3Mb RES after 11 hours (earlier it would go to 100Mb and beyond).

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package glib2.0 - 2.32.3-0ubuntu1

---------------
glib2.0 (2.32.3-0ubuntu1) precise-proposed; urgency=low

  * New upstream version
  * debian/patches/git_powerpc_gresources.patch:
    - dropped, the fix in the new version

  [ Evan Dandrea ]
  * gnetworkmonitor_dont_leak_networks.patch: Do not leak the list of
    networks in GNetworkMonitor. Thanks Dan Winship (LP: #998521)!
 -- Sebastien Bacher <email address hidden> Tue, 29 May 2012 17:53:18 +0200

Changed in glib2.0 (Ubuntu Precise):
status: Fix Committed → Fix Released
Changed in glib2.0 (Ubuntu Quantal):
milestone: quantal-alpha-2 → quantal-alpha-3
Changed in whoopsie-daisy (Ubuntu Quantal):
milestone: quantal-alpha-2 → quantal-alpha-3
Changed in whoopsie-daisy (Ubuntu Precise):
milestone: none → ubuntu-12.04.1
Sebastien Bacher (seb128) wrote :

the fix is in the current glib, and was not a whoopsie issue

Changed in glib2.0 (Ubuntu Quantal):
status: Fix Committed → Fix Released
Changed in whoopsie-daisy (Ubuntu Precise):
status: Confirmed → Invalid
Changed in whoopsie-daisy (Ubuntu Quantal):
status: Confirmed → Invalid
no longer affects: whoopsie-daisy (Ubuntu)
no longer affects: whoopsie-daisy (Ubuntu Precise)
no longer affects: whoopsie-daisy (Ubuntu Quantal)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.