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 647763 - [bus] Bus is leaked if a watch is installed in the default main context
[bus] Bus is leaked if a watch is installed in the default main context
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal blocker
: 0.10.33
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-04-14 11:09 UTC by Sebastian Dröge (slomo)
Modified: 2011-04-18 10:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
diff (4.19 KB, patch)
2011-04-17 17:56 UTC, Sebastian Dröge (slomo)
rejected Details | Review

Description Sebastian Dröge (slomo) 2011-04-14 11:09:37 UTC
When running the gio unit test in -base (pipelines/gio) the bus is leaked. This happens because the bus watch (the GSource) is never finalized (although the main loop is) and it holds a reference of the bus.

I'm sure this didn't happen before, otherwise the leak in this test would have been noticed already.
Comment 1 Sebastian Dröge (slomo) 2011-04-14 11:30:19 UTC
the imagefreeze unit test in -good has the same leak... and many others too probably.
Comment 2 Sebastian Dröge (slomo) 2011-04-17 17:16:08 UTC
This should have happenend before, the source would always be reachable via the default main context and is never freed. Unfortunately my current valgrind version doesn't detect the source and the bus as reachable but as leak ;)

We should probably change all unit tests to detach the source before calling exit, as was done in some tests already
Comment 3 Sebastian Dröge (slomo) 2011-04-17 17:37:44 UTC
...but the "leak" goes away when reverting to GstBus from 0.10.32. Needs some more debugging it seems
Comment 4 Sebastian Dröge (slomo) 2011-04-17 17:56:11 UTC
Created attachment 186154 [details] [review]
diff

Reverting only this part of the changes between 0.10.32 and 0.10.32.2 makes the "leak" go away... I don't see anything wrong here.

Oh and it's not just because GstBus now stores a pointer to the default main context. Only storing a pointer to the default main context doesn't change anything.
Comment 5 Sebastian Dröge (slomo) 2011-04-18 07:10:11 UTC
And the bus source is not finalized with this patch either so it's just valgrind that for some reason believes that the bus is leaked now.
Comment 6 Sebastian Dröge (slomo) 2011-04-18 07:35:06 UTC
I'll just fix this in all tests now
Comment 7 Sebastian Dröge (slomo) 2011-04-18 10:04:32 UTC
Should be fixed in all tests now.