Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 234945 - [patch] net-misc/networkmanager-0.6.6 Memory Leak
Summary: [patch] net-misc/networkmanager-0.6.6 Memory Leak
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Steev Klimaszewski (RETIRED)
URL: http://bugs.debian.org/cgi-bin/bugrep...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-16 17:33 UTC by Bryan Jacobs
Modified: 2010-02-24 18:02 UTC (History)
8 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
fix-memleak.patch (fix-memleak.patch,589 bytes, patch)
2008-08-16 17:35 UTC, Bryan Jacobs
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bryan Jacobs 2008-08-16 17:33:16 UTC
On my system, NetworkManager leaks memory at an alarming rate.  After several days, it can have an RSS of over 1GB.  Searching for a solution, I found http://groups.google.se/group/linux.debian.bugs.rc/browse_thread/thread/3a019cdc5fe2b74e .  Applying this patch may help.

Reproducible: Always

Steps to Reproduce:
1. Start NetworkManager when you have a wireless device
2. Wait
3. Wait some more

Actual Results:  
NetworkManager's memory consumption steadily grows

Expected Results:  
Use a reasonable amount of memory
Comment 1 Bryan Jacobs 2008-08-16 17:35:31 UTC
Created attachment 163062 [details, diff]
fix-memleak.patch

Patch that adds a few needed g_free calls.
Comment 2 Matija "hook" Šuklje 2008-09-26 18:14:11 UTC
Is this patch a fix or just a ugly hack workaround?

If it doesn't hit portage soon, I'm going to apply it manually — restarting NetworkManager every few hours is quite annoying.
Comment 3 Matija "hook" Šuklje 2008-10-05 16:17:16 UTC
I applied it and it fixed the memory leak and also I haven't noticed any bugs from it.

Works for me on AMD64.

Here's my 'paludis --info networkmanager':

paludis 0.30.1
Paludis build information:
    Compiler:
        CXX:                   x86_64-pc-linux-gnu-g++ 4.1.2 20070214 (  (gdc 0.24, using dmd 1.020)) (Gentoo 4.1.2 p1.1)
        CXXFLAGS:              -march=athlon64 -msse3 -pipe -O2
        LDFLAGS:               -Wl,-O1
        DATE:                  2008-09-29T23:08:40+0200

    Libraries:
        C++ Library:           GNU libstdc++ 20070214

    Reduced Privs:
        reduced_uid:           115
        reduced_uid->name:     paludisbuild
        reduced_uid->dir:      /var/tmp/paludis
        reduced_gid:           250
        reduced_gid->name:     portage

    Paths:
        DATADIR:               /usr/share
        LIBDIR:                /usr/lib64
        LIBEXECDIR:            /usr/libexec
        SYSCONFDIR:            /etc
        PYTHONINSTALLDIR:      /usr/lib64/python2.5/site-packages
        RUBYINSTALLDIR:        /usr/lib64/ruby/site_ruby/1.8/x86_64-linux

Environment:
    Format:                    paludis
    Config dir:                /etc/paludis
    World file:                /var/db/pkg/world

Repository layman:
    format:                    unavailable
    location:                  /var/db/paludis/repositories/layman
    sync:                      tar+http://git.exherbo.org/layman_repositories.tar.bz2
    sync_options:

Repository installed-virtuals:
    format:                    installed_virtuals
    root:                      /

Repository virtuals:
    format:                    virtuals

Repository gentoo:
    format:                    ebuild
    location:                  /usr/portage
    append_repository_name_to_write_cache: true
    binary_destination:        false
    binary_keywords:
    binary_uri_prefix:
    builddir:                  /var/tmp/paludis
    cache:                     /usr/portage/metadata/cache
    distdir:                   /mnt/distfiles
    eapi_when_unknown:         0
    eapi_when_unspecified:     0
    eclassdirs:                /usr/portage/eclass
    ignore_deprecated_profiles: false
    layout:                    traditional
    names_cache:               /usr/portage/.cache/names
    newsdir:                   /usr/portage/metadata/news
    profile_eapi:              0
    profiles:                  /usr/portage/profiles/default/linux/amd64/2008.0
    securitydir:               /usr/portage/metadata/glsa
    setsdir:                   /usr/portage/sets
    sync:                      rsync://rsync.gentoo.org/gentoo-portage
    sync_options:
    use_manifest:              use
    write_cache:               /var/cache/paludis/metadata

    Package information:
        app-admin/eselect-compiler: (none)
        app-shells/bash:       3.2_p33
        dev-java/java-config:  1.3.7 2.1.6
        dev-lang/python:       2.5.2-r7
        dev-python/pycrypto:   2.0.1-r6
        dev-util/ccache:       (none)
        dev-util/confcache:    (none)
        sys-apps/baselayout:   1.12.11.1
        sys-apps/openrc:       (none)
        sys-apps/sandbox:      1.2.18.1-r2
        sys-devel/autoconf:    2.13 2.61-r2
        sys-devel/automake:    1.10.1-r1 1.4_p6 1.5 1.6.3 1.7.9-r1 1.8.5-r3 1.9.6-r2
        sys-devel/binutils:    2.18-r3
        sys-devel/gcc-config:  1.4.0-r4
        sys-devel/libtool:     1.5.26
        virtual/os-headers:    2.6.23-r3 (for sys-kernel/linux-headers::installed)

