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 710185 - grilo-inspect leaves empty directories in /tmp
grilo-inspect leaves empty directories in /tmp
Status: RESOLVED FIXED
Product: grilo
Classification: Other
Component: general
0.2.x
Other Linux
: Normal normal
: ---
Assigned To: grilo-maint
grilo-maint
: 675861 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-10-15 13:15 UTC by Alberto Garcia
Modified: 2016-08-27 16:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
inspect: Cleanup on exit (1.18 KB, patch)
2014-01-21 08:42 UTC, Bastien Nocera
none Details | Review
core: Add grl_deinit() function (7.86 KB, patch)
2014-02-07 22:35 UTC, Juan A. Suarez Romero
committed Details | Review
examples: call grl_deinit() (2.53 KB, patch)
2014-02-07 22:35 UTC, Juan A. Suarez Romero
committed Details | Review
grl-inspect: Call grl_deinit() (718 bytes, patch)
2014-02-07 22:35 UTC, Juan A. Suarez Romero
committed Details | Review
test-ui: Call grl_deinit () (1.98 KB, patch)
2014-02-07 22:35 UTC, Juan A. Suarez Romero
committed Details | Review
doc: Update TMDb example (751 bytes, patch)
2014-02-07 22:41 UTC, Juan A. Suarez Romero
committed Details | Review
tests: Invoke grl_deinit() (4.98 KB, patch)
2014-02-07 22:41 UTC, Juan A. Suarez Romero
committed Details | Review
Too many grilo-plugin-cache-XXXXXX dirs in /tmp/ (16.15 KB, text/plain)
2016-08-26 21:08 UTC, gnome.vrb
  Details

Description Alberto Garcia 2013-10-15 13:15:41 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.
Comment 1 Bastien Nocera 2013-12-13 20:14:35 UTC

*** This bug has been marked as a duplicate of bug 711393 ***
Comment 2 Alberto Garcia 2014-01-19 21:47:00 UTC
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.
Comment 3 Bastien Nocera 2014-01-21 08:29:04 UTC
Seems to be raitv and bliptv for me.
Comment 4 Alberto Garcia 2014-01-21 08:39:41 UTC
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?
Comment 5 Bastien Nocera 2014-01-21 08:42:37 UTC
Created attachment 266839 [details] [review]
inspect: Cleanup on exit

Otherwise plugins that have a cache will never clean up their
temporary cache dirs.
Comment 6 Bastien Nocera 2014-01-21 08:45:33 UTC
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.
Comment 7 Alberto Garcia 2014-01-21 08:52:02 UTC
(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!
Comment 8 Alberto Garcia 2014-01-21 09:10:24 UTC
The patch works perfectly, thanks again!
Comment 9 Juan A. Suarez Romero 2014-01-22 09:08:17 UTC
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.
Comment 10 Bastien Nocera 2014-01-22 10:58:37 UTC
(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.
Comment 11 Juan A. Suarez Romero 2014-01-22 11:03:48 UTC
(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.
Comment 12 Juan A. Suarez Romero 2014-02-07 22:35:28 UTC
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.
Comment 13 Juan A. Suarez Romero 2014-02-07 22:35:38 UTC
Created attachment 268459 [details] [review]
examples: call grl_deinit()
Comment 14 Juan A. Suarez Romero 2014-02-07 22:35:48 UTC
Created attachment 268460 [details] [review]
grl-inspect: Call grl_deinit()
Comment 15 Juan A. Suarez Romero 2014-02-07 22:35:58 UTC
Created attachment 268461 [details] [review]
test-ui: Call grl_deinit ()
Comment 16 Juan A. Suarez Romero 2014-02-07 22:41:16 UTC
Created attachment 268462 [details] [review]
doc: Update TMDb example

Call grl_deinit() at the end.
Comment 17 Juan A. Suarez Romero 2014-02-07 22:41:26 UTC
Created attachment 268463 [details] [review]
tests: Invoke grl_deinit()
Comment 18 Bastien Nocera 2014-02-08 13:52:04 UTC
*** Bug 675861 has been marked as a duplicate of this bug. ***
Comment 19 Juan A. Suarez Romero 2014-02-09 02:02:08 UTC
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(-)
Comment 20 Juan A. Suarez Romero 2014-02-09 02:08:30 UTC
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(+)
Comment 21 gnome.vrb 2016-08-26 21:08:47 UTC
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
Comment 22 Victor Toso 2016-08-27 15:20:22 UTC
(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.
Comment 23 gnome.vrb 2016-08-27 16:30:42 UTC
(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