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 736517 - Memory leaks in GI regress and marshalling tests
Memory leaks in GI regress and marshalling tests
Status: RESOLVED OBSOLETE
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks: 693111
 
 
Reported: 2014-09-12 00:19 UTC by Simon Feltman
Modified: 2018-02-08 12:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tests: Unref async result after adding to idle callback (972 bytes, patch)
2014-09-12 00:21 UTC, Simon Feltman
committed Details | Review
tests: Free input array in test_array_int_inout() (836 bytes, patch)
2014-09-12 00:21 UTC, Simon Feltman
committed Details | Review
tests: Usage a single allocation for test_ghash_gvalue_return (3.04 KB, patch)
2014-09-12 00:21 UTC, Simon Feltman
committed Details | Review
tests: Free input string in regress_test_utf8_inout() (837 bytes, patch)
2014-09-12 02:35 UTC, Simon Feltman
committed Details | Review

Description Simon Feltman 2014-09-12 00:19:17 UTC
A handful of leaks are showing up in pygi unittests when run through valgrind due to leaky tests in both gimarshallingtests.c and regress.c. Patches to follow.
Comment 1 Simon Feltman 2014-09-12 00:21:35 UTC
Created attachment 285970 [details] [review]
tests: Unref async result after adding to idle callback

g_simple_async_result_complete_in_idle() will add its own reference for
managing the async result. We need to unref the result after calling this
so we don't leak.
Comment 2 Simon Feltman 2014-09-12 00:21:38 UTC
Created attachment 285971 [details] [review]
tests: Free input array in test_array_int_inout()

Transfer is annotated as full so the function should free its input.
Comment 3 Simon Feltman 2014-09-12 00:21:42 UTC
Created attachment 285972 [details] [review]
tests: Usage a single allocation for test_ghash_gvalue_return

Use a single static allocation for the hash created in regress_test_ghash_gvalue_return().
This function is explicitly marked as returning the hash with transfer-none
and doesn't need to re-create the hash each call.
Comment 4 Emmanuele Bassi (:ebassi) 2014-09-12 00:50:49 UTC
Review of attachment 285970 [details] [review]:

okay.
Comment 5 Emmanuele Bassi (:ebassi) 2014-09-12 00:51:19 UTC
Review of attachment 285971 [details] [review]:

okay.
Comment 6 Emmanuele Bassi (:ebassi) 2014-09-12 00:58:27 UTC
Review of attachment 285972 [details] [review]:

::: tests/scanner/regress.c
@@ +1258,1 @@
+  if (hash == NULL) {

coding style: new line before the curly brace.
Comment 7 Simon Feltman 2014-09-12 02:35:38 UTC
Created attachment 285977 [details] [review]
tests: Free input string in regress_test_utf8_inout()

Transfer is annotated as full so the function should free its input
after testing and before output assignment.
Comment 8 Emmanuele Bassi (:ebassi) 2014-09-12 11:51:53 UTC
Review of attachment 285977 [details] [review]:

looks good.
Comment 9 André Klapper 2015-02-07 17:16:32 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
Comment 10 Colin Walters 2015-10-19 22:25:21 UTC
Fixed up the style issue, an pushed all 4 of these patches.  Thanks!
Comment 11 Cosimo Cecchi 2015-10-27 22:08:30 UTC
The "tests: Free input string in regress_test_utf8_inout()" patch breaks the "everythingBasic.js" test in GJS. Haven't yet looked whether this is a GJS bug or a gobject-introspection one though.
Comment 12 Cosimo Cecchi 2016-07-19 18:07:00 UTC
Still an issue
Comment 13 GNOME Infrastructure Team 2018-02-08 12:29:48 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gobject-introspection/issues/114.