Repository installed:
    format:                    vdb
    location:                  /var/db/pkg
    builddir:                  /var/tmp/paludis
    names_cache:               /var/db/pkg/.cache/names
    provides_cache:            /var/db/pkg/.cache/provides
    root:                      /

Repository local:
    format:                    ebuild
    location:                  /usr/local/portage
    append_repository_name_to_write_cache: true
    binary_destination:        false
    binary_keywords:
    binary_uri_prefix:
    builddir:                  /var/tmp/paludis
    cache:                     /var/empty
    distdir:                   /mnt/distfiles
    eapi_when_unknown:         0
    eapi_when_unspecified:     0
    eclassdirs:                /usr/portage/eclass /usr/local/portage/eclass
    ignore_deprecated_profiles: false
    layout:                    traditional
    master_repository:         gentoo
    names_cache:               /usr/local/portage/.cache/names
    newsdir:                   /usr/local/portage/metadata/news
    profile_eapi:              0
    profiles:                  /usr/portage/profiles/default/linux/amd64/2008.0
    securitydir:               /usr/local/portage/metadata/glsa
    setsdir:                   /usr/local/portage/sets
    sync:
    sync_options:
    use_manifest:              use
    write_cache:               /var/cache/paludis/metadata

Package net-misc/networkmanager-0.6.6-r1::installed:

        >>> Running ebuild phase killoldmisc as paludisbuild:portage...
        bunzip2 < /var/db/pkg/net-misc/networkmanager-0.6.6-r1/environment.bz2 > /var/tmp/paludis/environment-net-misc-networkmanager-0.6.6-r1-13700
        ebuild_scrub_environment /var/tmp/paludis/environment-net-misc-networkmanager-0.6.6-r1-13700
        ebuild_safe_source /var/tmp/paludis/environment-net-misc-networkmanager-0.6.6-r1-13700
        rm /var/tmp/paludis/environment-net-misc-networkmanager-0.6.6-r1-13700
        >>> Starting builtin_killoldmisc
        >>> Done builtin_killoldmisc
        >>> Completed ebuild phase killoldmisc
        >>> Running ebuild phases initmisc infovars info as paludisbuild:portage...
        bunzip2 < /var/db/pkg/net-misc/networkmanager-0.6.6-r1/environment.bz2 > /var/tmp/paludis/environment-net-misc-networkmanager-0.6.6-r1-13754
        ebuild_scrub_environment /var/tmp/paludis/environment-net-misc-networkmanager-0.6.6-r1-13754
        ebuild_safe_source /var/tmp/paludis/environment-net-misc-networkmanager-0.6.6-r1-13754
        rm /var/tmp/paludis/environment-net-misc-networkmanager-0.6.6-r1-13754
        >>> Starting builtin_initmisc
        >>> Done builtin_initmisc
        >>> Starting builtin_infovars
        ACCEPT_KEYWORDS=amd64
        CBUILD=x86_64-pc-linux-gnu
        CFLAGS=-march=athlon64 -msse3 -pipe -O2
        CHOST=x86_64-pc-linux-gnu
        CONFIG_PROTECT=/usr/kde/3.5/share/config /usr/kde/3.5/env /usr/kde/3.5/shutdown /usr/share/config /etc
        CONFIG_PROTECT_MASK=/etc/env.d/java/ /etc/udev/rules.d /etc/fonts/fonts.conf /etc/gconf /etc/terminfo /etc/ca-certificates.conf /etc/texmf/web2c /etc/revdep-rebuild /etc/env.d /etc/gconf
        CPPFLAGS=
        CTARGET=
        CXXFLAGS=-march=athlon64 -msse3 -pipe -O2
        DISTDIR=/var/db/pkg/net-misc/networkmanager-0.6.6-r1
        FEATURES=strict sfperms
        FFLAGS=
        GENTOO_MIRRORS=
        INSTALL_MASK=
        LANG=
        LC_ALL=C
        LDFLAGS=-Wl,-O1
        LINGUAS=sl
        MAKEOPTS=-j1
        PORTAGE_COMPRESS=
        PORTAGE_COMPRESS_FLAGS=
        PORTAGE_RSYNC_EXTRA_OPTS=
        PORTAGE_RSYNC_OPTS=
        PORTAGE_TMPDIR=/var/tmp/paludis
        PORTDIR=/var/db/pkg/net-misc/networkmanager-0.6.6-r1
        PORTDIR_OVERLAY=
        SYNC=
        USE=crypt amd64 elibc_glibc linguas_sl alsa_pcm_plugins_adpcm alsa_pcm_plugins_alaw alsa_pcm_plugins_asym alsa_pcm_plugins_copy alsa_pcm_plugins_dmix alsa_pcm_plugins_dshare alsa_pcm_plugins_dsnoop alsa_pcm_plugins_empty alsa_pcm_plugins_extplug alsa_pcm_plugins_file alsa_pcm_plugins_hooks alsa_pcm_plugins_iec958 alsa_pcm_plugins_ioplug alsa_pcm_plugins_ladspa alsa_pcm_plugins_lfloat alsa_pcm_plugins_linear alsa_pcm_plugins_meter alsa_pcm_plugins_mmap_emul alsa_pcm_plugins_mulaw alsa_pcm_plugins_multi alsa_pcm_plugins_null alsa_pcm_plugins_plug alsa_pcm_plugins_rate alsa_pcm_plugins_route alsa_pcm_plugins_share alsa_pcm_plugins_shm alsa_pcm_plugins_softvol apache2_modules_actions apache2_modules_alias apache2_modules_auth_basic apache2_modules_authn_alias apache2_modules_authn_anon apache2_modules_authn_dbm apache2_modules_authn_default apache2_modules_authn_file apache2_modules_authz_dbm apache2_modules_authz_default apache2_modules_authz_groupfile apache2_modules_authz_host apache2_modules_authz_owner apache2_modules_authz_user apache2_modules_autoindex apache2_modules_cache apache2_modules_dav apache2_modules_dav_fs apache2_modules_dav_lock apache2_modules_deflate apache2_modules_dir apache2_modules_disk_cache apache2_modules_env apache2_modules_expires apache2_modules_ext_filter apache2_modules_file_cache apache2_modules_filter apache2_modules_headers apache2_modules_include apache2_modules_info apache2_modules_log_config apache2_modules_logio apache2_modules_mem_cache apache2_modules_mime apache2_modules_mime_magic apache2_modules_negotiation apache2_modules_rewrite apache2_modules_setenvif apache2_modules_speling apache2_modules_status apache2_modules_unique_id apache2_modules_userdir apache2_modules_usertrack apache2_modules_vhost_alias lcd_devices_bayrad lcd_devices_cfontz lcd_devices_cfontz633 lcd_devices_glk lcd_devices_hd44780 lcd_devices_lb216 lcd_devices_lcdm001 lcd_devices_mtxorb lcd_devices_ncurses lcd_devices_text video_cards_radeon input_devices_evdev input_devices_keyboard input_devices_synaptics alsa_cards_ali5451 alsa_cards_als4000 alsa_cards_atiixp alsa_cards_atiixp-modem alsa_cards_bt87x alsa_cards_ca0106 alsa_cards_cmipci alsa_cards_emu10k1x alsa_cards_ens1370 alsa_cards_ens1371 alsa_cards_es1938 alsa_cards_es1968 alsa_cards_fm801 alsa_cards_hda-intel alsa_cards_intel8x0 alsa_cards_intel8x0m alsa_cards_maestro3 alsa_cards_trident alsa_cards_usb-audio alsa_cards_via82xx alsa_cards_via82xx-modem alsa_cards_ymfpci userland_GNU kernel_linux
        >>> Done builtin_infovars
        >>> Starting pkg_info
        No additional information available
        >>> Done pkg_info
        >>> Completed ebuild phases initmisc infovars info
        >>> Running ebuild phase tidyupmisc as paludisbuild:portage...
        bunzip2 < /var/db/pkg/net-misc/networkmanager-0.6.6-r1/environment.bz2 > /var/tmp/paludis/environment-net-misc-networkmanager-0.6.6-r1-13830
        ebuild_scrub_environment /var/tmp/paludis/environment-net-misc-networkmanager-0.6.6-r1-13830
        ebuild_safe_source /var/tmp/paludis/environment-net-misc-networkmanager-0.6.6-r1-13830
        rm /var/tmp/paludis/environment-net-misc-networkmanager-0.6.6-r1-13830
        >>> Starting builtin_tidyupmisc
        rm -fr /var/tmp/paludis/net-misc-networkmanager-0.6.6-r1-misc
        >>> Done builtin_tidyupmisc
        >>> Completed ebuild phase tidyupmisc
Comment 4 Rémy DUPONT 2008-12-23 22:45:01 UTC
Seem to do his job great !
Comment 5 Matija "hook" Šuklje 2008-12-24 05:55:55 UTC
I've been using that patch for over two months now and it seems to work perfectly.
Comment 6 Pacho Ramos gentoo-dev 2010-02-22 19:18:25 UTC
Is this patch still needed with current stable networkmanager-0.7.2 ? (was it ever send to upstream?)
Comment 7 Rémy DUPONT 2010-02-23 22:24:44 UTC
no more needed with networkmanager-0.7.2, seems this bug can be closed 
Comment 8 Pacho Ramos gentoo-dev 2010-02-24 18:02:05 UTC
Thanks for feedback