projecthamster / hamster-shell-extension

Shell extension for hamster
http://projecthamster.org
GNU General Public License v3.0
215 stars 91 forks source link

Gnome shell 3.30 compatibility #299

Closed hedayat closed 4 years ago

hedayat commented 5 years ago
philschenker commented 5 years ago

I tested this on gnome-shell 3.30.2 on a Manjaro (Arch-Linux). After this patch it isn't crashing anymore and working stable again.

mwilck commented 5 years ago

I can confirm that this looks really good. I've been fighting with gnome-shell dying after blanking the screen for weeks until I found this. Nitpick @hedayat: I guess this would be merged more easily if you'd provide a bit more verbose commit messages, explaining what you did, and why.

hedayat commented 5 years ago

Thanks for testing my patch.

@mwilck Sure, but lets see if there is anybody around willing to merge some PR! I'm afraid this repo is not maintained anymore. :(

mwilck commented 5 years ago

@mwilck Sure, but lets see if there is anybody around willing to merge some PR! I'm afraid this repo is not maintained anymore. :(

I can see that you're listed as hamster core developer yourself - can't you commit here? @elbenfreund seems to have left the project for good?

hedayat commented 5 years ago

No, I'm a contributor, since there was previous PRs of mine which was merged. But I'm not a core developer and don't have access to merge PRs.

matthijskooijman commented 5 years ago

I also just tried this repo on 3.30 (Ubuntu 18.10), with #302 applied to fix the compilation. I can confirm the problems that this PR fixes, and they are indeed fixed by this commit.

The first commit, about accessing controller.activities before its assigned, shows up in the log like this:

gnome-shell[12740]: JS WARNING: [/home/matthijs/.local/share/gnome-shell/extensions/contact@projecthamster.org/extension.js 223]: reference to undefined property "activities"
gnome-shell[12740]: ACTIVITIES HAMSTER: , 

I haven't dug into the exact cause, but I suspect there is some race condition here (that might have been present for longer, dunno). The fix present in this PR is to just remove controller.activities entirely, since it is only used for a debug print, which seems like a fair solution to me.

The second problem is a crash when the plugin is disabled, e.g. when blanking or locking the screen. This apparently tries to destroy two objects that are already destroyed, resulting in an error, stack trace and then a crash. See below for a full log. In the log, I see two different stacktraces, pointing to line 197 and 198:

https://github.com/projecthamster/hamster-shell-extension/blob/0d815b26ec2df0fe3c65ec5c614c416634e8d4c9/extension/extension.js#L197-L198

The fix applied by this PR is to simply remove those two destroy calls, which indeed seems to solve the problem. However, I'm not so sure this is really the right fix. Why does this crash happening in the first place? Is the disable ran twice, or is it ran before the enable is ran perhaps? Why was this not broken in earlier gnome-shell versions? At the very least, we should wonder if removing these lines to fix 3.30 might be breaking earlier versions (or at least cause memory leaks)? @hedayat, did you investigate this further?

I want to do a bit more debugging about what happens exactly, but since that involves crashing my gnome-shell to find out, I'm wrapping up this comment and will report in a follow-up later :-)

Here's the log snippet about the crash:

