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 735018 - Memory leaks with set_property when using introspection marshalling path
Memory leaks with set_property when using introspection marshalling path
Status: RESOLVED OBSOLETE
Product: pygobject
Classification: Bindings
Component: introspection
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks: 693111
 
 
Reported: 2014-08-18 21:38 UTC by Simon Feltman
Modified: 2018-01-10 20:44 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Simon Feltman 2014-08-18 21:38:32 UTC
These are most likely caused by the marshalling path not cleaning up by pairing _pygi_argument_release() with the call to _pygi_argument_from_object(). We should probably also not use transfer annotations when marshalling for set_property() it can be assumed to always be transfer-none.

https://git.gnome.org/browse/pygobject/tree/gi/pygi-property.c?id=3.13.4#n274

% make check.valgrind TEST_NAMES=test_properties

==16458== 58 (24 direct, 34 indirect) bytes in 1 blocks are definitely lost in loss record 1,226 of 5,141
==16458==    at 0x4C2745D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==16458==    by 0xF9EADE6: g_malloc (gmem.c:97)
==16458==    by 0xFA03A22: g_slice_alloc (gslice.c:1007)
==16458==    by 0xF9DEAF2: g_list_prepend (glist.c:308)
==16458==    by 0xEB043E5: _pygi_argument_from_object (pygi-argument.c:1134)
==16458==    by 0xEB09020: pygi_set_property_value (pygi-property.c:233)
==16458==    by 0xEAE8FC6: PyGProps_setattro (pygobject.c:373)
==16458==    by 0x4ED31BE: PyObject_SetAttr (in /usr/lib64/libpython3.3m.so.1.0)
==16458==    by 0x4F3BBB8: PyEval_EvalFrameEx (in /usr/lib64/libpython3.3m.so.1.0)
==16458==    by 0x4F40869: PyEval_EvalFrameEx (in /usr/lib64/libpython3.3m.so.1.0)
==16458==    by 0x4F42174: PyEval_EvalCodeEx (in /usr/lib64/libpython3.3m.so.1.0)
==16458==    by 0x4F40573: PyEval_EvalFrameEx (in /usr/lib64/libpython3.3m.so.1.0)
==16458== 
==16458== 58 (24 direct, 34 indirect) bytes in 1 blocks are definitely lost in loss record 1,227 of 5,141
==16458==    at 0x4C2745D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==16458==    by 0xF9EADE6: g_malloc (gmem.c:97)
==16458==    by 0xFA03A22: g_slice_alloc (gslice.c:1007)
==16458==    by 0xF9DEAF2: g_list_prepend (glist.c:308)
==16458==    by 0xEB043E5: _pygi_argument_from_object (pygi-argument.c:1134)
==16458==    by 0xEB09020: pygi_set_property_value (pygi-property.c:233)
==16458==    by 0xEAEAEA2: pygobject_set_property (pygobject.c:1370)
==16458==    by 0x4F40B06: PyEval_EvalFrameEx (in /usr/lib64/libpython3.3m.so.1.0)
==16458==    by 0x4F40869: PyEval_EvalFrameEx (in /usr/lib64/libpython3.3m.so.1.0)
==16458==    by 0x4F42174: PyEval_EvalCodeEx (in /usr/lib64/libpython3.3m.so.1.0)
==16458==    by 0x4F40573: PyEval_EvalFrameEx (in /usr/lib64/libpython3.3m.so.1.0)
==16458==    by 0x4F42174: PyEval_EvalCodeEx (in /usr/lib64/libpython3.3m.so.1.0)
==16458== 
==16458== 144 bytes in 2 blocks are definitely lost in loss record 3,542 of 5,141
==16458==    at 0x4C2745D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==16458==    by 0xF9EADE6: g_malloc (gmem.c:97)
==16458==    by 0xFA03A22: g_slice_alloc (gslice.c:1007)
==16458==    by 0xEF3D30D: _g_info_new_full (gibaseinfo.c:63)
==16458==    by 0xEF4551B: g_irepository_find_by_name (girepository.c:784)
==16458==    by 0xEF3D573: _g_info_from_entry (gibaseinfo.c:135)
==16458==    by 0xEF47CEA: g_type_info_get_interface (gitypeinfo.c:208)
==16458==    by 0xEB05D29: _pygi_argument_release (pygi-argument.c:1669)
==16458==    by 0xEB0978E: pygi_set_property_value (pygi-property.c:376)
==16458==    by 0xEAEAEA2: pygobject_set_property (pygobject.c:1370)
==16458==    by 0x4F40B06: PyEval_EvalFrameEx (in /usr/lib64/libpython3.3m.so.1.0)
==16458==    by 0x4F40869: PyEval_EvalFrameEx (in /usr/lib64/libpython3.3m.so.1.0)
==16458== 
==16458== 144 bytes in 2 blocks are definitely lost in loss record 3,543 of 5,141
==16458==    at 0x4C2745D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==16458==    by 0xF9EADE6: g_malloc (gmem.c:97)
==16458==    by 0xFA03A22: g_slice_alloc (gslice.c:1007)
==16458==    by 0xEF3D30D: _g_info_new_full (gibaseinfo.c:63)
==16458==    by 0xEF4551B: g_irepository_find_by_name (girepository.c:784)
==16458==    by 0xEF3D573: _g_info_from_entry (gibaseinfo.c:135)
==16458==    by 0xEF47CEA: g_type_info_get_interface (gitypeinfo.c:208)
==16458==    by 0xEB05D29: _pygi_argument_release (pygi-argument.c:1669)
==16458==    by 0xEB0978E: pygi_set_property_value (pygi-property.c:376)
==16458==    by 0xEAE8FC6: PyGProps_setattro (pygobject.c:373)
==16458==    by 0x4ED31BE: PyObject_SetAttr (in /usr/lib64/libpython3.3m.so.1.0)
==16458==    by 0x4F34CF9: ??? (in /usr/lib64/libpython3.3m.so.1.0)
==16458== 
==16458== 208 (72 direct, 136 indirect) bytes in 3 blocks are definitely lost in loss record 3,705 of 5,141
==16458==    at 0x4C2745D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==16458==    by 0xF9EADE6: g_malloc (gmem.c:97)
==16458==    by 0xFA03A22: g_slice_alloc (gslice.c:1007)
==16458==    by 0xF9DEAF2: g_list_prepend (glist.c:308)
==16458==    by 0xEB043E5: _pygi_argument_from_object (pygi-argument.c:1134)
==16458==    by 0xEB09020: pygi_set_property_value (pygi-property.c:233)
==16458==    by 0xEAEAEA2: pygobject_set_property (pygobject.c:1370)
==16458==    by 0x4F40B06: PyEval_EvalFrameEx (in /usr/lib64/libpython3.3m.so.1.0)
==16458==    by 0x4F40869: PyEval_EvalFrameEx (in /usr/lib64/libpython3.3m.so.1.0)
==16458==    by 0x4F40869: PyEval_EvalFrameEx (in /usr/lib64/libpython3.3m.so.1.0)
==16458==    by 0x4F42174: PyEval_EvalCodeEx (in /usr/lib64/libpython3.3m.so.1.0)
==16458==    by 0x4F40573: PyEval_EvalFrameEx (in /usr/lib64/libpython3.3m.so.1.0)
==16458== 
==16458== 208 (72 direct, 136 indirect) bytes in 3 blocks are definitely lost in loss record 3,706 of 5,141
==16458==    at 0x4C2745D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==16458==    by 0xF9EADE6: g_malloc (gmem.c:97)
==16458==    by 0xFA03A22: g_slice_alloc (gslice.c:1007)
==16458==    by 0xF9DEAF2: g_list_prepend (glist.c:308)
==16458==    by 0xEB043E5: _pygi_argument_from_object (pygi-argument.c:1134)
==16458==    by 0xEB09020: pygi_set_property_value (pygi-property.c:233)
==16458==    by 0xEAE8FC6: PyGProps_setattro (pygobject.c:373)
==16458==    by 0x4ED31BE: PyObject_SetAttr (in /usr/lib64/libpython3.3m.so.1.0)
==16458==    by 0x4F34CF9: ??? (in /usr/lib64/libpython3.3m.so.1.0)
==16458==    by 0x4F40B06: PyEval_EvalFrameEx (in /usr/lib64/libpython3.3m.so.1.0)
==16458==    by 0x4F40869: PyEval_EvalFrameEx (in /usr/lib64/libpython3.3m.so.1.0)
==16458==    by 0x4F40869: PyEval_EvalFrameEx (in /usr/lib64/libpython3.3m.so.1.0)
==16458== 
==16458== 252 (88 direct, 164 indirect) bytes in 1 blocks are definitely lost in loss record 3,953 of 5,141
==16458==    at 0x4C2745D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==16458==    by 0xF9EADE6: g_malloc (gmem.c:97)
==16458==    by 0xFA03A22: g_slice_alloc (gslice.c:1007)
==16458==    by 0xF9CEEEA: g_hash_table_new_full (ghash.c:656)
==16458==    by 0xF9CEEC6: g_hash_table_new (ghash.c:626)
==16458==    by 0xEB04770: _pygi_argument_from_object (pygi-argument.c:1212)
==16458==    by 0xEB09020: pygi_set_property_value (pygi-property.c:233)
==16458==    by 0xEAEAEA2: pygobject_set_property (pygobject.c:1370)
==16458==    by 0x4F40B06: PyEval_EvalFrameEx (in /usr/lib64/libpython3.3m.so.1.0)
==16458==    by 0x4F40869: PyEval_EvalFrameEx (in /usr/lib64/libpython3.3m.so.1.0)
==16458==    by 0x4F40869: PyEval_EvalFrameEx (in /usr/lib64/libpython3.3m.so.1.0)
==16458==    by 0x4F42174: PyEval_EvalCodeEx (in /usr/lib64/libpython3.3m.so.1.0)
==16458== 
==16458== 252 (88 direct, 164 indirect) bytes in 1 blocks are definitely lost in loss record 3,954 of 5,141
==16458==    at 0x4C2745D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==16458==    by 0xF9EADE6: g_malloc (gmem.c:97)
==16458==    by 0xFA03A22: g_slice_alloc (gslice.c:1007)
==16458==    by 0xF9CEEEA: g_hash_table_new_full (ghash.c:656)
==16458==    by 0xF9CEEC6: g_hash_table_new (ghash.c:626)
==16458==    by 0xEB04770: _pygi_argument_from_object (pygi-argument.c:1212)
==16458==    by 0xEB09020: pygi_set_property_value (pygi-property.c:233)
==16458==    by 0xEAE8FC6: PyGProps_setattro (pygobject.c:373)
==16458==    by 0x4ED31BE: PyObject_SetAttr (in /usr/lib64/libpython3.3m.so.1.0)
==16458==    by 0x4F34CF9: ??? (in /usr/lib64/libpython3.3m.so.1.0)
==16458==    by 0x4F40B06: PyEval_EvalFrameEx (in /usr/lib64/libpython3.3m.so.1.0)
==16458==    by 0x4F40869: PyEval_EvalFrameEx (in /usr/lib64/libpython3.3m.so.1.0)
Comment 1 Simon Feltman 2015-01-03 00:10:13 UTC
Here's an additional leak when setting utf8 properties:

