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 581775 - Leak or crash, depending on the metadata getter
Leak or crash, depending on the metadata getter
Status: RESOLVED FIXED
Product: sound-juicer
Classification: Applications
Component: metadata
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Sound Juicer Maintainers
Sound Juicer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-05-07 17:51 UTC by Bastien Nocera
Modified: 2009-10-21 12:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sj-gvfs-crash-fix.patch (3.50 KB, patch)
2009-05-07 17:51 UTC, Bastien Nocera
none Details | Review

Description Bastien Nocera 2009-05-07 17:51:10 UTC
When none of the metadata getters can get metadata, and we fall back to gvfs, we crash. That's because the line:
  /* This will kill the albums, as
   * those belong to the metadata backend */
is a lie.

The only backend to do that is the gvfs one.

So all the backends were leaking if they found a match, but the gvfs one was crashing trying to free stuff :)

Valgrind trace at:
https://bugzilla.redhat.com/show_bug.cgi?id=498764#c5
and patch below.
Comment 1 Bastien Nocera 2009-05-07 17:51:53 UTC
Created attachment 134213 [details] [review]
sj-gvfs-crash-fix.patch
Comment 2 Bastien Nocera 2009-05-07 17:54:58 UTC
Oh, and this includes a warning fix in sj-main.c for free!
Comment 3 Bastien Nocera 2009-05-07 21:52:49 UTC
Turns out it wasn't quite enough, the metadata getter doesn't own the list of albums, the callback does.
Comment 4 Bastien Nocera 2009-05-07 21:55:35 UTC
commit 03bd66f0983a781305528d71a854e790b2b39924
Author: Bastien Nocera <hadess@hadess.net>
Date:   Thu May 7 22:48:29 2009 +0100

    Bug 581775 – Leak or crash, depending on the metadata getter
    
    Clarify ownership of the GLists of albums, and don't keep an
    unused cache in the GVFS backend.

commit d4b6249d494acbdcff001ff43072f504d187b19f
Author: Bastien Nocera <hadess@hadess.net>
Date:   Thu May 7 22:46:50 2009 +0100

    Fix warning on startup unref'ing the drive
    
    When the drive in GConf doesn't exist, don't try to unref it.