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 756799 - auparse: fix event leak
auparse: fix event leak
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.6.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-10-19 06:50 UTC by Vineeth
Modified: 2015-10-19 09:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix event leak (1.15 KB, patch)
2015-10-19 06:53 UTC, Vineeth
none Details | Review
fix event leak (879 bytes, patch)
2015-10-19 08:39 UTC, Vineeth
committed Details | Review

Description Vineeth 2015-10-19 06:50:41 UTC
Events are supposed to be either passed on or handled and freed. This is not being done in auparse resulting in leaks

==3074== 364 (16 direct, 348 indirect) bytes in 1 blocks are definitely lost in loss record 4,780 of 4,911
==3074==    at 0x402C17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==3074==    by 0x434CBE2: g_malloc (in /lib/i386-linux-gnu/libglib-2.0.so.0.4002.0)
==3074==    by 0x4363281: g_slice_alloc (in /lib/i386-linux-gnu/libglib-2.0.so.0.4002.0)
==3074==    by 0x41FD0A1: gst_structure_new_id_empty_with_size (gststructure.c:145)
==3074==    by 0x41FF637: gst_structure_new_id (gststructure.c:750)
==3074==    by 0x41C21EB: gst_event_new_seek (gstevent.c:1149)
==3074==    by 0x804B511: play_do_seek (gst-play.c:816)
==3074==    by 0x804B838: play_set_rate_and_trick_mode (gst-play.c:766)
==3074==    by 0x804B855: play_set_playback_rate (gst-play.c:832)
==3074==    by 0x804CB2F: gst_play_kb_io_cb (gst-play-kb.c:63)
==3074==    by 0x438CDE4: ??? (in /lib/i386-linux-gnu/libglib-2.0.so.0.4002.0)
==3074==    by 0x43470A6: g_main_context_dispatch (in /lib/i386-linux-gnu/libglib-2.0.so.0.4002.0)
Comment 1 Vineeth 2015-10-19 06:53:20 UTC
Created attachment 313642 [details] [review]
fix event leak
Comment 2 Tim-Philipp Müller 2015-10-19 08:12:39 UTC
Or perhaps just unref in gst_au_parse_src_event() instead?
Comment 3 Vineeth 2015-10-19 08:18:26 UTC
there are two cases here actually..

In case format is not time, we are just returning FALSE.. In this case probably we can check return value and free in src_event()

But when format is time, we are just overwriting the event being passed and creating a new event.

So at least one unref should be done in handle_seek()
Comment 4 Tim-Philipp Müller 2015-10-19 08:33:07 UTC
That's just re-using the existing variable for convenience in handle_seek, it won't overwrite the variable in _src_event().
Comment 5 Vineeth 2015-10-19 08:39:25 UTC
Created attachment 313645 [details] [review]
fix event leak

Yes you are right!! my mistake :)
Comment 6 Tim-Philipp Müller 2015-10-19 09:38:00 UTC
Thanks.

commit 0cefb6722bb8f4f67e8fe7cd0bd3fe7cfd57e63e
Author: Vineeth TM <vineeth.tm@samsung.com>
Date:   Mon Oct 19 17:38:32 2015 +0900

    auparse: Fix event memory leak
    
    Free the event after being handled to prevent memory leak.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756799