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 729732 - Various memory leak fixes
Various memory leak fixes
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2014-05-07 16:29 UTC by Giovanni Campagna
Modified: 2014-05-07 17:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
MetaIdleMonitorDBus: unref the objects after exporting them (943 bytes, patch)
2014-05-07 16:29 UTC, Giovanni Campagna
committed Details | Review
MetaDisplay: free the wayland windows table at close (810 bytes, patch)
2014-05-07 16:29 UTC, Giovanni Campagna
committed Details | Review
default: free the option context after parsing (723 bytes, patch)
2014-05-07 16:29 UTC, Giovanni Campagna
committed Details | Review
MetaStackTracker: make sure all stack ops are freed eventually (2.02 KB, patch)
2014-05-07 16:29 UTC, Giovanni Campagna
committed Details | Review
xprops: free the text list content too (1.04 KB, patch)
2014-05-07 16:29 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2014-05-07 16:29:10 UTC
Found running the default plugin under valgrind.

Some are real fixes (particularly the stack stuff), some are bugs but
not big ones (the dbus stuff becomes big only if one keeps changing
VT), some are just there to please valgrind (like the wayland table)
Comment 1 Giovanni Campagna 2014-05-07 16:29:14 UTC
Created attachment 276085 [details] [review]
MetaIdleMonitorDBus: unref the objects after exporting them

The object manager already has a reference.
Comment 2 Giovanni Campagna 2014-05-07 16:29:26 UTC
Created attachment 276086 [details] [review]
MetaDisplay: free the wayland windows table at close

Like we do for the XID table.
Comment 3 Giovanni Campagna 2014-05-07 16:29:31 UTC
Created attachment 276087 [details] [review]
default: free the option context after parsing

We don't need it, we should free it.
Comment 4 Giovanni Campagna 2014-05-07 16:29:37 UTC
Created attachment 276088 [details] [review]
MetaStackTracker: make sure all stack ops are freed eventually

If we apply a prediction immediately instead of queueing, we should
also free the operation immediately.
If we discard the prediction queue because we resync fully, we
need to free each operation too.
Comment 5 Giovanni Campagna 2014-05-07 16:29:42 UTC
Created attachment 276089 [details] [review]
xprops: free the text list content too

A text list is an array of pointers into a buffer. Freeing the
array is not enough, we need to free the buffer too.
Comment 6 Jasper St. Pierre (not reading bugmail) 2014-05-07 16:54:52 UTC
Review of attachment 276089 [details] [review]:

::: src/x11/xprops.c
@@ +758,3 @@
+
+     this is unfortunately an implementation detail of libX11,
+     and there is no public function to free the list

I assume you missed XFreeStringList?
Comment 7 Jasper St. Pierre (not reading bugmail) 2014-05-07 16:57:50 UTC
Review of attachment 276088 [details] [review]:

OK.
Comment 8 Jasper St. Pierre (not reading bugmail) 2014-05-07 16:58:07 UTC
Review of attachment 276087 [details] [review]:

OK.
Comment 9 Jasper St. Pierre (not reading bugmail) 2014-05-07 16:58:29 UTC
Review of attachment 276086 [details] [review]:

OK. (We should be able to ditch this table eventually)
Comment 10 Jasper St. Pierre (not reading bugmail) 2014-05-07 16:58:44 UTC
Review of attachment 276085 [details] [review]:

OK.
Comment 11 Giovanni Campagna 2014-05-07 17:01:29 UTC
(In reply to comment #6)
> Review of attachment 276089 [details] [review]:
> 
> ::: src/x11/xprops.c
> @@ +758,3 @@
> +
> +     this is unfortunately an implementation detail of libX11,
> +     and there is no public function to free the list
> 
> I assume you missed XFreeStringList?

Oh, yeah, I only saw XwcFreeStringList.
Awesome to know that.
Comment 12 Giovanni Campagna 2014-05-07 17:05:18 UTC
Pushed with the suggested change, to master and, where relevant,
to gnome-3-12.

Attachment 276085 [details] pushed as aed6718 - MetaIdleMonitorDBus: unref the objects after exporting them
Attachment 276086 [details] pushed as 1427d20 - MetaDisplay: free the wayland windows table at close
Attachment 276087 [details] pushed as ab632e3 - default: free the option context after parsing
Attachment 276088 [details] pushed as 098c890 - MetaStackTracker: make sure all stack ops are freed eventually
Attachment 276089 [details] pushed as ea354e9 - xprops: free the text list content too