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 739886 - sharing: Prevent an endless loop and resulting stack overflow
sharing: Prevent an endless loop and resulting stack overflow
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-11-10 14:12 UTC by Rui Matos
Modified: 2014-11-13 10:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sharing: Prevent an endless loop and resulting stack overflow (1.33 KB, patch)
2014-11-10 14:12 UTC, Rui Matos
accepted-commit_now Details | Review
sharing: Prevent an endless loop and resulting stack overflow (1.26 KB, patch)
2014-11-12 19:28 UTC, Rui Matos
committed Details | Review

Description Rui Matos 2014-11-10 14:12:01 UTC
See https://bugzilla.redhat.com/show_bug.cgi?id=1161976 for a stack trace.
Comment 1 Rui Matos 2014-11-10 14:12:04 UTC
Created attachment 290346 [details] [review]
sharing: Prevent an endless loop and resulting stack overflow

We need to block ourselves or we end up in an endless loop when
setting the swtich state since we're the ::state-set handler.
Comment 2 Bastien Nocera 2014-11-12 10:05:57 UTC
Review of attachment 290346 [details] [review]:

"switch".

I didn't see that problem, funnily enough, but sure.
Comment 3 Rui Matos 2014-11-12 19:28:19 UTC
Created attachment 290540 [details] [review]
sharing: Prevent an endless loop and resulting stack overflow

We need to block ourselves around the gtk_switch_set_active() call or
we end up in an endless loop since we're the ::state-set handler.
--

(In reply to comment #2)
> I didn't see that problem, funnily enough, but sure.

In fact I didn't either, the documentation for GtkSwitch::state-set
even says that calling gtk_swtich_set_state() from the handler is the
right thing to do.

But today it occured to me that maybe it was the
gtk_switch_set_active() call in the error path that caused this so I
tried disabling the sharing plugin in g-s-d and yes now I can
reproduce this.

So, I moved the block/unblock to be just around the set_active() call
and it works fine now.
Comment 4 Bastien Nocera 2014-11-13 00:47:52 UTC
Review of attachment 290540 [details] [review]:

Just mention in which case the crash you're fixing happens in the commit message.

Thanks!
Comment 5 Rui Matos 2014-11-13 10:29:49 UTC
41230da..f5be9cc  gnome-3-14 -> gnome-3-14
   a91a607..7121f03  master -> master

Attachment 290540 [details] pushed as 7121f03 - sharing: Prevent an endless loop and resulting stack overflow