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 788110 - Extensions are disabled and reenabled repeatedly forever
Extensions are disabled and reenabled repeatedly forever
Status: RESOLVED OBSOLETE
Product: gnome-shell
Classification: Core
Component: extensions
3.24.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 786186 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2017-09-24 23:53 UTC by Daniel Playfair Cal
Modified: 2021-07-05 14:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add a check to see if "disable-extension-version-validation" has really changed its value before disabling and re enabling all extensions (1.00 KB, text/plain)
2017-09-24 23:53 UTC, Daniel Playfair Cal
  Details
Add a check to see if "disable-extension-version-validation" has really changed its value before disabling and re enabling all extensions (1.00 KB, patch)
2017-09-24 23:56 UTC, Daniel Playfair Cal
none Details | Review
Add SettingsListener for Gio.Settings to filter changed events where no changes occured (42.14 KB, patch)
2017-09-25 23:11 UTC, Daniel Playfair Cal
none Details | Review

Description Daniel Playfair Cal 2017-09-24 23:53:58 UTC
Created attachment 360325 [details]
Add a check to see if "disable-extension-version-validation" has really changed its value before disabling and re enabling all extensions

The code in extensionSystem.js that reloads all extensions when the "disable-extension-version-validation" key changes does not check whether the setting has actually changed (instead relying on the "changed" signal only being emitted when it has changed, while the docs only guarantee that it has potentially changed: disable-extension-version-validation).

For me this occurs in practice when I run gnome-shell inside valgrind with the TaskBar extension enabled. gnome-shell goes into an infinite loop of disabling and re-enabling all extensions and runs out of memory before starting successfully.
Comment 1 Daniel Playfair Cal 2017-09-24 23:56:55 UTC
Created attachment 360326 [details] [review]
Add a check to see if "disable-extension-version-validation" has really changed its value before disabling and re enabling all extensions

the gsettings "changed" signal being emitted does not guarantee that the relevant setting has in fact changed. This adds a check when the signal is emitted to see if it was actually changed before disabling and re enabling all extensions, in order to avoid infinite loops that result from it being done unecessarily.
Comment 2 Daniel Playfair Cal 2017-09-25 23:11:24 UTC
Created attachment 360394 [details] [review]
Add SettingsListener for Gio.Settings to filter changed events where no changes occured

The Gio.Settings "connect" event is dispatched when changes are made to settings. Unfortunately it also occurs at other times and the event  handler is expected to check that a relevant change has in fact occurred by reading the current value from the settings. This adds a convenience class called SettingsListener which automates the process of doing this and emits the same "changed" and       "changed::key" events only when the values have in fact changed.
Comment 3 Daniel Playfair Cal 2017-09-25 23:22:08 UTC
This patch is not really ready to go but its a proof of concept that fixes a number of problems besides this one:
 - Bug 782688, which is caused by an infinite loop resulting from these spurious "changed" events
 - Bug 786186, which can be caused by many of these types of bugs - for whatever reason there are much more spurious "changed" events when running in valgrind
 - I suspect a hang which I experience occasionally may also be caused by this issue

Although this patch fixes the problem, its a bit repetitive and counter intuitive to have to use a wrapper class instead of the regular Gio.Settings, or to have to always think about filtering out spurious "changed" events. I tend to think it would be better to patch either the GJS interface for Gio.Settings or GSettings to change the semantics of the "changed" event such that it is only dispatched when there actually is a change. This would be much simpler and would not require extensions to do the same thing (I had to do the same thing in two extensions in order to successfully start gnome-shell in valgrind).
Comment 4 Daniel Playfair Cal 2017-09-26 01:47:12 UTC
*** Bug 786186 has been marked as a duplicate of this bug. ***
Comment 5 GNOME Infrastructure Team 2021-07-05 14:11:23 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of  gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/

Thank you for your understanding and your help.