After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 750261 - Memory leak when WIFI WPA2 personal password dialog opens
Memory leak when WIFI WPA2 personal password dialog opens
Status: RESOLVED OBSOLETE
Product: NetworkManager
Classification: Platform
Component: nm-applet
0.9.x
Other Linux
: Normal major
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
: 698809 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-06-02 04:44 UTC by t.lehmann
Modified: 2020-11-12 14:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Massif snapshot (556.32 KB, text/plain)
2016-12-23 17:36 UTC, Beniamino Galvani
Details

Description t.lehmann 2015-06-02 04:44:53 UTC
nm-applet has a memory leak that appears when the password dialog for a stored SSID is being opened.

The memory consumption increases by about 8-10 MB every time the dialog is opened but is never released. When using nm-applet on a mobile computer the process' memory consumption may exceed 500 MB after serveral days (reconnecting to WIFI networks).

Reproduce:
1. Add a WPA2 personal connection and do not store the password and then try to connect to that network or try to directly connect to a non-hidden WPA2 network
2. Observe the memory before and after attempting to connect

When there's a WIFI network with stored credentials, the memory does not increase that much when connecting to such a network. So I think this must be related to that dialog or to the fact that the applet failed to ask the wallet for the credentials.

There's also a downstream bug at Fedora including "smap" outputs: https://bugzilla.redhat.com/show_bug.cgi?id=1128766

The Git commit the package was build with is 36c8684 basing on the 0.9.10.2 tag.

The leak also appears in Ubuntu's network-manager-applet 0.9.10.1 package.
Comment 1 Thomas Haller 2015-06-03 18:49:17 UTC
The leak is also easily reproducible on current master.

I could not find the reason, but it seems to me that src/libnma/nma-wifi-dialog.c is not the culprit and that the created NMAWifiDialog gets properly destroyed.
Comment 2 Beniamino Galvani 2015-10-29 14:51:48 UTC
The wifi dialog calls ws_dynamic_wep_new() and ws_wpa_eap_new()	which
build a new WirelessSecurity object and related widgets. These
functions call ws_802_1x_auth_combo_init() to instantiate EAP methods
and some of them take a circular reference to WirelessSecurity, which
prevents the destruction of the object. This seems to be the biggest
leak.

But those references were added in eeb2430b933e9 ("libnm-gtk: fix
use-after-free of 802.1x usernames/passwords") to fix a crash, so at
the moment it's not clear to me how to fix this.
Comment 3 Beniamino Galvani 2016-12-23 17:32:57 UTC
Branch bg/wireless-security-leaks-bgo750261 solves most of the leaks. The remaining ones seems to be caused by GtkFileChooser instances leaking resources when the GtkBuilder created by EAP methods is destroyed.
Comment 4 Beniamino Galvani 2016-12-23 17:36:29 UTC
Created attachment 342426 [details]
Massif snapshot

Snapshot of heap usage created with massif after the wifi dialog has been closed.
Comment 5 Thomas Haller 2016-12-25 20:48:02 UTC
(In reply to Beniamino Galvani from comment #3)
> Branch bg/wireless-security-leaks-bgo750261 solves most of the leaks. The
> remaining ones seems to be caused by GtkFileChooser instances leaking
> resources when the GtkBuilder created by EAP methods is destroyed.

lgtm
Comment 6 Beniamino Galvani 2017-01-03 14:55:29 UTC
Merged:

https://git.gnome.org/browse/network-manager-applet/commit/?id=2ab0d34497cabe35a350ee72c46266c8046fffea

Keeping the bug open for the remaining leak, which needs more investigation.
Comment 7 Beniamino Galvani 2017-07-22 08:28:23 UTC
*** Bug 698809 has been marked as a duplicate of this bug. ***
Comment 8 André Klapper 2020-11-12 14:31:15 UTC
bugzilla.gnome.org is being shut down in favor of a GitLab instance. 
We are closing all old bug reports and feature requests in GNOME Bugzilla which have not seen updates for a long time.

If you still use NetworkManager and if you still see this bug / want this feature in a recent and supported version of NetworkManager, then please feel free to report it at https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/

Thank you for creating this report and we are sorry it could not be implemented (workforce and time is unfortunately limited).