nvdec/glimagesink memory leaks
Create a test file this way:
gst-launch-1.0 videotestsrc num-buffers=10 ! openh264enc ! h264parse ! matroskamux ! filesink location=/tmp/test.mkv
and then try this pipeline:
gst-launch-1.0 filesrc location=/tmp/test.mkv ! matroskademux ! h264parse ! nvdec ! fakesink
valgrind report no leakeage.
Now try this one:
gst-launch-1.0 filesrc location=/tmp/test.mkv ! matroskademux ! h264parse ! nvdec ! glimagesink
valgrind reports several leaks:
==18166== 176 (64 direct, 112 indirect) bytes in 2 blocks are definitely lost in loss record 3,069 of 3,258
==18166== at 0x483977F: malloc (vg_replace_malloc.c:299)
==18166== by 0x4C898D1: g_malloc (in /usr/lib/libglib-2.0.so.0.5800.3)
==18166== by 0x4C6A094: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.5800.3)
==18166== by 0x4893D9A: gst_caps_features_new_empty (gstcapsfeatures.c:178)
==18166== by 0x4894BDA: gst_caps_features_from_string (gstcapsfeatures.c:501)
==18166== by 0x7731C36: _dma_buf_upload_transform_caps (gstglupload.c:522)
==18166== by 0x7732F62: gst_gl_upload_transform_caps (gstglupload.c:1817)
==18166== by 0x7732F62: gst_gl_upload_transform_caps (gstglupload.c:1790)
==18166== by 0x5BBEA80: gst_base_transform_transform_caps (gstbasetransform.c:474)
==18166== by 0x5BC2713: gst_base_transform_query_caps (gstbasetransform.c:695)
==18166== by 0x5BC2713: gst_base_transform_default_query (gstbasetransform.c:1550)
==18166== by 0x48C80CF: gst_pad_query (gstpad.c:4070)
==18166== by 0x48C884A: gst_pad_peer_query (gstpad.c:4202)
==18166== by 0x4900067: query_caps_func (gstutils.c:2765)
==18166== by 0x48C6C2D: gst_pad_forward (gstpad.c:3007)
==18166== by 0x4902C59: gst_pad_proxy_query_caps (gstutils.c:2815)
==18166== by 0x48C6E53: gst_pad_query_caps_default (gstpad.c:3186)
==18166== by 0x48C6E53: gst_pad_query_default (gstpad.c:3414)
==18166== by 0x48C80CF: gst_pad_query (gstpad.c:4070)
==18166== by 0x48C884A: gst_pad_peer_query (gstpad.c:4202)
==18166== by 0x4905AFB: gst_pad_peer_query_caps (gstutils.c:3107)
==18166== by 0x74FAAE4: __gst_video_element_proxy_getcaps (gstvideoutilsprivate.c:111)
==18166== by 0x74F00AC: gst_video_decoder_sink_getcaps (gstvideodecoder.c:1777)
==18166== by 0x74F00AC: gst_video_decoder_sink_query_default (gstvideodecoder.c:1824)
==18166==
==18166== 264 (96 direct, 168 indirect) bytes in 3 blocks are definitely lost in loss record 3,126 of 3,258
==18166== at 0x483977F: malloc (vg_replace_malloc.c:299)
==18166== by 0x4C898D1: g_malloc (in /usr/lib/libglib-2.0.so.0.5800.3)
==18166== by 0x4C6A094: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.5800.3)
==18166== by 0x4893D9A: gst_caps_features_new_empty (gstcapsfeatures.c:178)
==18166== by 0x4894BDA: gst_caps_features_from_string (gstcapsfeatures.c:501)
==18166== by 0x7731C36: _dma_buf_upload_transform_caps (gstglupload.c:522)
==18166== by 0x7732F62: gst_gl_upload_transform_caps (gstglupload.c:1817)
==18166== by 0x7732F62: gst_gl_upload_transform_caps (gstglupload.c:1790)
==18166== by 0x5BBEA80: gst_base_transform_transform_caps (gstbasetransform.c:474)
==18166== by 0x5BC23BA: gst_base_transform_query_caps (gstbasetransform.c:650)
==18166== by 0x5BC23BA: gst_base_transform_default_query (gstbasetransform.c:1550)
==18166== by 0x48C80CF: gst_pad_query (gstpad.c:4070)
==18166== by 0x48C884A: gst_pad_peer_query (gstpad.c:4202)
==18166== by 0x4900067: query_caps_func (gstutils.c:2765)
==18166== by 0x48C6C2D: gst_pad_forward (gstpad.c:3007)
==18166== by 0x4902C59: gst_pad_proxy_query_caps (gstutils.c:2815)
==18166== by 0x48C6E53: gst_pad_query_caps_default (gstpad.c:3186)
==18166== by 0x48C6E53: gst_pad_query_default (gstpad.c:3414)
==18166== by 0x48C80CF: gst_pad_query (gstpad.c:4070)
==18166== by 0x48C884A: gst_pad_peer_query (gstpad.c:4202)
==18166== by 0x4905AFB: gst_pad_peer_query_caps (gstutils.c:3107)
==18166== by 0x74FACE8: __gst_video_element_proxy_getcaps (gstvideoutilsprivate.c:108)
==18166== by 0x74F00AC: gst_video_decoder_sink_getcaps (gstvideodecoder.c:1777)
==18166== by 0x74F00AC: gst_video_decoder_sink_query_default (gstvideodecoder.c:1824)
==18166==
==18166== 264 (96 direct, 168 indirect) bytes in 3 blocks are definitely lost in loss record 3,127 of 3,258
==18166== at 0x483977F: malloc (vg_replace_malloc.c:299)
==18166== by 0x4C898D1: g_malloc (in /usr/lib/libglib-2.0.so.0.5800.3)
==18166== by 0x4C6A094: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.5800.3)
==18166== by 0x4893D9A: gst_caps_features_new_empty (gstcapsfeatures.c:178)
==18166== by 0x4894BDA: gst_caps_features_from_string (gstcapsfeatures.c:501)
==18166== by 0x7731C36: _dma_buf_upload_transform_caps (gstglupload.c:522)
==18166== by 0x7732F62: gst_gl_upload_transform_caps (gstglupload.c:1817)
==18166== by 0x7732F62: gst_gl_upload_transform_caps (gstglupload.c:1790)
==18166== by 0x5BBEA80: gst_base_transform_transform_caps (gstbasetransform.c:474)
==18166== by 0x5BC2713: gst_base_transform_query_caps (gstbasetransform.c:695)
==18166== by 0x5BC2713: gst_base_transform_default_query (gstbasetransform.c:1550)
==18166== by 0x48C80CF: gst_pad_query (gstpad.c:4070)
==18166== by 0x48C884A: gst_pad_peer_query (gstpad.c:4202)
==18166== by 0x4900067: query_caps_func (gstutils.c:2765)
==18166== by 0x48C6C2D: gst_pad_forward (gstpad.c:3007)
==18166== by 0x4902C59: gst_pad_proxy_query_caps (gstutils.c:2815)
==18166== by 0x48C6E53: gst_pad_query_caps_default (gstpad.c:3186)
==18166== by 0x48C6E53: gst_pad_query_default (gstpad.c:3414)
==18166== by 0x48C80CF: gst_pad_query (gstpad.c:4070)
==18166== by 0x48C884A: gst_pad_peer_query (gstpad.c:4202)
==18166== by 0x4905AFB: gst_pad_peer_query_caps (gstutils.c:3107)
==18166== by 0x74FACE8: __gst_video_element_proxy_getcaps (gstvideoutilsprivate.c:108)
==18166== by 0x74F00AC: gst_video_decoder_sink_getcaps (gstvideodecoder.c:1777)
==18166== by 0x74F00AC: gst_video_decoder_sink_query_default (gstvideodecoder.c:1824)
==18166==
==18166== 838 (72 direct, 766 indirect) bytes in 1 blocks are definitely lost in loss record 3,202 of 3,258
==18166== at 0x483977F: malloc (vg_replace_malloc.c:299)
==18166== by 0x4C898D1: g_malloc (in /usr/lib/libglib-2.0.so.0.5800.3)
==18166== by 0x4C6A094: g_slice_alloc (in /usr/lib/libglib-2.0.so.0.5800.3)
==18166== by 0x488F9CA: gst_caps_new_empty (gstcaps.c:258)
==18166== by 0x488FBE8: gst_caps_new_simple (gstcaps.c:331)
==18166== by 0x74D50EF: gst_video_info_to_caps (video-info.c:628)
==18166== by 0x49AEF37: handle_pending_frames (gstnvdec.c:807)
==18166== by 0x49B25A6: gst_nvdec_handle_frame (gstnvdec.c:972)
==18166== by 0x74E7F2A: gst_video_decoder_decode_frame (gstvideodecoder.c:3433)
==18166== by 0x74ED087: gst_video_decoder_chain_forward (gstvideodecoder.c:2154)
==18166== by 0x74ED790: gst_video_decoder_chain (gstvideodecoder.c:2469)
==18166== by 0x48C2A31: gst_pad_chain_data_unchecked (gstpad.c:4325)
==18166== by 0x48C2A31: gst_pad_push_data (gstpad.c:4581)
==18166== by 0x48C9351: gst_pad_push (gstpad.c:4700)
==18166== by 0x5BA1AD7: gst_base_parse_push_frame (gstbaseparse.c:2580)
==18166== by 0x5BA48EA: gst_base_parse_handle_and_push_frame (gstbaseparse.c:2394)
==18166== by 0x5BA48EA: gst_base_parse_finish_frame (gstbaseparse.c:2738)
==18166== by 0x7692ECA: gst_h264_parse_handle_frame_packetized (gsth264parse.c:1031)
==18166== by 0x7692ECA: gst_h264_parse_handle_frame (gsth264parse.c:1084)
==18166== by 0x5B9C6D1: gst_base_parse_handle_buffer (gstbaseparse.c:2202)
==18166== by 0x5BA27DB: gst_base_parse_chain (gstbaseparse.c:3287)
==18166== by 0x48C2A31: gst_pad_chain_data_unchecked (gstpad.c:4325)
==18166== by 0x48C2A31: gst_pad_push_data (gstpad.c:4581)
==18166== by 0x48C9351: gst_pad_push (gstpad.c:4700)
==18166==
==18166== LEAK SUMMARY:
==18166== definitely lost: 424 bytes in 12 blocks
==18166== indirectly lost: 1,382 bytes in 36 blocks
==18166== possibly lost: 2,408 bytes in 19 blocks
==18166== still reachable: 384,111 bytes in 1,134 blocks
==18166== of which reachable via heuristic:
==18166== length64 : 1,168 bytes in 22 blocks
==18166== newarray : 1,696 bytes in 26 blocks
==18166== suppressed: 659,531 bytes in 3,189 blocks
==18166== Reachable blocks (those to which a pointer was found) are not shown.
==18166== To see them, rerun with: --leak-check=full --show-leak-kinds=all
Tested with today git master.
I have no time to investigate further or to fix the leaks now, sorry, I'm only testing the gpu of my new laptop :)
Edited by Nicola