GNOME Bugzilla – Bug 529268
[goom] States unit test exposes some memory leaks
Last modified: 2008-04-22 00:20:57 UTC
Current CVS of goom exposes some memory leaks with the states unit test: ==10353== 6,144 bytes in 1 blocks are definitely lost in loss record 15,598 of 15,608 ==10353== at 0x4022AB8: malloc (vg_replace_malloc.c:207) ==10353== by 0x4A9ED84: goom_lines_init (lines.c:174) ==10353== by 0x4AA79F4: goom_init (goom_core.c:99) ==10353== by 0x4A9CBC9: gst_goom_init (gstgoom.c:190) ==10353== by 0x414BE65: g_type_create_instance (gtype.c:1575) ==10353== by 0x41311E1: g_object_constructor (gobject.c:1046) ==10353== by 0x41319A7: g_object_newv (gobject.c:937) ==10353== by 0x41324F0: g_object_new_valist (gobject.c:986) ==10353== by 0x413265F: g_object_new (gobject.c:795) ==10353== by 0x406FA9F: gst_element_factory_create (gstelementfactory.c:405) ==10353== by 0x407040B: gst_element_factory_make (gstelementfactory.c:474) ==10353== by 0x80492BB: test_state_changes_down_seq (states.c:178) ==10353== by 0x402FF5F: srunner_run_all (in /home/slomo/projects/gstreamer/head/gstreamer/libs/gst/check/.libs/libgstcheck-0.10.so.0.16.0) ==10353== by 0x402AFF9: gst_check_run_suite (gstcheck.c:620) ==10353== by 0x80490E8: main (states.c:222) ==10353== ==10353== ==10353== 6,144 bytes in 1 blocks are definitely lost in loss record 15,599 of 15,608 ==10353== at 0x4022AB8: malloc (vg_replace_malloc.c:207) ==10353== by 0x4A9ED84: goom_lines_init (lines.c:174) ==10353== by 0x4AA799F: goom_init (goom_core.c:96) ==10353== by 0x4A9CBC9: gst_goom_init (gstgoom.c:190) ==10353== by 0x414BE65: g_type_create_instance (gtype.c:1575) ==10353== by 0x41311E1: g_object_constructor (gobject.c:1046) ==10353== by 0x41319A7: g_object_newv (gobject.c:937) ==10353== by 0x41324F0: g_object_new_valist (gobject.c:986) ==10353== by 0x413265F: g_object_new (gobject.c:795) ==10353== by 0x406FA9F: gst_element_factory_create (gstelementfactory.c:405) ==10353== by 0x407040B: gst_element_factory_make (gstelementfactory.c:474) ==10353== by 0x80492BB: test_state_changes_down_seq (states.c:178) ==10353== by 0x402FF5F: srunner_run_all (in /home/slomo/projects/gstreamer/head/gstreamer/libs/gst/check/.libs/libgstcheck-0.10.so.0.16.0) ==10353== by 0x402AFF9: gst_check_run_suite (gstcheck.c:620) ==10353== by 0x80490E8: main (states.c:222) ==10353== ==10353== ==10353== 17,640 bytes in 2 blocks are possibly lost in loss record 15,604 of 15,608 ==10353== at 0x4022AB8: malloc (vg_replace_malloc.c:207) ==10353== by 0x4AA13A9: grid3d_new (surf3d.c:16) ==10353== by 0x4AA1CC8: tentacle_fx_init (tentacle3d.c:146) ==10353== by 0x4AA7831: goom_init (goom_core.c:74) ==10353== by 0x4A9CBC9: gst_goom_init (gstgoom.c:190) ==10353== by 0x414BE65: g_type_create_instance (gtype.c:1575) ==10353== by 0x41311E1: g_object_constructor (gobject.c:1046) ==10353== by 0x41319A7: g_object_newv (gobject.c:937) ==10353== by 0x41324F0: g_object_new_valist (gobject.c:986) ==10353== by 0x413265F: g_object_new (gobject.c:795) ==10353== by 0x406FA9F: gst_element_factory_create (gstelementfactory.c:405) ==10353== by 0x407040B: gst_element_factory_make (gstelementfactory.c:474) ==10353== by 0x80492BB: test_state_changes_down_seq (states.c:178) ==10353== by 0x402FF5F: srunner_run_all (in /home/slomo/projects/gstreamer/head/gstreamer/libs/gst/check/.libs/libgstcheck-0.10.so.0.16.0) ==10353== by 0x402AFF9: gst_check_run_suite (gstcheck.c:620) ==10353== by 0x80490E8: main (states.c:222) ==10353== ==10353== ==10353== 18,180 bytes in 2 blocks are possibly lost in loss record 15,605 of 15,608 ==10353== at 0x4022AB8: malloc (vg_replace_malloc.c:207) ==10353== by 0x4AA13B6: grid3d_new (surf3d.c:17) ==10353== by 0x4AA1CC8: tentacle_fx_init (tentacle3d.c:146) ==10353== by 0x4AA7831: goom_init (goom_core.c:74) ==10353== by 0x4A9CBC9: gst_goom_init (gstgoom.c:190) ==10353== by 0x414BE65: g_type_create_instance (gtype.c:1575) ==10353== by 0x41311E1: g_object_constructor (gobject.c:1046) ==10353== by 0x41319A7: g_object_newv (gobject.c:937) ==10353== by 0x41324F0: g_object_new_valist (gobject.c:986) ==10353== by 0x413265F: g_object_new (gobject.c:795) ==10353== by 0x406FA9F: gst_element_factory_create (gstelementfactory.c:405) ==10353== by 0x407040B: gst_element_factory_make (gstelementfactory.c:474) ==10353== by 0x80492BB: test_state_changes_down_seq (states.c:178) ==10353== by 0x402FF5F: srunner_run_all (in /home/slomo/projects/gstreamer/head/gstreamer/libs/gst/check/.libs/libgstcheck-0.10.so.0.16.0) ==10353== by 0x402AFF9: gst_check_run_suite (gstcheck.c:620) ==10353== by 0x80490E8: main (states.c:222) ==10353== ==10353== ==10353== 131,072 bytes in 1 blocks are possibly lost in loss record 15,608 of 15,608 ==10353== at 0x4022AB8: malloc (vg_replace_malloc.c:207) ==10353== by 0x4AA341D: fs_init (flying_stars_fx.c:94) ==10353== by 0x4AA7797: goom_init (goom_core.c:68) ==10353== by 0x4A9CBC9: gst_goom_init (gstgoom.c:190) ==10353== by 0x414BE65: g_type_create_instance (gtype.c:1575) ==10353== by 0x41311E1: g_object_constructor (gobject.c:1046) ==10353== by 0x41319A7: g_object_newv (gobject.c:937) ==10353== by 0x41324F0: g_object_new_valist (gobject.c:986) ==10353== by 0x413265F: g_object_new (gobject.c:795) ==10353== by 0x406FA9F: gst_element_factory_create (gstelementfactory.c:405) ==10353== by 0x407040B: gst_element_factory_make (gstelementfactory.c:474) ==10353== by 0x80492BB: test_state_changes_down_seq (states.c:178) ==10353== by 0x402FF5F: srunner_run_all (in /home/slomo/projects/gstreamer/head/gstreamer/libs/gst/check/.libs/libgstcheck-0.10.so.0.16.0) ==10353== by 0x402AFF9: gst_check_run_suite (gstcheck.c:620) ==10353== by 0x80490E8: main (states.c:222) 100%: Checks: 3, Failures: 0, Errors: 0
This is a bug in the goom code it seems: fs_init() for example allocates some memory as a struct, sets one of the struct members to another newly allocated memory area. And goom_close() only frees the struct and not allocated memory contained in it.
Patch coming up. I'll do another set of pre-rels after all, I guess
Created attachment 109659 [details] [review] fix all visible leaks This patch cleans up the goom instance better - at least all the leaks visible from the states test.
Created attachment 109662 [details] [review] Fix more leaks in GOOM This fixes some more leaks shown in actual use with gst-launch audiotestsrc ! goom ! ffmpegcolorspace ! fakesink Hopefully that nails it.
Fixed in CVS after a quick sanity check by Mike: 2008-04-22 Jan Schmidt <jan.schmidt@sun.com> * gst/goom/config_param.c: (goom_plugin_parameters_free): * gst/goom/convolve_fx.c: (convolve_init), (convolve_free): * gst/goom/filters.c: (zoomFilterVisualFXWrapper_free): * gst/goom/flying_stars_fx.c: (fs_free): * gst/goom/goom_config_param.h: * gst/goom/goom_core.c: (goom_init), (goom_close): * gst/goom/goom_plugin_info.h: * gst/goom/gstgoom.c: (gst_goom_finalize): * gst/goom/lines.c: (goom_lines_free): * gst/goom/plugin_info.c: (plugin_info_init), (plugin_info_free): * gst/goom/surf3d.c: (grid3d_free): * gst/goom/surf3d.h: * gst/goom/tentacle3d.c: (tentacle_free): Free a bunch of stuff, and initialise things to fix leaks and valgrind warnings in the testsuite. Fixes: #529268