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 647055 - liveadder has a memory leak
liveadder has a memory leak
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
0.10.21
Other Linux
: Normal normal
: 0.10.23
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-04-07 16:00 UTC by ejvanderlinden
Modified: 2011-12-12 14:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
valgrind output. (465.79 KB, text/x-log)
2011-04-07 16:00 UTC, ejvanderlinden
Details
gst feedback of my system (139.61 KB, text/plain)
2011-04-07 16:04 UTC, ejvanderlinden
Details

Description ejvanderlinden 2011-04-07 16:00:51 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.
Comment 1 ejvanderlinden 2011-04-07 16:04:00 UTC
Created attachment 185435 [details]
gst feedback of my system

gst feedback of my system
Comment 2 Olivier Crête 2011-04-07 16:25:14 UTC
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==
Comment 3 ejvanderlinden 2011-04-09 08:49:19 UTC
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
Comment 4 Olivier Crête 2011-04-09 14:48:58 UTC
No no, the bug is definitely in liveadder.. The buffer is allocated in BaseTransform, but I'm pretty sure that it leaks inside liveadder.
Comment 5 Vincent Penquerc'h 2011-08-10 10:43:48 UTC
I'm not seeing these leaks with the command line above.
Comment 6 Vincent Penquerc'h 2011-12-12 13:31:00 UTC
Tried again, I see the leak now. I must have missed it before. I'm having a look at it now.
Comment 7 Vincent Penquerc'h 2011-12-12 14:03:28 UTC
commit 63110cab94b56605e8df06b4295bf23544d5ed58
Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Date:   Mon Dec 12 13:59:33 2011 +0000

    liveadder: fix buffer leak