tests: Add test for new live-objects leaktracer API
authorNirbheek Chauhan <nirbheek@centricular.com>
Mon, 1 Jul 2019 09:35:08 +0000 (15:05 +0530)
committerNirbheek Chauhan <nirbheek@centricular.com>
Tue, 2 Jul 2019 09:43:26 +0000 (15:13 +0530)
commit5524137d7e99438587e21313488d48db745d551c
tree8c376a93680dee5cb2129ab738299380c40e7a41
parent6e3565ca8612de33a1cfbed440ac745ef9940553
tests: Add test for new live-objects leaktracer API

Needs a valgrind suppression for:

==11119== Warning: invalid file descriptor -1 in syscall close()
==11119== Warning: invalid file descriptor -1 in syscall close()
==11119== Syscall param write(buf) points to uninitialised byte(s)
==11119==    at 0x4C4AFAD: syscall (in /usr/lib64/libc-2.29.so)
==11119==    by 0x4E70DF9: write_validate (Ginit.c:112)
==11119==    by 0x4E70DF9: UnknownInlinedFun (Ginit.c:148)
==11119==    by 0x4E70DF9: mincore_validate (Ginit.c:131)
==11119==    by 0x4E70CC3: UnknownInlinedFun (Ginit.c:208)
==11119==    by 0x4E70CC3: access_mem (Ginit.c:242)
==11119==    by 0x4E75536: UnknownInlinedFun (libunwind_i.h:168)
==11119==    by 0x4E75536: apply_reg_state (Gparser.c:863)
==11119==    by 0x4E75A71: _ULx86_64_dwarf_step (Gparser.c:952)
==11119==    by 0x4E71BD3: _ULx86_64_step (Gstep.c:71)
==11119==    by 0x48BAF47: generate_unwind_trace (gstinfo.c:2726)
==11119==    by 0x48BC92E: gst_debug_get_stack_trace (gstinfo.c:2908)
==11119==    by 0x49B2BB2: handle_object_created.part.0 (gstleaks.c:384)
==11119==    by 0x488134E: gst_object_constructed (gstobject.c:141)
==11119==    by 0x49EC61B: g_object_new_internal (gobject.c:1845)
==11119==    by 0x49EE347: g_object_new_valist (gobject.c:2128)
==11119==    by 0x49EE69C: g_object_new (gobject.c:1648)
==11119==    by 0x48CA59D: gst_pad_new_from_template (gstpad.c:867)
==11119==    by 0x68C209E: gst_base_src_init (gstbasesrc.c:454)
==11119==    by 0x4A0A0C3: g_type_create_instance (gtype.c:1858)
==11119==    by 0x49EC42C: g_object_new_internal (gobject.c:1805)
==11119==    by 0x49EDB14: g_object_new_with_properties (gobject.c:1973)
==11119==    by 0x49EE6C0: g_object_new (gobject.c:1645)
==11119==    by 0x48AF91A: gst_element_factory_create (gstelementfactory.c:372)
==11119==  Address 0x1ffeffe000 is on thread 1's stack
==11119==  in frame #6, created by generate_unwind_trace (gstinfo.c:2695)

Fixed in libunwind commit:
https://github.com/libunwind/libunwind/commit/b256722d49a63719c69c0416eba9163a4d069584

Needs a separate suppression for Debian because the callstack is
different there.
tests/check/elements/leaks.c [new file with mode: 0644]
tests/check/gstreamer.supp
tests/check/meson.build