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 692994 - Extensions with stylesheets crash the shell on screen unlock
Extensions with stylesheets crash the shell on screen unlock
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2013-02-01 11:26 UTC by Florian Müllner
Modified: 2013-02-01 16:30 UTC
See Also:
GNOME target: 3.8
GNOME version: ---


Attachments
st-theme: Add "custom-stylesheets-changed" signal (2.27 KB, patch)
2013-02-01 11:26 UTC, Florian Müllner
committed Details | Review
st-theme-node: Recalculate properties on stylesheet changes (2.06 KB, patch)
2013-02-01 11:26 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2013-02-01 11:26:30 UTC
This is a regression from commit dc2ec0a8f95baa (caching of StThemeNodes):

  - extension is enabled => stylesheet is loaded, properties are cached
                            in theme node
  - extension is disabled on lock => stylesheet is unloaded, but theme nodes
                                     are kept in cache (with cached properties
                                     now pointing to invalid memory)
  - extension is reenabled on unlock => stylesheet is loaded again, but cached
                                        theme nodes are reused
                                     => crash when accessing invalid memory
Comment 1 Florian Müllner 2013-02-01 11:26:33 UTC
Created attachment 234960 [details] [review]
st-theme: Add "custom-stylesheets-changed" signal

StThemeNodes cache matched properties from stylesheets, so when the
list of custom stylesheets changes, the node may miss better matches
(when a stylesheet was added) or have pointers to invalid memory in
the list (when a stylesheet was removed).
In order to allow theme nodes to listen for stylesheet changes, add
an appropriate signal to StTheme.
Comment 2 Florian Müllner 2013-02-01 11:26:37 UTC
Created attachment 234961 [details] [review]
st-theme-node: Recalculate properties on stylesheet changes

As theme nodes keep a cache of matched properties, we need to make
sure to update it when the list of stylesheets changes. In particular
this fixes a regression from commit dc2ec0a8f95baa, which caused
extensions with stylesheets to crash the shell when re-enabled (for
instances when coming back from the lock screen).
Comment 3 Rui Matos 2013-02-01 16:21:31 UTC
Review of attachment 234960 [details] [review]:

Ok
Comment 4 Rui Matos 2013-02-01 16:21:53 UTC
Review of attachment 234961 [details] [review]:

Looks good
Comment 5 Rui Matos 2013-02-01 16:22:39 UTC
Review of attachment 234961 [details] [review]:

::: src/st/st-theme-node.c
@@ +64,3 @@
+static void
+on_custom_stylesheets_changed (StTheme *theme,
+                        gpointer data)

Oh, forgot to ask you to fix this indentation, please do.
Comment 6 Florian Müllner 2013-02-01 16:30:06 UTC
Attachment 234960 [details] pushed as 2cf403a - st-theme: Add "custom-stylesheets-changed" signal
Attachment 234961 [details] pushed as 655dce6 - st-theme-node: Recalculate properties on stylesheet changes

Ha, could you tell that the method was originally called "on_stylesheets_changed"? Bloody last-minute adjustments ...