GNOME Bugzilla – Bug 515575
[lame] unit test shows memory leak
Last modified: 2008-02-11 09:13:23 UTC
Hi, the pipelines/lame unit test shows some memleaks, one is easy to fix (gst_caps_unref (allowed_caps); around line 1200), the other's are not exactly easy to understand (output below only for these two). The buffer that is leaked here (and the other thing is the GST_BUFFER_DATA) is pushed downstream in any case so it shouldn't leak at all. Maybe weirdness in core? Running suite(s): lame ==29321== ==29321== 356 (80 direct, 276 indirect) bytes in 1 blocks are definitely lost in loss record 3,406 of 3,477 ==29321== at 0x4024AB8: malloc (vg_replace_malloc.c:207) ==29321== by 0x42C8985: g_malloc (in /usr/lib/libglib-2.0.so.0.1504.0) ==29321== by 0x42DDBFD: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.1504.0) ==29321== by 0x42DE404: g_slice_alloc0 (in /usr/lib/libglib-2.0.so.0.1504.0) ==29321== by 0x41432A6: g_type_create_instance (in /usr/lib/libgobject-2.0.so.0.1504.0) ==29321== by 0x407C724: gst_mini_object_new (gstminiobject.c:181) ==29321== by 0x405D2F4: gst_buffer_new (gstbuffer.c:291) ==29321== by 0x4A9FE09: gst_lame_chain (gstlame.c:1110) ==29321== by 0x40828C8: gst_pad_chain_unchecked (gstpad.c:3523) ==29321== by 0x4082F95: gst_pad_push (gstpad.c:3691) ==29321== by 0x4A4926D: gst_base_transform_chain (gstbasetransform.c:1610) ==29321== by 0x40828C8: gst_pad_chain_unchecked (gstpad.c:3523) ==29321== by 0x4082F95: gst_pad_push (gstpad.c:3691) ==29321== by 0x4A43B80: gst_base_src_loop (gstbasesrc.c:2111) ==29321== by 0x409CB0F: gst_task_func (gsttask.c:192) ==29321== by 0x42EA62A: (within /usr/lib/libglib-2.0.so.0.1504.0) ==29321== by 0x42E899E: (within /usr/lib/libglib-2.0.so.0.1504.0) ==29321== by 0x433D4FA: start_thread (in /lib/i686/cmov/libpthread-2.7.so) ==29321== by 0x442693D: clone (in /lib/i686/cmov/libc-2.7.so) ==29321== ==29321== ==29321== 8,480 bytes in 1 blocks are possibly lost in loss record 3,474 of 3,477 ==29321== at 0x4024AB8: malloc (vg_replace_malloc.c:207) ==29321== by 0x42C8985: g_malloc (in /usr/lib/libglib-2.0.so.0.1504.0) ==29321== by 0x4A9FCF8: gst_lame_chain (gstlame.c:1066) ==29321== by 0x40828C8: gst_pad_chain_unchecked (gstpad.c:3523) ==29321== by 0x4082F95: gst_pad_push (gstpad.c:3691) ==29321== by 0x4A4926D: gst_base_transform_chain (gstbasetransform.c:1610) ==29321== by 0x40828C8: gst_pad_chain_unchecked (gstpad.c:3523) ==29321== by 0x4082F95: gst_pad_push (gstpad.c:3691) ==29321== by 0x4A43B80: gst_base_src_loop (gstbasesrc.c:2111) ==29321== by 0x409CB0F: gst_task_func (gsttask.c:192) ==29321== by 0x42EA62A: (within /usr/lib/libglib-2.0.so.0.1504.0) ==29321== by 0x42E899E: (within /usr/lib/libglib-2.0.so.0.1504.0) ==29321== by 0x433D4FA: start_thread (in /lib/i686/cmov/libpthread-2.7.so) ==29321== by 0x442693D: clone (in /lib/i686/cmov/libc-2.7.so)
ok, found it. patch comes later :)
Created attachment 104892 [details] [review] lame.diff
Thanks - looks good.
2008-02-11 Sebastian Dröge <slomo@circular-chaos.org> * ext/lame/gstlame.c: (gst_lame_setup): Don't leak the allowed caps. * tests/check/pipelines/lame.c: (GST_START_TEST): Stop leaking all buffers. Fixes bug #515575.