gstd-1.x icon indicating copy to clipboard operation
gstd-1.x copied to clipboard

Memory leak with very simple test

Open jafet-chaves opened this issue 4 years ago • 0 comments

I got the following memory leak while testing with these simple commands:

G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind --leak-check=full --leak-resolution=high --num-callers=20 --trace-children=yes --suppressions=/home/nvidia/massif/gst.supp --suppressions=/home/nvidia/massif/glib.supp gstd -D

gstd-client pipeline_create pipe_test videotestsrc ! fakesink
gstd-client pipeline_play pipe_test
gstd-client pipeline_delete pipe_test

Environment info:

  • Jetson TX2 (JetPack 3.2.1)
  • Valgrind version: valgrind-3.17.0.GIT
  • gstd version: 0.11.3
  • GStreamer version: 1.12.4

Valgrind log:

==14354== 668 (424 direct, 244 indirect) bytes in 2 blocks are definitely lost in loss record 2,817 of 2,849 ==14354== at 0x4845208: malloc (vg_replace_malloc.c:307) ==14354== by 0x4A72AE3: g_malloc (gmem.c:94) ==14354== by 0x4A89BB3: g_slice_alloc (gslice.c:1025) ==14354== by 0x4A8A11B: g_slice_alloc0 (gslice.c:1051) ==14354== by 0x49FA99B: g_type_create_instance (gtype.c:1857) ==14354== by 0x49DC2C3: g_object_new_internal (gobject.c:1781) ==14354== by 0x49DDDA3: g_object_newv (gobject.c:1928) ==14354== by 0x49DE63F: g_object_new (gobject.c:1621) ==14354== by 0x401E3F: ipc_add_option_groups (gstd.c:82) ==14354== by 0x401E3F: main (gstd.c:207) ==14354== ==14354== 4,096 bytes in 1 blocks are definitely lost in loss record 2,840 of 2,849 ==14354== at 0x48476DC: realloc (vg_replace_malloc.c:834) ==14354== by 0x4A72BAF: g_realloc (gmem.c:159) ==14354== by 0x4A8E28B: g_string_maybe_expand (gstring.c:102) ==14354== by 0x4A8F643: g_string_append_vprintf (gstring.c:1146) ==14354== by 0x4A8F88F: g_string_append_printf (gstring.c:1246) ==14354== by 0x48D92BF: debug_dump_element_pad_link (gstdebugutils.c:530) ==14354== by 0x48D98DB: debug_dump_element (gstdebugutils.c:702) ==14354== by 0x48D9B63: gst_debug_bin_to_dot_data (gstdebugutils.c:816) ==14354== by 0x4B33F97: gstd_pipeline_get_property (gstd_pipeline.c:356) ==14354== by 0x49DF767: object_get_property (gobject.c:1376) ==14354== by 0x49DF767: g_object_get_property (gobject.c:2444) ==14354== by 0x4B33257: gstd_object_to_string_default (gstd_object.c:286) ==14354== by 0x4B4279F: gstd_parser_create (gstd_parser.c:272) ==14354== by 0x4B4279F: gstd_parser_parse_raw_cmd (gstd_parser.c:178) ==14354== by 0x4B44947: gstd_parser_pipeline_create (gstd_parser.c:352) ==14354== by 0x4B44A8B: gstd_parser_parse_cmd (gstd_parser.c:219) ==14354== by 0x4B46CA3: gstd_socket_callback (gstd_socket.c:118) ==14354== by 0x4DACE5F: ffi_call_SYSV (in /usr/lib/aarch64-linux-gnu/libffi.so.6.0.4) ==14354== by 0x4DAD7B7: ffi_call (in /usr/lib/aarch64-linux-gnu/libffi.so.6.0.4) ==14354== by 0x49D73B7: g_cclosure_marshal_generic_va (gclosure.c:1604) ==14354== by 0x49D69B7: _g_closure_invoke_va (gclosure.c:867) ==14354== by 0x49F16BF: g_signal_emit_valist (gsignal.c:3294) ==14354== ==14354== LEAK SUMMARY: ==14354== definitely lost: 4,520 bytes in 3 blocks ==14354== indirectly lost: 244 bytes in 10 blocks ==14354== possibly lost: 136 bytes in 2 blocks ==14354== still reachable: 29,453 bytes in 519 blocks ==14354== of which reachable via heuristic: ==14354== length64 : 1,072 bytes in 25 blocks ==14354== newarray : 1,760 bytes in 30 blocks ==14354== suppressed: 532,202 bytes in 2,482 blocks ==14354== Reachable blocks (those to which a pointer was found) are not shown. ==14354== To see them, rerun with: --leak-check=full --show-leak-kinds=all ==14354== ==14354== For lists of detected and suppressed errors, rerun with: -s ==14354== ERROR SUMMARY: 4 errors from 4 contexts (suppressed: 61 from 61)

jafet-chaves avatar Mar 12 '21 01:03 jafet-chaves