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 777539 - flacdec: memory leak in gst_flac_dec_write
flacdec: memory leak in gst_flac_dec_write
Status: RESOLVED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
unspecified
Other Linux
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-01-20 15:33 UTC by Hanno Böck
Modified: 2018-01-18 21:22 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Hanno Böck 2017-01-20 15:33:12 UTC
file:
https://samples.mplayerhq.hu/ffmpeg-bugs/roundup/issue810/milk_30sec.flac

This one requires
ASAN_OPTIONS="fast_unwind_on_malloc=0"
and
G_SLICE=always-malloc
set to be visible.

asan trace:
==2641==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 272 byte(s) in 1 object(s) allocated from:
    #0 0x4cbbb8 in malloc (/usr/bin/gst-discoverer-1.0+0x4cbbb8)
    #1 0x7f6a4badf768 in g_malloc /var/tmp/portage/dev-libs/glib-2.50.2/work/glib-2.50.2/glib/gmem.c:94
    #2 0x7f6a4baf74d2 in g_slice_alloc /var/tmp/portage/dev-libs/glib-2.50.2/work/glib-2.50.2/glib/gslice.c:1025
    #3 0x7f6a4c74566c in gst_buffer_new /f/gstreamer/gstreamer/gst/gstbuffer.c:797:12
    #4 0x7f6a4c74566c in gst_buffer_new_allocate /f/gstreamer/gstreamer/gst/gstbuffer.c:845
    #5 0x7f6a3eb97ca0 in gst_flac_dec_write /f/gstreamer/gst-plugins-good/ext/flac/gstflacdec.c:647:7
    #6 0x7f6a3eb97ca0 in gst_flac_dec_write_stream /f/gstreamer/gst-plugins-good/ext/flac/gstflacdec.c:727
    #7 0x7f6a3e96276a  (/usr/lib64/libFLAC.so.8+0x2976a)
    #8 0x7f6a3e965987 in FLAC__stream_decoder_process_single (/usr/lib64/libFLAC.so.8+0x2c987)
    #9 0x7f6a3eb95876 in gst_flac_dec_handle_frame /f/gstreamer/gst-plugins-good/ext/flac/gstflacdec.c:795:8
    #10 0x7f6a4d9014b8 in gst_audio_decoder_handle_frame /f/gstreamer/gst-plugins-base/gst-libs/gst/audio/gstaudiodecoder.c:1468:10
    #11 0x7f6a4d8fe3ff in gst_audio_decoder_push_buffers /f/gstreamer/gst-plugins-base/gst-libs/gst/audio/gstaudiodecoder.c:1566:11
    #12 0x7f6a4d8ff2b4 in gst_audio_decoder_chain_forward /f/gstreamer/gst-plugins-base/gst-libs/gst/audio/gstaudiodecoder.c:1680:9
    #13 0x7f6a4d902658 in gst_audio_decoder_chain /f/gstreamer/gst-plugins-base/gst-libs/gst/audio/gstaudiodecoder.c:1940:11
    #14 0x7f6a4c83a367 in gst_pad_chain_data_unchecked /f/gstreamer/gstreamer/gst/gstpad.c:4204:11
    #15 0x7f6a4c83db37 in gst_pad_push_data /f/gstreamer/gstreamer/gst/gstpad.c:4456:9
    #16 0x7f6a4c83d1af in gst_pad_push /f/gstreamer/gstreamer/gst/gstpad.c:4575:9
    #17 0x7f6a4cd5fbcf in gst_base_parse_push_frame /f/gstreamer/gstreamer/libs/gst/base/gstbaseparse.c:2554:13
    #18 0x7f6a4cd67e8b in gst_base_parse_handle_and_push_frame /f/gstreamer/gstreamer/libs/gst/base/gstbaseparse.c:2371:10
    #19 0x7f6a4cd67e8b in gst_base_parse_finish_frame /f/gstreamer/gstreamer/libs/gst/base/gstbaseparse.c:2712
    #20 0x7f6a3f5fa32a in gst_flac_parse_handle_frame /f/gstreamer/gst-plugins-good/gst/audioparsers/gstflacparse.c:874:13
    #21 0x7f6a4cd8d7d4 in gst_base_parse_handle_buffer /f/gstreamer/gstreamer/libs/gst/base/gstbaseparse.c:2179:9
    #22 0x7f6a4cd8b78b in gst_base_parse_scan_frame /f/gstreamer/gstreamer/libs/gst/base/gstbaseparse.c:3482:11
    #23 0x7f6a4cd882ee in gst_base_parse_loop /f/gstreamer/gstreamer/libs/gst/base/gstbaseparse.c:3561:9
    #24 0x7f6a4c904973 in gst_task_func /f/gstreamer/gstreamer/gst/gsttask.c:334:5
    #25 0x7f6a4bb01b2d in g_thread_pool_thread_proxy /var/tmp/portage/dev-libs/glib-2.50.2/work/glib-2.50.2/glib/gthreadpool.c:307
    #26 0x7f6a4bb01154 in g_thread_proxy /var/tmp/portage/dev-libs/glib-2.50.2/work/glib-2.50.2/glib/gthread.c:784
    #27 0x7f6a4b57f453 in start_thread (/lib64/libpthread.so.0+0x7453)
    #28 0x7f6a4b0af5dc in clone (/lib64/libc.so.6+0xe75dc)