gnome-shell[11149]: Shutting down hamster-shell-extension.
gnome-shell[11149]: Object Shell.GenericContainer (0x56394ac3a850), has been already deallocated — impossible to access it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs.
org.gnome.Shell.desktop[11149]: == Stack trace for context 0x563947f231d0 ==
org.gnome.Shell.desktop[11149]: #0   7fffb732ea80 b   resource:///org/gnome/gjs/modules/overrides/GObject.js:468 (7f7a603cc040 @ 25)
org.gnome.Shell.desktop[11149]: #1   56394a8cea30 i   resource:///org/gnome/shell/ui/popupMenu.js:902 (7f7a33f274c0 @ 46)
org.gnome.Shell.desktop[11149]: #2   7fffb732f9f0 b   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #3   56394a8ce9a8 i   resource:///org/gnome/shell/ui/panelMenu.js:191 (7f7a33f79670 @ 53)
org.gnome.Shell.desktop[11149]: #4   7fffb7330960 b   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #5   56394a8ce920 i   /home/matthijs/.local/share/gnome-shell/extensions/contact@projecthamster.org/extension.js:198 (7f7a33b45430 @ 199)
org.gnome.Shell.desktop[11149]: #6   56394a8ce860 i   resource:///org/gnome/shell/ui/extensionSystem.js:83 (7f7a33f5a040 @ 436)
org.gnome.Shell.desktop[11149]: #7   56394a8ce7e0 i   resource:///org/gnome/shell/ui/extensionSystem.js:354 (7f7a33f5ab80 @ 13)
org.gnome.Shell.desktop[11149]: #8   7fffb7331ad0 b   self-hosted:261 (7f7a603c1dc0 @ 223)
org.gnome.Shell.desktop[11149]: #9   56394a8ce760 i   resource:///org/gnome/shell/ui/extensionSystem.js:353 (7f7a33f5aaf0 @ 64)
org.gnome.Shell.desktop[11149]: #10   56394a8ce6e0 i   resource:///org/gnome/shell/ui/extensionSystem.js:371 (7f7a33f5ac10 @ 87)
org.gnome.Shell.desktop[11149]: #11   7fffb7332c10 b   resource:///org/gnome/gjs/modules/signals.js:128 (7f7a603c18b0 @ 386)
org.gnome.Shell.desktop[11149]: #12   7fffb7333a60 b   resource:///org/gnome/shell/ui/sessionMode.js:208 (7f7a33d41ca0 @ 254)
org.gnome.Shell.desktop[11149]: #13   7fffb73346e0 b   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #14   56394a8ce4d0 i   resource:///org/gnome/shell/ui/sessionMode.js:170 (7f7a33d41a60 @ 40)
org.gnome.Shell.desktop[11149]: #15   7fffb7335660 b   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #16   56394a8ce428 i   resource:///org/gnome/shell/ui/screenShield.js:1282 (7f7a33d289d0 @ 188)
org.gnome.Shell.desktop[11149]: #17   7fffb7336dd0 b   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #18   56394a8ce378 i   resource:///org/gnome/shell/ui/screenShield.js:1331 (7f7a33d28a60 @ 391)
org.gnome.Shell.desktop[11149]: #19   56394a8ce2d0 i   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #20   56394a8ce248 i   resource:///org/gnome/shell/ui/shellDBus.js:371 (7f7a33d31d30 @ 67)
org.gnome.Shell.desktop[11149]: #21   56394a8ce1a0 i   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #22   56394a8ce0d8 i   resource:///org/gnome/gjs/modules/overrides/Gio.js:295 (7f7a603bd5e0 @ 604)
org.gnome.Shell.desktop[11149]: #23   56394a8ce030 i   resource:///org/gnome/gjs/modules/overrides/Gio.js:326 (7f7a603bd820 @ 34)
org.gnome.Shell.desktop[11149]: Window manager warning: Overwriting existing binding of keysym 69 with keysym 69 (keycode 1f).
org.gnome.Shell.desktop[11149]: Window manager warning: Trying to remove non-existent keybinding "show-hamster-dropdown".
gnome-shell[11149]: Shutting down hamster-shell-extension.
gnome-shell[11149]: Attempting to remove actor of type 'StBin' from group of class 'StBoxLayout', but the container is not the actor's parent.
gnome-shell[11149]: Source ID 6423 was not found when attempting to remove it
org.gnome.Shell.desktop[11149]: == Stack trace for context 0x563947f231d0 ==
org.gnome.Shell.desktop[11149]: #0   56394a173620 i   /home/matthijs/.local/share/gnome-shell/extensions/contact@projecthamster.org/extension.js:197 (7f7a33b45430 @ 179)
org.gnome.Shell.desktop[11149]: #1   56394a173560 i   resource:///org/gnome/shell/ui/extensionSystem.js:83 (7f7a33f5a040 @ 436)
org.gnome.Shell.desktop[11149]: #2   56394a1734e0 i   resource:///org/gnome/shell/ui/extensionSystem.js:354 (7f7a33f5ab80 @ 13)
org.gnome.Shell.desktop[11149]: #3   7fffb73308b0 b   self-hosted:261 (7f7a603c1dc0 @ 223)
org.gnome.Shell.desktop[11149]: #4   56394a173460 i   resource:///org/gnome/shell/ui/extensionSystem.js:353 (7f7a33f5aaf0 @ 64)
gnome-shell[11149]: Object Shell.GenericContainer (0x56394ac3a850), has been already deallocated — impossible to access it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs.
org.gnome.Shell.desktop[11149]: #5   56394a1733e0 i   resource:///org/gnome/shell/ui/extensionSystem.js:371 (7f7a33f5ac10 @ 87)
org.gnome.Shell.desktop[11149]: #6   7fffb73319f0 b   resource:///org/gnome/gjs/modules/signals.js:128 (7f7a603c18b0 @ 386)
org.gnome.Shell.desktop[11149]: #7   7fffb7332840 b   resource:///org/gnome/shell/ui/sessionMode.js:208 (7f7a33d41ca0 @ 254)
org.gnome.Shell.desktop[11149]: #8   7fffb73334c0 b   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #9   56394a1731d0 i   resource:///org/gnome/shell/ui/sessionMode.js:170 (7f7a33d41a60 @ 40)
org.gnome.Shell.desktop[11149]: #10   7fffb7334440 b   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #11   56394a173138 i   resource:///org/gnome/shell/ui/screenShield.js:1041 (7f7a33d27e50 @ 421)
org.gnome.Shell.desktop[11149]: #12   7fffb73353c0 b   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #13   56394a173090 i   resource:///org/gnome/shell/ui/screenShield.js:1285 (7f7a33d289d0 @ 223)
org.gnome.Shell.desktop[11149]: #14   7fffb7336340 b   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #15   56394a172fe0 i   resource:///org/gnome/shell/ui/screenShield.js:1331 (7f7a33d28a60 @ 391)
org.gnome.Shell.desktop[11149]: #16   7fffb7337ab0 b   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #17   56394a172f58 i   resource:///org/gnome/shell/ui/shellDBus.js:371 (7f7a33d31d30 @ 67)
org.gnome.Shell.desktop[11149]: #18   56394a172eb0 i   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #19   56394a172de8 i   resource:///org/gnome/gjs/modules/overrides/Gio.js:295 (7f7a603bd5e0 @ 604)
org.gnome.Shell.desktop[11149]: #20   56394a172d40 i   resource:///org/gnome/gjs/modules/overrides/Gio.js:326 (7f7a603bd820 @ 34)
org.gnome.Shell.desktop[11149]: == Stack trace for context 0x563947f231d0 ==
org.gnome.Shell.desktop[11149]: #0   56394a1737b8 i   resource:///org/gnome/gjs/modules/overrides/GObject.js:468 (7f7a603cc040 @ 25)
org.gnome.Shell.desktop[11149]: #1   56394a173730 i   resource:///org/gnome/shell/ui/popupMenu.js:902 (7f7a33f274c0 @ 46)
org.gnome.Shell.desktop[11149]: #2   7fffb732e7d0 b   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #3   56394a1736a8 i   resource:///org/gnome/shell/ui/panelMenu.js:191 (7f7a33f79670 @ 53)
org.gnome.Shell.desktop[11149]: #4   7fffb732f740 b   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #5   56394a173620 i   /home/matthijs/.local/share/gnome-shell/extensions/contact@projecthamster.org/extension.js:198 (7f7a33b45430 @ 199)
org.gnome.Shell.desktop[11149]: #6   56394a173560 i   resource:///org/gnome/shell/ui/extensionSystem.js:83 (7f7a33f5a040 @ 436)
org.gnome.Shell.desktop[11149]: #7   56394a1734e0 i   resource:///org/gnome/shell/ui/extensionSystem.js:354 (7f7a33f5ab80 @ 13)
org.gnome.Shell.desktop[11149]: #8   7fffb73308b0 b   self-hosted:261 (7f7a603c1dc0 @ 223)
org.gnome.Shell.desktop[11149]: #9   56394a173460 i   resource:///org/gnome/shell/ui/extensionSystem.js:353 (7f7a33f5aaf0 @ 64)
org.gnome.Shell.desktop[11149]: #10   56394a1733e0 i   resource:///org/gnome/shell/ui/extensionSystem.js:371 (7f7a33f5ac10 @ 87)
org.gnome.Shell.desktop[11149]: #11   7fffb73319f0 b   resource:///org/gnome/gjs/modules/signals.js:128 (7f7a603c18b0 @ 386)
org.gnome.Shell.desktop[11149]: #12   7fffb7332840 b   resource:///org/gnome/shell/ui/sessionMode.js:208 (7f7a33d41ca0 @ 254)
org.gnome.Shell.desktop[11149]: #13   7fffb73334c0 b   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #14   56394a1731d0 i   resource:///org/gnome/shell/ui/sessionMode.js:170 (7f7a33d41a60 @ 40)
org.gnome.Shell.desktop[11149]: #15   7fffb7334440 b   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #16   56394a173138 i   resource:///org/gnome/shell/ui/screenShield.js:1041 (7f7a33d27e50 @ 421)
gnome-shell[11149]: clutter_actor_destroy: assertion 'CLUTTER_IS_ACTOR (self)' failed
org.gnome.Shell.desktop[11149]: #17   7fffb73353c0 b   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #18   56394a173090 i   resource:///org/gnome/shell/ui/screenShield.js:1285 (7f7a33d289d0 @ 223)
org.gnome.Shell.desktop[11149]: #19   7fffb7336340 b   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #20   56394a172fe0 i   resource:///org/gnome/shell/ui/screenShield.js:1331 (7f7a33d28a60 @ 391)
org.gnome.Shell.desktop[11149]: #21   7fffb7337ab0 b   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #22   56394a172f58 i   resource:///org/gnome/shell/ui/shellDBus.js:371 (7f7a33d31d30 @ 67)
org.gnome.Shell.desktop[11149]: #23   56394a172eb0 i   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #24   56394a172de8 i   resource:///org/gnome/gjs/modules/overrides/Gio.js:295 (7f7a603bd5e0 @ 604)
org.gnome.Shell.desktop[11149]: #25   56394a172d40 i   resource:///org/gnome/gjs/modules/overrides/Gio.js:326 (7f7a603bd820 @ 34)
gnome-shell[11149]: Object Shell.GenericContainer (0x56394ac3a850), has been already deallocated — impossible to access it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs.
org.gnome.Shell.desktop[11149]: Window manager warning: Trying to remove non-existent keybinding "show-hamster-dropdown".
gnome-shell[11149]: Shutting down hamster-shell-extension.
gnome-shell[11149]: Attempting to remove actor of type 'StBin' from group of class 'StBoxLayout', but the container is not the actor's parent.
org.gnome.Shell.desktop[11149]: == Stack trace for context 0x563947f231d0 ==
org.gnome.Shell.desktop[11149]: #0   56394cb9dae8 i   /home/matthijs/.local/share/gnome-shell/extensions/contact@projecthamster.org/extension.js:197 (7f7a33b45430 @ 179)
org.gnome.Shell.desktop[11149]: #1   56394cb9da28 i   resource:///org/gnome/shell/ui/extensionSystem.js:83 (7f7a33f5a040 @ 436)
org.gnome.Shell.desktop[11149]: #2   56394cb9d9a8 i   resource:///org/gnome/shell/ui/extensionSystem.js:354 (7f7a33f5ab80 @ 13)
org.gnome.Shell.desktop[11149]: #3   7fffb7331b70 b   self-hosted:261 (7f7a603c1dc0 @ 223)
org.gnome.Shell.desktop[11149]: #4   56394cb9d928 i   resource:///org/gnome/shell/ui/extensionSystem.js:353 (7f7a33f5aaf0 @ 64)
gnome-shell[11149]: Source ID 6423 was not found when attempting to remove it
org.gnome.Shell.desktop[11149]: #5   56394cb9d8a8 i   resource:///org/gnome/shell/ui/extensionSystem.js:371 (7f7a33f5ac10 @ 87)
org.gnome.Shell.desktop[11149]: #6   7fffb7332cb0 b   resource:///org/gnome/gjs/modules/signals.js:128 (7f7a603c18b0 @ 386)
org.gnome.Shell.desktop[11149]: #7   7fffb7333b00 b   resource:///org/gnome/shell/ui/sessionMode.js:208 (7f7a33d41ca0 @ 254)
org.gnome.Shell.desktop[11149]: #8   7fffb7334780 b   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #9   56394cb9d690 i   resource:///org/gnome/shell/ui/sessionMode.js:177 (7f7a33d41af0 @ 100)
org.gnome.Shell.desktop[11149]: #10   7fffb7335ef0 b   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #11   56394cb9d5f8 i   resource:///org/gnome/shell/ui/screenShield.js:925 (7f7a33d27c10 @ 55)
org.gnome.Shell.desktop[11149]: #12   56394cb9d550 i   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #13   56394cb9d488 i   resource:///org/gnome/shell/ui/screenShield.js:963 (7f7a33d27ca0 @ 339)
org.gnome.Shell.desktop[11149]: #14   56394cb9d3e0 i   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #15   56394cb9d338 i   resource:///org/gnome/shell/ui/screenShield.js:1204 (7f7a33d288b0 @ 21)
org.gnome.Shell.desktop[11149]: #16   56394cb9d290 i   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #17   56394cb9d210 i   resource:///org/gnome/shell/ui/screenShield.js:1200 (7f7a33d28790 @ 73)
gnome-shell[11149]: Object Shell.GenericContainer (0x56394ac3a850), has been already deallocated — impossible to access it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs.
org.gnome.Shell.desktop[11149]: #18   56394cb9d168 i   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #19   56394cb9d0e0 i   /home/matthijs/.local/share/gnome-shell/extensions/disable-screenshield@lgpasquale.com/extension.js:13 (7f7a30679280 @ 98)
org.gnome.Shell.desktop[11149]: #20   56394cb9d020 i   self-hosted:979 (7f7a603f01f0 @ 440)
org.gnome.Shell.desktop[11149]: == Stack trace for context 0x563947f231d0 ==
org.gnome.Shell.desktop[11149]: #0   56394cb9dc80 i   resource:///org/gnome/gjs/modules/overrides/GObject.js:468 (7f7a603cc040 @ 25)
org.gnome.Shell.desktop[11149]: #1   56394cb9dbf8 i   resource:///org/gnome/shell/ui/popupMenu.js:902 (7f7a33f274c0 @ 46)
org.gnome.Shell.desktop[11149]: #2   7fffb732fa90 b   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #3   56394cb9db70 i   resource:///org/gnome/shell/ui/panelMenu.js:191 (7f7a33f79670 @ 53)
org.gnome.Shell.desktop[11149]: #4   7fffb7330a00 b   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #5   56394cb9dae8 i   /home/matthijs/.local/share/gnome-shell/extensions/contact@projecthamster.org/extension.js:198 (7f7a33b45430 @ 199)
org.gnome.Shell.desktop[11149]: #6   56394cb9da28 i   resource:///org/gnome/shell/ui/extensionSystem.js:83 (7f7a33f5a040 @ 436)
org.gnome.Shell.desktop[11149]: #7   56394cb9d9a8 i   resource:///org/gnome/shell/ui/extensionSystem.js:354 (7f7a33f5ab80 @ 13)
org.gnome.Shell.desktop[11149]: #8   7fffb7331b70 b   self-hosted:261 (7f7a603c1dc0 @ 223)
org.gnome.Shell.desktop[11149]: #9   56394cb9d928 i   resource:///org/gnome/shell/ui/extensionSystem.js:353 (7f7a33f5aaf0 @ 64)
org.gnome.Shell.desktop[11149]: #10   56394cb9d8a8 i   resource:///org/gnome/shell/ui/extensionSystem.js:371 (7f7a33f5ac10 @ 87)
org.gnome.Shell.desktop[11149]: #11   7fffb7332cb0 b   resource:///org/gnome/gjs/modules/signals.js:128 (7f7a603c18b0 @ 386)
org.gnome.Shell.desktop[11149]: #12   7fffb7333b00 b   resource:///org/gnome/shell/ui/sessionMode.js:208 (7f7a33d41ca0 @ 254)
org.gnome.Shell.desktop[11149]: #13   7fffb7334780 b   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #14   56394cb9d690 i   resource:///org/gnome/shell/ui/sessionMode.js:177 (7f7a33d41af0 @ 100)
org.gnome.Shell.desktop[11149]: #15   7fffb7335ef0 b   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #16   56394cb9d5f8 i   resource:///org/gnome/shell/ui/screenShield.js:925 (7f7a33d27c10 @ 55)
org.gnome.Shell.desktop[11149]: #17   56394cb9d550 i   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
kernel: traps: gnome-shell[11149] trap int3 ip:7f7a7e1959f5 sp:7fffb7339e50 error:0 in libglib-2.0.so.0.5800.1[7f7a7e15d000+7d000]
gnome-shell[11149]: clutter_actor_destroy: assertion 'CLUTTER_IS_ACTOR (self)' failed
org.gnome.Shell.desktop[11149]: #18   56394cb9d488 i   resource:///org/gnome/shell/ui/screenShield.js:963 (7f7a33d27ca0 @ 339)
org.gnome.Shell.desktop[11149]: #19   56394cb9d3e0 i   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #20   56394cb9d338 i   resource:///org/gnome/shell/ui/screenShield.js:1204 (7f7a33d288b0 @ 21)
org.gnome.Shell.desktop[11149]: #21   56394cb9d290 i   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #22   56394cb9d210 i   resource:///org/gnome/shell/ui/screenShield.js:1200 (7f7a33d28790 @ 73)
org.gnome.Shell.desktop[11149]: #23   56394cb9d168 i   resource:///org/gnome/gjs/modules/_legacy.js:82 (7f7a603b0b80 @ 71)
org.gnome.Shell.desktop[11149]: #24   56394cb9d0e0 i   /home/matthijs/.local/share/gnome-shell/extensions/disable-screenshield@lgpasquale.com/extension.js:13 (7f7a30679280 @ 98)
org.gnome.Shell.desktop[11149]: #25   56394cb9d020 i   self-hosted:979 (7f7a603f01f0 @ 440)
gnome-shell[11149]: Object Shell.GenericContainer (0x56394ac3a850), has been already deallocated — impossible to access it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs.
gnome-shell[11149]: Function IdleMonitorWatchFunc terminated with uncatchable exception
polkitd(authority=local)[1150]: Unregistered Authentication Agent for unix-session:8 (system bus name :1.1433, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
gnome-session[11053]: gnome-session-binary[11053]: WARNING: Application 'org.gnome.Shell.desktop' killed by signal 5
gnome-session-binary[11053]: WARNING: Application 'org.gnome.Shell.desktop' killed by signal 5
mwilck commented 5 years ago

I had a (rather superficial) look into a similar problem for the TopIcons plus extension recently. I believe the point is that in GNOME 3.30, destroying a parent (widget?) object destroys also the children of that object, and if these children are then explicitly destroyed by the extension, it comes down to a "double free". In earlier GNOME versions, it was necessary to destroy the children expllicitly.

At least this is my naïve understanding of the issue.

IMO it's a severe design problem of the GNOME shell that this kind of backward incompatibility of an extension may actually crash the shell.

matthijskooijman commented 5 years ago

@mwilck thanks for clarifying. That would suggest that we indeed need different handling for 3.30 and earlier versions...

I did a little bit of testing, and it indeed seems that the problem is not in a weird enable/disable flow. At startup, I'm seeing enable, deferred_enable (with just one of apiProxy and WindowsProxy defined, so nothing happens), deferred_enable (with both defined, so initialization runs). When locking, I just see one disable (this is with the fix applied, though).

What's interesting, though, is that the problem is in line 197/198, but the commit actually removes 196/197. Assuming that this.panelWidget.timeout and this.panelWidget.actor are both children of this.panelWidget, it actually makes sense to not destroy the former two, but do destroy the latter (in 3.30 at least). So, with that in mind, the fix in this PR is fine, except that it should only apply to 3.30 and up apparently. @mwilck, do you happen to have any reference to a commit or changelog entry for this change?

It's a bit weird that the actor.destroy() line also shows up in the log then, but looking at my log more closely it seems that disable() is called more than once. The first time, only panelWidget.destroy() errors out, but the second time panelWidget.actor.destroy() also fails. I suspect that gnome-shell might be retrying to disable the extension (possibly calling enable in between, but that defers, so does not clear any state right away).

It might be good to modify the disable function to not do anything when shouldEnable is true (other then setting it to false), to prevent a possible problem when enable is directly followed by disable (before enable_deferred has had a chance to run). This is something that's only marginally related to this bug, though.

mwilck commented 5 years ago

@mwilck, do you happen to have any reference to a commit or changelog entry for this change?

I can't find it any more, sorry. I'd seen something similar to what I wrote above for some other extension. Must have been something other than TopIcons plus though.

mwilck commented 5 years ago

FTR, this is the local change I made to TopIcons plus. Something has changed in Gst wrt object desctruction. That's all can say. Documentation is hard to come by.

hedayat commented 5 years ago

About the earlier versions, I don't know. But I think @rhertzog knows much better as according to #296 he had already fixed such things before and it was re-introduced.

I found #296 after creating this PR, which has things in common with this PR and might be enough for fixing the compatibility.

mwilck commented 4 years ago

Because GNOME shell 3.32 ff is incompatible with 3.30, we'll need to branch here. We should have a clean branch point if possible.

@hedayat, could you rebase this PR, to #325 after that's been merged, and also merge in the first 3 commits of #312, in particular aae8340, which is necessary for clean 3.30 support?

@projecthamster/gnome-shell-extension fellow maintainers, my strategy is to follow up with the other PRs one by one, so that we get a clean straight version history, with exactly one potential branch point on the develop branch for each stable GNOME version since 3.30. Please speak up if you object, or have a better idea.

hedayat commented 4 years ago

OK, I will. :)

mwilck commented 4 years ago

@hedayat, I created https://github.com/hedayat/hamster-shell-extension/pull/1 to try and speed up the process of getting this merged.

hedayat commented 4 years ago

@mwilck Merged, thanks. And sorry :P

mwilck commented 4 years ago

Thank you, @hedayat. As no other maintainer objected, and the two of us seem to agree that this PR is fine, let's get it merged.

benjaoming commented 4 years ago

Do we have the setup to build and release this version of the extension in Gnome Extensions? #312 removes 3.30 support, so would be good to distribute this beforehand?