GNOME Bugzilla – Bug 710185
grilo-inspect leaves empty directories in /tmp
Last modified: 2016-08-27 16:30:42 UTC
After running a few times a program that uses Grilo (like rhythmbox) you can see several empty grilo-plugin-cache-XXXXXX in the /tmp directory. This can be easily reproduced just by running grl-inspect, I get two new empty directories per execution.
*** This bug has been marked as a duplicate of bug 711393 ***
I don't think this is a duplicate of bug 711393. I cherry picked that patch and I still see two empty directories. I made a quick test removing plugins from their directory and it appears that the problems are in the raitv and tmdb plugins.
Seems to be raitv and bliptv for me.
Note that I just cherry picked that patch to the stable release, I guess I might be missing some other fix from master? Can you anyway reproduce the problem with the current master then?
Created attachment 266839 [details] [review] inspect: Cleanup on exit Otherwise plugins that have a cache will never clean up their temporary cache dirs.
The bug was in the inspect tool. If particular apps have the same problem, I would recommend pointing out that they should unload plugins themselves.
(In reply to comment #6) > The bug was in the inspect tool. Ah, cool, I'll try to test the patch asap and tell if you if I still see something wrong. Thanks for finding this!
The patch works perfectly, thanks again!
Thanks for the patch. This fix implies that all the applications must be patched to do an uninitialize process at the end. The fix I have in mind for this implies making the grl-net cache persistent, which will allow: - Reuse content cached between sessions - Do not fill the system with directories, but just a very few localized in the same place Both features are the same features you can find in any browser.
(In reply to comment #9) > Thanks for the patch. > > This fix implies that all the applications must be patched to do an > uninitialize process at the end. Or grl_deinit() implemented (see bug 675861) > The fix I have in mind for this implies making the grl-net cache persistent, > which will allow: That's completely orthogonal to cleaning up plugins when we're done with them. Objects are created when we instantiate the plugins, we should finalize the plugins when we're done. The patch does that.
(In reply to comment #10) > (In reply to comment #9) > > Thanks for the patch. > > > > This fix implies that all the applications must be patched to do an > > uninitialize process at the end. > > Or grl_deinit() implemented (see bug 675861) > Yes (didn't remind that bug). So this piece of code should run in that grl_deinit() function, and applications should invoke it.
Created attachment 268458 [details] [review] core: Add grl_deinit() function Quitting without cleanly unregistering sources and plugins can leave unfreed resources in the system. This happens specially with the sources that open or create temporal files, but as they are not cleanly unreffed the files are kept there. So we are adding grl_deinit() function, which should be called by the applications once they have finished to use Grilo. This function will cleanly unload all the sources and plugins.
Created attachment 268459 [details] [review] examples: call grl_deinit()
Created attachment 268460 [details] [review] grl-inspect: Call grl_deinit()
Created attachment 268461 [details] [review] test-ui: Call grl_deinit ()
Created attachment 268462 [details] [review] doc: Update TMDb example Call grl_deinit() at the end.
Created attachment 268463 [details] [review] tests: Invoke grl_deinit()
*** Bug 675861 has been marked as a duplicate of this bug. ***
commit acf670c92c908654e1b3cd3c437300b4621d02f8 Author: Juan A. Suarez Romero <jasuarez@igalia.com> Date: Fri Feb 7 21:30:25 2014 +0000 test-ui: Call grl_deinit () https://bugzilla.gnome.org/show_bug.cgi?id=710185 tools/grilo-test-ui/main.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) commit 2975d4788d503b1105151c51650b68c327f3f7af Author: Juan A. Suarez Romero <jasuarez@igalia.com> Date: Fri Feb 7 21:25:00 2014 +0000 grl-inspect: Call grl_deinit() https://bugzilla.gnome.org/show_bug.cgi?id=710185 tools/grilo-inspect/grl-inspect.c | 3 +++ 1 file changed, 3 insertions(+) commit ee153974cc762ac7baacb46869882a64a3e5c848 Author: Juan A. Suarez Romero <jasuarez@igalia.com> Date: Fri Feb 7 21:01:09 2014 +0000 examples: call grl_deinit() https://bugzilla.gnome.org/show_bug.cgi?id=710185 examples/browsing.c | 1 + examples/configuring-plugins.c | 2 ++ examples/efficient-metadata-resolution.c | 1 + examples/loading-plugins.c | 2 ++ examples/multivalues.c | 1 + examples/searching.c | 1 + 6 files changed, 8 insertions(+) commit 27fa2aa1f9201d4f0723afe43e90cd996876c999 Author: Juan A. Suarez Romero <jasuarez@igalia.com> Date: Fri Feb 7 20:47:32 2014 +0000 core: Add grl_deinit() function Quitting without cleanly unregistering sources and plugins can leave unfreed resources in the system. This happens specially with the sources that open or create temporal files, but as they are not cleanly unreffed the files are kept there. So we are adding grl_deinit() function, which should be called by the applications once they have finished to use Grilo. This function will cleanly unload all the sources and plugins. https://bugzilla.gnome.org/show_bug.cgi?id=710185 doc/grilo/grilo-sections.txt | 1 + src/grilo.c | 25 +++++++++++++++++++++++++ src/grilo.h | 2 ++ src/grl-registry.c | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------- 4 files changed, 125 insertions(+), 7 deletions(-)
commit 4e4c9606af8918b91f953950234177dced3a394b Author: Juan A. Suarez Romero <jasuarez@igalia.com> Date: Fri Feb 7 22:36:37 2014 +0000 tests: Invoke grl_deinit() https://bugzilla.gnome.org/show_bug.cgi?id=710185 tests/apple-trailers/test_apple_trailers.c | 13 +------------ tests/bliptv/test_bliptv.c | 13 +------------ tests/tmdb/test_tmdb_fast_resolution.c | 6 +++++- tests/tmdb/test_tmdb_fast_resolution_by_id.c | 6 +++++- tests/tmdb/test_tmdb_full_resolution.c | 6 +++++- tests/tmdb/test_tmdb_missing_configuration.c | 6 +++++- tests/tmdb/test_tmdb_preconditions.c | 6 +++++- tests/vimeo/test_vimeo.c | 13 +------------ 8 files changed, 28 insertions(+), 41 deletions(-) commit 89a150bbcae17bbd804b601676cadcfc3e7eb7a4 Author: Juan A. Suarez Romero <jasuarez@igalia.com> Date: Fri Feb 7 21:32:15 2014 +0000 doc: Update TMDb example Call grl_deinit() at the end. https://bugzilla.gnome.org/show_bug.cgi?id=710185 help/examples/example-tmdb.c | 5 +++++ 1 file changed, 5 insertions(+)
Created attachment 334244 [details] Too many grilo-plugin-cache-XXXXXX dirs in /tmp/ I am noticing this on the latest debian unstable. ii gir1.2-grilo-0.3:amd64 0.3.1-1 amd64 ii grilo-plugins-0.3:amd64 0.3.2-1 amd64 ii grilo-plugins-0.3-dbgsym:amd64 0.3.2-1 amd64 ii libgrilo-0.3-0:amd64 0.3.1-1 amd64 ii libgrilo-0.3-bin 0.3.1-1 amd64 ii libgrilo-0.3-dev:amd64 0.3.1-1 amd64
(In reply to vrishab from comment #21) > Created attachment 334244 [details] > Too many grilo-plugin-cache-XXXXXX dirs in /tmp/ > > I am noticing this on the latest debian unstable. > > ii gir1.2-grilo-0.3:amd64 0.3.1-1 amd64 > ii grilo-plugins-0.3:amd64 0.3.2-1 amd64 > ii grilo-plugins-0.3-dbgsym:amd64 0.3.2-1 amd64 > ii libgrilo-0.3-0:amd64 0.3.1-1 amd64 > ii libgrilo-0.3-bin 0.3.1-1 amd64 > ii libgrilo-0.3-dev:amd64 0.3.1-1 amd64 I can't reproduce it here, double check with git master if you have the same results and file a new bug for it.
(In reply to Victor Toso from comment #22) > (In reply to vrishab from comment #21) > > Created attachment 334244 [details] > > Too many grilo-plugin-cache-XXXXXX dirs in /tmp/ > > > > I am noticing this on the latest debian unstable. > > > > ii gir1.2-grilo-0.3:amd64 0.3.1-1 amd64 > > ii grilo-plugins-0.3:amd64 0.3.2-1 amd64 > > ii grilo-plugins-0.3-dbgsym:amd64 0.3.2-1 amd64 > > ii libgrilo-0.3-0:amd64 0.3.1-1 amd64 > > ii libgrilo-0.3-bin 0.3.1-1 amd64 > > ii libgrilo-0.3-dev:amd64 0.3.1-1 amd64 > > I can't reproduce it here, double check with git master if you have the same > results and file a new bug for it. This is a different issue. Filed https://bugzilla.gnome.org/show_bug.cgi?id=770486