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 738291 - fluiddec: leaks incoming caps event
fluiddec: leaks incoming caps event
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.4.3
Other Linux
: Normal normal
: 1.4.4
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-10-10 11:49 UTC by Antonio Ospite
Modified: 2014-10-25 12:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
memleak after gst_event_new_caps() (3.60 KB, text/x-log)
2014-10-10 11:49 UTC, Antonio Ospite
Details

Description Antonio Ospite 2014-10-10 11:49:12 UTC
Created attachment 288211 [details]
memleak after gst_event_new_caps()

Hi,

running the following pipeline under valgrind I get some "definitely lost"
blocks:

wget -nc http://www.midishrine.com/midipp/nes/Super_Mario_Bros/smb1-1up.mid

gst-launch-1.0 filesrc location=smb1-1up.mid ! midiparse ! fluiddec ! fakesink

Full log attached, it contains the exact valgrind command line.

My current guess is that a new event is created in gst_event_new_caps() but
there is some missing call to gst_event_unref() somewhere, maybe in
gstreamer/gst/gstpad.c in the push_buffer_* functions?

I don't know the GStreamer internals well enough to figure it out myself, I'd
appreciate if someone more familiar with the code could take a look.

Thanks,
   Antonio
Comment 1 Tim-Philipp Müller 2014-10-10 12:07:55 UTC
commit 39a5c202636d319b18cdd27d27f9dd06e8d9ca97
Author: Tim-Philipp Müller <tim@centricular.com>
Date:   Fri Oct 10 13:05:49 2014 +0100

    fluiddec: don't leak incoming caps event
    
    https://bugzilla.gnome.org/show_bug.cgi?id=738291
Comment 2 Antonio Ospite 2014-10-10 13:16:17 UTC
Thanks.

Just to be sure, we are deincrementing the refcount of the _unused_ event parameter here, right?

While the one created in the call below will be unreferenced by GStreamer in the push callbacks instead:
res = gst_pad_push_event (fluiddec->srcpad, gst_event_new_caps (caps));
                                            ^^^

Is that correct?

Ciao,
   Antonio
Comment 3 Tim-Philipp Müller 2014-10-10 13:32:26 UTC
pad_push() and pad_push_event() takes ownership of the buffer/event, meaning the next element takes ownership and is responsible for either unreffing it or passing it on.