Indirect leak of 262291 byte(s) in 1 object(s) allocated from:
    #0 0x4cbbb8 in malloc (/usr/bin/gst-discoverer-1.0+0x4cbbb8)
    #1 0x7f6a4badf768 in g_malloc /var/tmp/portage/dev-libs/glib-2.50.2/work/glib-2.50.2/glib/gmem.c:94
    #2 0x7f6a4baf74d2 in g_slice_alloc /var/tmp/portage/dev-libs/glib-2.50.2/work/glib-2.50.2/glib/gslice.c:1025
    #3 0x7f6a4c7202fc in _sysmem_new_block /f/gstreamer/gstreamer/gst/gstallocator.c:416:9
    #4 0x7f6a4c7202fc in default_alloc /f/gstreamer/gstreamer/gst/gstallocator.c:515
    #5 0x7f6a4c71ea32 in gst_allocator_alloc /f/gstreamer/gstreamer/gst/gstallocator.c:313:11
    #6 0x7f6a4c74562c in gst_buffer_new_allocate /f/gstreamer/gstreamer/gst/gstbuffer.c:838:11
    #7 0x7f6a3eb97ca0 in gst_flac_dec_write /f/gstreamer/gst-plugins-good/ext/flac/gstflacdec.c:647:7
    #8 0x7f6a3eb97ca0 in gst_flac_dec_write_stream /f/gstreamer/gst-plugins-good/ext/flac/gstflacdec.c:727
    #9 0x7f6a3e96276a  (/usr/lib64/libFLAC.so.8+0x2976a)
    #10 0x7f6a3e965987 in FLAC__stream_decoder_process_single (/usr/lib64/libFLAC.so.8+0x2c987)
    #11 0x7f6a3eb95876 in gst_flac_dec_handle_frame /f/gstreamer/gst-plugins-good/ext/flac/gstflacdec.c:795:8
    #12 0x7f6a4d9014b8 in gst_audio_decoder_handle_frame /f/gstreamer/gst-plugins-base/gst-libs/gst/audio/gstaudiodecoder.c:1468:10
    #13 0x7f6a4d8fe3ff in gst_audio_decoder_push_buffers /f/gstreamer/gst-plugins-base/gst-libs/gst/audio/gstaudiodecoder.c:1566:11
    #14 0x7f6a4d8ff2b4 in gst_audio_decoder_chain_forward /f/gstreamer/gst-plugins-base/gst-libs/gst/audio/gstaudiodecoder.c:1680:9
    #15 0x7f6a4d902658 in gst_audio_decoder_chain /f/gstreamer/gst-plugins-base/gst-libs/gst/audio/gstaudiodecoder.c:1940:11
    #16 0x7f6a4c83a367 in gst_pad_chain_data_unchecked /f/gstreamer/gstreamer/gst/gstpad.c:4204:11
    #17 0x7f6a4c83db37 in gst_pad_push_data /f/gstreamer/gstreamer/gst/gstpad.c:4456:9
    #18 0x7f6a4c83d1af in gst_pad_push /f/gstreamer/gstreamer/gst/gstpad.c:4575:9
    #19 0x7f6a4cd5fbcf in gst_base_parse_push_frame /f/gstreamer/gstreamer/libs/gst/base/gstbaseparse.c:2554:13
    #20 0x7f6a4cd67e8b in gst_base_parse_handle_and_push_frame /f/gstreamer/gstreamer/libs/gst/base/gstbaseparse.c:2371:10
    #21 0x7f6a4cd67e8b in gst_base_parse_finish_frame /f/gstreamer/gstreamer/libs/gst/base/gstbaseparse.c:2712
    #22 0x7f6a3f5fa32a in gst_flac_parse_handle_frame /f/gstreamer/gst-plugins-good/gst/audioparsers/gstflacparse.c:874:13
    #23 0x7f6a4cd8d7d4 in gst_base_parse_handle_buffer /f/gstreamer/gstreamer/libs/gst/base/gstbaseparse.c:2179:9
    #24 0x7f6a4cd8b78b in gst_base_parse_scan_frame /f/gstreamer/gstreamer/libs/gst/base/gstbaseparse.c:3482:11
    #25 0x7f6a4cd882ee in gst_base_parse_loop /f/gstreamer/gstreamer/libs/gst/base/gstbaseparse.c:3561:9
    #26 0x7f6a4c904973 in gst_task_func /f/gstreamer/gstreamer/gst/gsttask.c:334:5
    #27 0x7f6a4bb01b2d in g_thread_pool_thread_proxy /var/tmp/portage/dev-libs/glib-2.50.2/work/glib-2.50.2/glib/gthreadpool.c:307
    #28 0x7f6a4bb01154 in g_thread_proxy /var/tmp/portage/dev-libs/glib-2.50.2/work/glib-2.50.2/glib/gthread.c:784
    #29 0x7f6a4b57f453 in start_thread (/lib64/libpthread.so.0+0x7453)
    #30 0x7f6a4b0af5dc in clone (/lib64/libc.so.6+0xe75dc)

SUMMARY: AddressSanitizer: 262563 byte(s) leaked in 2 allocation(s).
Comment 1 Sebastian Dröge (slomo) 2017-01-20 15:47:03 UTC
I can't reproduce this here with valgrind, and there seems to be no opportunity in the code for leaking the buffer that is allocated in gstflacdec.c:647. Before all returns, it is passed to gst_audio_decoder_finish_frame(). So if anything, it would be some other element leaking the buffer, or the base class.

Can you always reproduce it?
Comment 2 Tim-Philipp Müller 2018-01-18 21:22:33 UTC
Closing this bug report as no further information has been provided. Please feel free to reopen this bug report if you can provide the information that was asked for in a previous comment.
Thanks!