==2486== 12,000 bytes in 1,000 blocks are definitely lost in loss record 7,356 of 7,414
==2486==    at 0x4C2745D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==2486==    by 0xE33107E: g_malloc (gmem.c:97)
==2486==    by 0xE331395: g_malloc_n (gmem.c:332)
==2486==    by 0xE34C779: g_strdup (gstrfuncs.c:356)
==2486==    by 0xD4536DB: _pygi_marshal_from_py_utf8 (pygi-basictype.c:235)
==2486==    by 0xD453F85: _pygi_marshal_from_py_basic_type (pygi-basictype.c:495)
==2486==    by 0xD449622: _pygi_argument_from_object (pygi-argument.c:921)
==2486==    by 0xD44E8FC: pygi_set_property_value (pygi-property.c:233)
==2486==    by 0xD42EEBA: PyGProps_setattro (pygobject.c:373)
==2486==    by 0x4EB739E: PyObject_SetAttr (in /usr/lib64/libpython2.7.so.1.0)
==2486==    by 0x4F0FDA7: PyEval_EvalFrameEx (in /usr/lib64/libpython2.7.so.1.0)
==2486==    by 0x4F131DC: PyEval_EvalCodeEx (in /usr/lib64/libpython2.7.so.1.0)
==2486==    by 0x4F132E1: PyEval_EvalCode (in /usr/lib64/libpython2.7.so.1.0)
==2486==    by 0x4F2C71E: ??? (in /usr/lib64/libpython2.7.so.1.0)
==2486==    by 0x4F2D8DD: PyRun_FileExFlags (in /usr/lib64/libpython2.7.so.1.0)
==2486==    by 0x4F2EB68: PyRun_SimpleFileExFlags (in /usr/lib64/libpython2.7.so.1.0)
==2486==    by 0x4F3FB7E: Py_Main (in /usr/lib64/libpython2.7.so.1.0)
==2486==    by 0x5B43D64: (below main) (in /usr/lib64/libc-2.18.so)
Comment 2 GNOME Infrastructure Team 2018-01-10 20:44:54 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/pygobject/issues/79.