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 736502 - Leak when marshaling caller-allocated GValues from Python implemented vfuncs
Leak when marshaling caller-allocated GValues from Python implemented vfuncs
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-09-11 20:03 UTC by Simon Feltman
Modified: 2018-01-10 20:46 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Simon Feltman 2014-09-11 20:03:49 UTC
make check.valgrind TEST_NAMES=test_gi.TestPythonGObject.test_vfunc_return_ref_count

==12923== 24 bytes in 1 blocks are definitely lost in loss record 376 of 5,117
==12923==    at 0x4C2745D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==12923==    by 0x132C8DE6: g_malloc (gmem.c:97)
==12923==    by 0x132E1A22: g_slice_alloc (gslice.c:1007)
==12923==    by 0x132E1A62: g_slice_alloc0 (gslice.c:1032)
==12923==    by 0x123F64BC: pygi_arg_gvalue_from_py_marshal (pygi-struct-marshal.c:119)
==12923==    by 0x123F67BF: pygi_arg_struct_from_py_marshal (pygi-struct-marshal.c:241)
==12923==    by 0x123F6BAF: arg_struct_from_py_marshal_adapter (pygi-struct-marshal.c:329)
==12923==    by 0x123E7B6A: _pygi_closure_set_out_arguments (pygi-closure.c:508)
==12923==    by 0x123E7E30: _pygi_closure_handle (pygi-closure.c:592)
==12923==    by 0x135D3B7A: ffi_closure_unix64_inner (in /usr/lib64/libffi.so.6.0.1)
==12923==    by 0x135D3EF3: ffi_closure_unix64 (in /usr/lib64/libffi.so.6.0.1)
==12923==    by 0x13E0170F: gi_marshalling_tests_object_vfunc_caller_allocated_out_parameter (gimarshallingtests.c:4334)
==12923==    by 0x135D3D8B: ffi_call_unix64 (in /usr/lib64/libffi.so.6.0.1)
==12923==    by 0x135D36BB: ffi_call (in /usr/lib64/libffi.so.6.0.1)
==12923==    by 0x123EB5B3: pygi_invoke_c_callable (pygi-invoke.c:628)
==12923==    by 0x123EC893: _function_cache_invoke_real (pygi-cache.c:714)
==12923==    by 0x123ECA92: pygi_function_cache_invoke (pygi-cache.c:793)
==12923==    by 0x123EB6B5: pygi_callable_info_invoke (pygi-invoke.c:671)
==12923==    by 0x123EB7F9: _wrap_g_callable_info_invoke (pygi-invoke.c:708)
==12923==    by 0x123D8715: _callable_info_call (pygi-info.c:557)


I believe the problem is we don't take into account caller allocated memory for the GValue which may be held in arg->v_pointer:

https://git.gnome.org/browse/pygobject/tree/gi/pygi-struct-marshal.c?id=3.13.91#n118
Comment 1 GNOME Infrastructure Team 2018-01-10 20:46:45 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/87.