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 759708 - NetworkAgent: Fix double-unref in get_secrets_keyring_cb()
NetworkAgent: Fix double-unref in get_secrets_keyring_cb()
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 759707 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-12-20 20:35 UTC by Christophe Fergeau
Modified: 2016-03-22 07:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
NetworkAgent: Fix double-unref in get_secrets_keyring_cb() (1.02 KB, patch)
2015-12-20 20:35 UTC, Christophe Fergeau
committed Details | Review

Description Christophe Fergeau 2015-12-20 20:35:29 UTC
In get_secrets_keyring_cb, we own a ref on the 'attributes' hash table
from secret_item_get_attributes), and a ref on the 'secret' object (from
secret_item_get_secret(), but in the SHELL_KEYRING_SK_TAG case, we unref
these once before breaking out of the loop, and the second time after
breaking out of the loop.
Comment 1 Christophe Fergeau 2015-12-20 20:35:34 UTC
Created attachment 317704 [details] [review]
NetworkAgent: Fix double-unref in get_secrets_keyring_cb()
Comment 2 Christophe Fergeau 2015-12-20 20:36:06 UTC
*** Bug 759707 has been marked as a duplicate of this bug. ***
Comment 3 Florian Müllner 2015-12-20 20:55:00 UTC
Review of attachment 317704 [details] [review]:

LGTM
Comment 4 Christophe Fergeau 2016-01-07 14:29:10 UTC
Attachment 317704 [details] pushed as 021cecb - NetworkAgent: Fix double-unref in get_secrets_keyring_cb()
Comment 5 Christophe Fergeau 2016-01-07 16:04:47 UTC
If more 3.18 releases are planned, it would be worth applying it there as well.
Comment 6 Michael Catanzaro 2016-03-21 23:02:49 UTC
(In reply to Christophe Fergeau from comment #5)
> If more 3.18 releases are planned

Dunno

> it would be worth applying it there as
> well.

Done regardless. Debian unstable currently has a broken combination of libsecret 0.18.4 plus gnome-shell 3.18.4. I think we didn't hear yelling because they still have gnome-shell 3.18.1 in testing, which is strange, but it's Debian so whatever.
Comment 7 Frederic Peters 2016-03-21 23:25:34 UTC
> broken combination of libsecret 0.18.4 plus gnome-shell 3.18.4.

We released gnome-shell 3.18.[012] with libsecret 0.18.3 (according to http://ftp.acc.umu.se/pub/GNOME/teams/releng/3.18.[012]/versions); how did it happen that three micro stable versions made for a broken combination, and how would anyone know?
Comment 8 Michael Catanzaro 2016-03-22 04:45:29 UTC
(In reply to Frederic Peters from comment #7)
> how did
> it happen that three micro stable versions made for a broken combination,

We just got unlucky. Christophe fixed a refcounting error in libsecret (missing unref) which happened to expose a refcounting error (extra unref) in gnome-shell. It's pretty common and usually safe for developers to fix memory errors in stable branches, so I don't think anything went wrong here process-wise, besides that the patch in this bug should have been immediately backported.

Then we got extra unlucky, because we didn't do a libsecret update for Fedora, so this didn't hit the distro that most developers are using. Or you can say that is a good thing; the scope was limited. :)

> and how would anyone know?

In Endless, after a libsecret update, this was causing the shell to crash when activating a VPN connection. I don't know if the issue manifested in exactly the same way upstream, since our code is based on very old GNOME, but something must be crashing, or this bug wouldn't exist.
Comment 9 Michael Catanzaro 2016-03-22 04:46:26 UTC
(In reply to Michael Catanzaro from comment #8)
> Then we got extra unlucky, because we didn't do a libsecret update for
> Fedora, so this didn't hit the distro that most developers are using. Or you
> can say that is a good thing; the scope was limited. :)

To be clear, I think this only hit sid, Tumbleweed, and Arch.
Comment 10 Frederic Peters 2016-03-22 07:43:27 UTC
Thanks for the details.