GNOME Bugzilla – Bug 647055
liveadder has a memory leak
Last modified: 2011-12-12 14:03:28 UTC
Created attachment 185434 [details] valgrind output. Nature of the bug: When I check the memory usage of the gst-launch command as described below (using top), I see the memory usage increases from 1.2% to 8% when streaming one mp3. The memory "leaks" only when the data stream is active and when the liveadder plugin is in the pipeline. In the end (after streaming several mp3's) the process is killed by the OS. This is the command that causes the memory leak: gst-launch-0.10 -v udpsrc port=5000 caps="application/x-rtp,media=(string)audio, clock-rate=(int)44100, channels=(int)2, payload=(int)96" ! gstrtpbin ! rtpL16depay ! audioconvert ! audioresample ! liveadder ! alsasink To stream audio to this pipeline, use the following gst-launch command (which does not have any problems) gst-launch -v filesrc location=DownUnder.mp3 ! mad ! audioconvert ! audio/x-raw-int,channels=2,rate=44100 ! rtpL16pay ! udpsink host=localhost port=5000 My system configuration: UBUNTU 10.04 LTS Initial bug found with the following packages installed via the Ubuntu package manager: gstreamer 0.10.28 base 0.10.28 good 0.10.21 bad 0.10.18 ugly 0.10.14 Bug reproduced with latest packages downloaded from http://gstreamer.freedesktop.org/src/ These are compiled by me. gstreamer 0.10.32 base 0.10.32 good 0.10.28 bad 0.10.21 ugly 0.10.17 The command that caused problems is "valgrinded" using the gstreamer suppression file found at: http://cgit.freedesktop.org/gstreamer/common/plain/gst.supp See attachement for valgrind output.
Created attachment 185435 [details] gst feedback of my system gst feedback of my system
Looks like its leaking a bunch of incoming buffers... Probably a ref leak somewhere. ==28049== 5,747,904 bytes in 2,480 blocks are possibly lost in loss record 2,928 of 2,928 ==28049== at 0x4024106: memalign (vg_replace_malloc.c:581) ==28049== by 0x4024163: posix_memalign (vg_replace_malloc.c:709) ==28049== by 0x40662B4: gst_buffer_try_new_and_alloc (gstbuffer.c:155) ==28049== by 0x4092EB7: gst_pad_alloc_buffer_full (gstpad.c:3020) ==28049== by 0x4B14DE5: gst_base_transform_buffer_alloc (gstbasetransform.c:1869) ==28049== by 0x4092DE2: gst_pad_alloc_buffer_full (gstpad.c:2984) ==28049== by 0x4B18CC5: gst_base_transform_handle_buffer (gstbasetransform.c:1388) ==28049== by 0x4B19346: gst_base_transform_chain (gstbasetransform.c:2349) ==28049== by 0x40996D7: gst_pad_push (gstpad.c:4665) ==28049== by 0x4B747A3: gst_base_rtp_depayload_push_ts (gstbasertpdepayload.c:611) ==28049== by 0x4B75561: gst_base_rtp_depayload_chain (gstbasertpdepayload.c:359) ==28049== by 0x40996D7: gst_pad_push (gstpad.c:4665) ==28049==
Olivier, I'm not so used to interpreting valgrind output... You have cut out a specific piece of the log-file. Can I conclude you expect the bug to be in either gstbasetransform.c or gstbasertpdepayload.c? Do the line numbers direct me to the problem? I mean is it there where I should start looking for the problem? Any idea why others do not have a problem with this bug? Thanks, E-J
No no, the bug is definitely in liveadder.. The buffer is allocated in BaseTransform, but I'm pretty sure that it leaks inside liveadder.
I'm not seeing these leaks with the command line above.
Tried again, I see the leak now. I must have missed it before. I'm having a look at it now.
commit 63110cab94b56605e8df06b4295bf23544d5ed58 Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> Date: Mon Dec 12 13:59:33 2011 +0000 liveadder: fix buffer leak