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 719733 - tests: fix memory leak, free test's thread pool
tests: fix memory leak, free test's thread pool
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-rtsp-server
git master
Other All
: Normal normal
: 1.2.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-12-02 23:37 UTC by Sebastian Rasmussen
Modified: 2014-02-25 22:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch plugging memory leak in unit test (856 bytes, patch)
2013-12-02 23:38 UTC, Sebastian Rasmussen
none Details | Review
Proposed patch plugging memory leak in unit test (858 bytes, patch)
2013-12-03 00:03 UTC, Sebastian Rasmussen
committed Details | Review

Description Sebastian Rasmussen 2013-12-02 23:37:45 UTC
I was running the unit tests under valgrind like so:

GST_CHECKS=test_media_prepare,test_media_reset make -C tests/check/ gst/media.valgrind

only to find:

Running suite(s): rtspmedia
==13799== 128 (40 direct, 88 indirect) bytes in 1 blocks are definitely lost in loss record 3,318 of 3,497
==13799==    at 0x697D24A: g_type_create_instance (gtype.c:1846)
==13799==    by 0x6952801: g_object_new_internal (gobject.c:1746)
==13799==    by 0x6952FDA: g_object_newv (gobject.c:1890)
==13799==    by 0x6951F75: g_object_new (gobject.c:1556)
==13799==    by 0x4E539E9: gst_rtsp_thread_pool_new (rtsp-thread-pool.c:351)
==13799==    by 0x404B6D: test_media_reset (media.c:311)
==13799==    by 0x5FD1676: tcase_run_tfun_fork (check_run.c:372)
==13799==    by 0x5FD108D: srunner_iterate_tcase_tfuns (check_run.c:175)
==13799==    by 0x5FD1483: srunner_run_tcase (check_run.c:302)
==13799==    by 0x5FD0FA2: srunner_iterate_suites (check_run.c:150)
==13799==    by 0x5FD1CDA: srunner_run_all (check_run.c:561)
==13799==    by 0x5FC7C56: gst_check_run_suite (gstcheck.c:693)
==13799==    by 0x405472: main (media.c:365)
==13799== 
100%: Checks: 2, Failures: 0, Errors: 0

Then I examined the code and found another instance of the leak suprisingly not caught by valgrind. The attached patch plugs both memory leaks.
Comment 1 Sebastian Rasmussen 2013-12-02 23:38:22 UTC
Created attachment 263351 [details] [review]
Proposed patch plugging memory leak in unit test
Comment 2 Sebastian Rasmussen 2013-12-03 00:03:09 UTC
Created attachment 263355 [details] [review]
Proposed patch plugging memory leak in unit test
Comment 3 Tim-Philipp Müller 2013-12-03 00:09:35 UTC
Pushed, thanks:

 commit 26f215ac369bf82626d37b2d1856005ad4fddef7
 Author: Sebastian Rasmussen <sebras@gmail.com>
 Date:   Tue Dec 3 00:34:52 2013 +0100

    tests: fix memory leak, free test's thread pool
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=719733