Gnome-shell-extension-gsconnect: High CPU usage

Created on 13 Nov 2018  Â·  26Comments  Â·  Source: GSConnect/gnome-shell-extension-gsconnect

After a moment, process gjs is constantly taking 100% of one CPU thread. When killing it, it relaunches gsconnect so I guess this is related.
Any idea?

needs info

Most helpful comment

I'd label this upstream, but I'm not sure this is related to the original report.

Agreed. I'm going to take advantage of GitHub's (relatively) new "Open new issue" option for issue comments, to peel @Dolland 's comment off as a separate issue of its own, and label _that_ one "upstream". I think it's prudent to file a bug with Audacious about this, referencing our bug. (I'll also start on that.)

All 26 comments

Are there any errors in GNOME Logs for that time? GSConnect is a gjs process, but I'm not aware of it causing high CPU usage, except in the case of system proxies.

I have the same issue with my laptop with Fedora 28. I believe it occurs since the v13 rewrite of the extension...

Output of journalctl /usr/bin/gnome-shell -f:

Nov 19 21:17:09 sprectre-fedora gnome-shell[2179]: clutter_text_get_editable: assertion 'CLUTTER_IS_TEXT (self)' failed Nov 19 21:17:09 sprectre-fedora gnome-shell[2179]: clutter_text_get_text: assertion 'CLUTTER_IS_TEXT (self)' failed Nov 19 21:17:09 sprectre-fedora gnome-shell[2179]: clutter_text_set_text: assertion 'CLUTTER_IS_TEXT (self)' failed Nov 19 21:17:09 sprectre-fedora gnome-shell[2179]: clutter_text_get_editable: assertion 'CLUTTER_IS_TEXT (self)' failed Nov 19 21:17:09 sprectre-fedora gnome-shell[2179]: clutter_text_get_text: assertion 'CLUTTER_IS_TEXT (self)' failed Nov 19 21:17:09 sprectre-fedora gnome-shell[2179]: clutter_text_set_text: assertion 'CLUTTER_IS_TEXT (self)' failed Nov 19 21:17:09 sprectre-fedora gnome-shell[2179]: clutter_text_get_editable: assertion 'CLUTTER_IS_TEXT (self)' failed Nov 19 21:17:09 sprectre-fedora gnome-shell[2179]: clutter_text_get_text: assertion 'CLUTTER_IS_TEXT (self)' failed Nov 19 21:17:09 sprectre-fedora gnome-shell[2179]: clutter_text_set_text: assertion 'CLUTTER_IS_TEXT (self)' failed [repeat every few seconds]

Are you experiencing high CPU usage for daemon.js or for gnome-shell?

The log you posted are assertion warnings from gnome-shell that shouldn't have any side-effects other than printing to the log. If they are, you should open a new issue for that.

To view the logs for the GSConnect service (daemon.js) you should inspect journalctl /usr/bin/gjs -f.

I'm sorry, the command I posted was the first thing when googling for getting gnome logs.

Currently, I don't experience the issue, so I can't give you details an what causes it exactly (will follow up once I get the spike again), but here is (part of) my log when running the command you gave me:

Logs from 19th to 20th of November

-- Logs begin at Sat 2018-08-18 16:57:16 CEST, end at Tue 2018-11-20 21:34:57 CET. --
Nov 19 10:19:03 sprectre-fedora gjs[2996]: JS ERROR: WaylandNotSupported
_init@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/plugins/mousepad.js:112:21
loadPlugin@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:772:26
loadPlugins@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:797:19
@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:881:2
Nov 19 10:19:03 sprectre-fedora gjs[2996]: JS ERROR: WaylandNotSupported
_init@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/plugins/mousepad.js:112:21
loadPlugin@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:772:26
loadPlugins@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:797:19
@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:881:2
Nov 19 10:19:03 sprectre-fedora gjs[2996]: g_variant_new_string: assertion 'string != NULL' failed
Nov 19 10:31:13 sprectre-fedora gjs[2996]: JS ERROR: Gio.IOErrorEnum: Error sending message: Network is unreachable
broadcast@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/lan.js:280:13
broadcast@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:185:21
activate@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:348:13
reconnect@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:207:17
@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:881:2
Nov 19 10:31:13 sprectre-fedora gjs[2996]: JS ERROR: Gio.IOErrorEnum: Error sending message: Network is unreachable
broadcast@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/lan.js:280:13
broadcast@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:185:21
activate@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:348:13
reconnect@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:207:17
@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:881:2
Nov 19 20:39:07 sprectre-fedora gjs[2996]: JS ERROR: Gio.IOErrorEnum: Error sending message: Network is unreachable
broadcast@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/lan.js:280:13
broadcast@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:185:21
activate@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:348:13
reconnect@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:207:17
@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:881:2
Nov 19 20:39:07 sprectre-fedora gjs[2996]: JS ERROR: Gio.IOErrorEnum: Error sending message: Network is unreachable
broadcast@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/lan.js:280:13
broadcast@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:185:21
activate@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:348:13
reconnect@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:207:17
@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:881:2
Nov 19 20:39:12 sprectre-fedora gjs[2996]: JS ERROR: Gio.IOErrorEnum: Error sending message: Network is unreachable
broadcast@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/lan.js:280:13
broadcast@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:185:21
activate@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:348:13
reconnect@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:207:17
@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:881:2
Nov 19 20:39:12 sprectre-fedora gjs[2996]: JS ERROR: Gio.IOErrorEnum: Error sending message: Network is unreachable
broadcast@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/lan.js:280:13
broadcast@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:185:21
activate@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:348:13
reconnect@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:207:17
@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:881:2
Nov 19 20:39:13 sprectre-fedora gjs[2996]: JS WARNING: [/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/core.js 169]: reference to undefined property "GSocketOutputStream"
Nov 19 20:39:13 sprectre-fedora gjs[2996]: WARNING: znert-manjaro: Unsupported packet type (kdeconnect.mousepad.keyboardstate)
Nov 19 20:39:20 sprectre-fedora gnome-documents[6406]: Failed to load shared library 'libgdprivate-1.0.so' referenced by the typelib: libgdprivate-1.0.so: cannot open shared object file: No such file or directory
Nov 19 20:39:20 sprectre-fedora gnome-documents[6406]: JS ERROR: GLib.Error g-invoke-error-quark: Could not locate gd_filename_strip_extension: libgdprivate-1.0.so: cannot open shared object file: No such file or directory
Nov 19 20:39:20 sprectre-fedora gnome-documents[6406]: JS ERROR: GLib.Error g-invoke-error-quark: Could not locate gd_filename_strip_extension: (null)
Nov 19 20:39:20 sprectre-fedora gnome-documents[6406]: JS ERROR: GLib.Error g-invoke-error-quark: Could not locate gd_filename_strip_extension: (null)
Nov 19 20:39:20 sprectre-fedora gnome-documents[6406]: JS ERROR: GLib.Error g-invoke-error-quark: Could not locate gd_filename_strip_extension: (null)
Nov 19 20:39:20 sprectre-fedora gnome-documents[6406]: JS ERROR: GLib.Error g-invoke-error-quark: Could not locate gd_filename_strip_extension: (null)
Nov 19 20:39:20 sprectre-fedora gnome-documents[6406]: JS ERROR: GLib.Error g-invoke-error-quark: Could not locate gd_filename_strip_extension: (null)
Nov 19 20:46:29 sprectre-fedora gjs[9060]: JS ERROR: WaylandNotSupported
_init@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/plugins/mousepad.js:112:21
loadPlugin@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:772:26
loadPlugins@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:797:19
@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:881:2
Nov 19 20:46:29 sprectre-fedora gjs[9060]: JS ERROR: WaylandNotSupported
_init@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/plugins/mousepad.js:112:21
loadPlugin@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:772:26
loadPlugins@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:797:19
@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:881:2
Nov 19 20:46:29 sprectre-fedora gjs[9060]: JS ERROR: WaylandNotSupported
_init@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/plugins/mousepad.js:112:21
loadPlugin@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:772:26
_onDisabledPlugins/<@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:760:29
_onDisabledPlugins@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:760:9
@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:881:2
Nov 19 20:46:29 sprectre-fedora gjs[9060]: JS ERROR: WaylandNotSupported
_init@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/plugins/mousepad.js:112:21
loadPlugin@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:772:26
_onDisabledPlugins/<@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:760:29
_onDisabledPlugins@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:760:9
@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:881:2
Nov 19 20:46:29 sprectre-fedora gjs[9060]: g_variant_new_string: assertion 'string != NULL' failed
Nov 19 20:46:30 sprectre-fedora gjs[9060]: [113B blob data]
Nov 19 20:46:30 sprectre-fedora gjs[9060]: [53B blob data]
Nov 19 20:46:30 sprectre-fedora gjs[9060]: JS WARNING: [/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/plugins/contacts.js 163]: reference to undefined property "ENCODING"
Nov 19 20:55:53 sprectre-fedora gjs[9060]: [113B blob data]
Nov 19 20:55:53 sprectre-fedora gjs[9060]: [53B blob data]
Nov 19 21:00:29 sprectre-fedora gjs[11291]: JS ERROR: WaylandNotSupported
_init@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/plugins/mousepad.js:112:21
loadPlugin@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:772:26
loadPlugins@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:797:19
@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:881:2
Nov 19 21:00:29 sprectre-fedora gjs[11291]: JS ERROR: WaylandNotSupported
_init@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/plugins/mousepad.js:112:21
loadPlugin@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:772:26
loadPlugins@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:797:19
@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:881:2
Nov 19 21:00:29 sprectre-fedora gjs[11291]: g_variant_new_string: assertion 'string != NULL' failed
Nov 19 21:00:36 sprectre-fedora gjs[11291]: WARNING: Simons Nokia: sftp: fuse: mountpoint is not empty
Nov 19 21:00:36 sprectre-fedora gjs[11291]: WARNING: Simons Nokia: sftp: fuse: if you are sure this is safe, use the 'nonempty' mount option
Nov 19 21:12:45 sprectre-fedora gjs[11291]: JS WARNING: [/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/core.js 169]: reference to undefined property "GSocketOutputStream"
Nov 19 21:15:12 sprectre-fedora gnome-documents[6406]: JS ERROR: GLib.Error g-invoke-error-quark: Could not locate gd_filename_strip_extension: (null)
Nov 19 21:15:12 sprectre-fedora gnome-documents[6406]: JS ERROR: GLib.Error g-invoke-error-quark: Could not locate gd_filename_strip_extension: (null)
Nov 19 21:15:12 sprectre-fedora gnome-documents[6406]: JS ERROR: GLib.Error g-invoke-error-quark: Could not locate gd_filename_strip_extension: (null)
Nov 19 21:15:12 sprectre-fedora gnome-documents[6406]: JS ERROR: GLib.Error g-invoke-error-quark: Could not locate gd_filename_strip_extension: (null)
Nov 19 21:18:08 sprectre-fedora gnome-documents[6406]: JS ERROR: GLib.Error g-invoke-error-quark: Could not locate gd_filename_strip_extension: (null)
Nov 19 21:18:08 sprectre-fedora gnome-documents[6406]: JS ERROR: GLib.Error g-invoke-error-quark: Could not locate gd_filename_strip_extension: (null)
Nov 19 21:18:08 sprectre-fedora gnome-documents[6406]: JS ERROR: GLib.Error g-invoke-error-quark: Could not locate gd_filename_strip_extension: (null)
Nov 19 21:18:08 sprectre-fedora gnome-documents[6406]: JS ERROR: GLib.Error g-invoke-error-quark: Could not locate gd_filename_strip_extension: (null)
Nov 19 21:18:28 sprectre-fedora gjs[15239]: JS ERROR: WaylandNotSupported
_init@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/plugins/mousepad.js:112:21
loadPlugin@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:772:26
loadPlugins@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:797:19
@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:881:2
Nov 19 21:18:28 sprectre-fedora gjs[15239]: JS ERROR: WaylandNotSupported
_init@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/plugins/mousepad.js:112:21
loadPlugin@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:772:26
loadPlugins@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:797:19
@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:881:2
Nov 19 21:18:28 sprectre-fedora gjs[15239]: g_variant_new_string: assertion 'string != NULL' failed
Nov 19 21:18:29 sprectre-fedora gjs[15239]: WARNING: znert-manjaro: Unsupported packet type (kdeconnect.mousepad.keyboardstate)
Nov 19 21:18:29 sprectre-fedora gjs[15239]: [113B blob data]
Nov 19 21:18:29 sprectre-fedora gjs[15239]: [53B blob data]
Nov 19 21:19:55 sprectre-fedora gjs[15239]: GtkDialog mapped without a transient parent. This is discouraged.
Nov 19 21:19:59 sprectre-fedora gjs[15239]: WARNING: znert-manjaro: ID_REGEX.exec(...) is null
Nov 19 21:20:03 sprectre-fedora gjs[15239]: WARNING: znert-manjaro: ID_REGEX.exec(...) is null
Nov 19 21:21:49 sprectre-fedora gjs[15239]: GtkDialog mapped without a transient parent. This is discouraged.
Nov 19 21:25:53 sprectre-fedora gnome-documents[6406]: JS ERROR: GLib.Error g-invoke-error-quark: Could not locate gd_filename_strip_extension: (null)
Nov 19 21:25:53 sprectre-fedora gnome-documents[6406]: JS ERROR: GLib.Error g-invoke-error-quark: Could not locate gd_filename_strip_extension: (null)
Nov 19 21:25:53 sprectre-fedora gnome-documents[6406]: JS ERROR: GLib.Error g-invoke-error-quark: Could not locate gd_filename_strip_extension: (null)
Nov 19 21:25:53 sprectre-fedora gnome-documents[6406]: JS ERROR: GLib.Error g-invoke-error-quark: Could not locate gd_filename_strip_extension: (null)
Nov 19 21:32:45 sprectre-fedora gjs[15239]: [113B blob data]
Nov 19 21:32:45 sprectre-fedora gjs[15239]: [53B blob data]
Nov 19 21:35:29 sprectre-fedora gjs[15239]: JS WARNING: [/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/core.js 169]: reference to undefined property "GSocketOutputStream"
Nov 19 21:35:29 sprectre-fedora gjs[15239]: WARNING: znert-manjaro: Unsupported packet type (kdeconnect.mousepad.keyboardstate)
Nov 19 22:44:05 sprectre-fedora gjs[15239]: gvc_mixer_stream_get_port: assertion 'stream->priv->ports != NULL' failed
Nov 19 22:44:05 sprectre-fedora gjs[15239]: gvc_mixer_stream_get_port: assertion 'stream->priv->ports != NULL' failed
Nov 19 22:45:26 sprectre-fedora gjs[15239]: gvc_mixer_stream_get_port: assertion 'stream->priv->ports != NULL' failed
Nov 19 22:45:26 sprectre-fedora gjs[15239]: gvc_mixer_stream_get_port: assertion 'stream->priv->ports != NULL' failed
Nov 19 22:45:32 sprectre-fedora gjs[15239]: gvc_mixer_stream_get_port: assertion 'stream->priv->ports != NULL' failed
Nov 19 22:45:32 sprectre-fedora gjs[15239]: gvc_mixer_stream_get_port: assertion 'stream->priv->ports != NULL' failed
Nov 19 22:45:54 sprectre-fedora gjs[15239]: gvc_mixer_stream_get_port: assertion 'stream->priv->ports != NULL' failed
Nov 19 22:50:25 sprectre-fedora gjs[15239]: gvc_mixer_stream_get_port: assertion 'stream->priv->ports != NULL' failed
Nov 19 22:50:49 sprectre-fedora gjs[15239]: gvc_mixer_stream_get_port: assertion 'stream->priv->ports != NULL' failed
Nov 19 22:51:13 sprectre-fedora gjs[15239]: gvc_mixer_stream_get_port: assertion 'stream->priv->ports != NULL' failed
Nov 19 22:51:15 sprectre-fedora gjs[15239]: gvc_mixer_stream_get_port: assertion 'stream->priv->ports != NULL' failed
Nov 19 22:51:37 sprectre-fedora gjs[15239]: gvc_mixer_stream_get_port: assertion 'stream->priv->ports != NULL' failed
Nov 19 22:51:39 sprectre-fedora gjs[15239]: gvc_mixer_stream_get_port: assertion 'stream->priv->ports != NULL' failed
Nov 19 22:57:22 sprectre-fedora gjs[15239]: gvc_mixer_stream_get_port: assertion 'stream->priv->ports != NULL' failed
Nov 19 22:57:24 sprectre-fedora gjs[15239]: gvc_mixer_stream_get_port: assertion 'stream->priv->ports != NULL' failed
Nov 19 22:58:15 sprectre-fedora gjs[15239]: JS ERROR: Gio.IOErrorEnum: Error sending message: Network is unreachable
broadcast@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/lan.js:280:13
_onNetworkChanged@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/lan.js:69:13
@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:881:2
Nov 20 21:18:05 sprectre-fedora gjs[15239]: JS ERROR: Gio.IOErrorEnum: Error sending message: Network is unreachable
broadcast@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/lan.js:280:13
broadcast@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:185:21
activate@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:348:13
reconnect@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:207:17
@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:881:2
Nov 20 21:18:10 sprectre-fedora gjs[15239]: JS ERROR: Gio.IOErrorEnum: Error sending message: Network is unreachable
broadcast@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/lan.js:280:13
broadcast@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:185:21
activate@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/device.js:348:13
reconnect@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:207:17
@/home/znert/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:881:2
```
End of log

Some of those errors should now be silenced in master, you might want to install this Zip:

[email protected]

There's actually a _whole_ lot of fixes in there that haven't made it to extensions.gnome.org. There are instructions in the Wiki for Installing from Zip if that's something you're up for, I'd recommend it.

Also i have this kind of problem when listening to music with Audacious.
I'm on Ubuntu 18.10
There is a screenshot of htop when listening to music:
image

And there is what "journalctl /usr/bin/gjs -f" returns:
dic 07 17:13:23 marco-Swift-SF314-51 gjs[1499]: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
dic 07 17:13:23 marco-Swift-SF314-51 gjs[1499]: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
dic 07 17:13:23 marco-Swift-SF314-51 gjs[1499]: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
dic 07 17:13:23 marco-Swift-SF314-51 gjs[1499]: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
dic 07 17:13:23 marco-Swift-SF314-51 gjs[1499]: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
dic 07 17:13:23 marco-Swift-SF314-51 gjs[1499]: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
dic 07 17:13:23 marco-Swift-SF314-51 gjs[1499]: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
dic 07 17:13:23 marco-Swift-SF314-51 gjs[1499]: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
dic 07 17:13:23 marco-Swift-SF314-51 gjs[1499]: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

Also i have this kind of problem when listening to music with Audacious.

I'm not so familiar with audacious, but it seems like the MPRIS plugin might be emitting position changes very frequently (https://github.com/audacious-media-player/audacious-plugins/blob/master/src/mpris2/plugin.cc#L170-L183):

static void update (void * object)
{
    int64_t pos = 0;
    int vol = 0;

    if (aud_drct_get_playing () && aud_drct_get_ready ())
        pos = (int64_t) aud_drct_get_time () * 1000;

    vol = aud_drct_get_volume_main ();

    g_signal_handlers_block_by_func (object, (void *) volume_changed, nullptr);
    g_object_set ((GObject *) object, "position", pos, "volume", (double) vol / 100, nullptr);
    g_signal_handlers_unblock_by_func (object, (void *) volume_changed, nullptr);
}

And (https://github.com/audacious-media-player/audacious-plugins/blob/master/src/mpris2/plugin.cc#L360):

timer_add (TimerRate::Hz4, update, object_player);

Compare this with the MPRIS Specification which says:

The org.freedesktop.DBus.Properties.PropertiesChanged signal is not emitted when this property changes.

Probably you should file an upstream report with audacious for this, and ask if these signals are being emitted over DBus.

~Audacity~ Audacious does indeed output PropertiesChanged updates on Position at the rate of approx. four per second when playing, on my system. Compared to mpdris2 (the MPRIS2 monitor for the MPD Music Player Daemon, and VLC, which only output messages for events like start, stop, seek, and song-change.

ETA: Audacious. I meant Audacious. (I always do that.)

Ah, yeah that's way to often, especially since it's actually microsecond measurement. The high cpu with GSConnect is because it's relaying each change to connected devices.

Generally only the Seeked() signal should be emitted and MPRIS clients should run their own "local" timer starting from Position, otherwise this kind of performance issue will happen for all clients. I'd label this upstream, but I'm not sure this is related to the original report.

I'd label this upstream, but I'm not sure this is related to the original report.

Agreed. I'm going to take advantage of GitHub's (relatively) new "Open new issue" option for issue comments, to peel @Dolland 's comment off as a separate issue of its own, and label _that_ one "upstream". I think it's prudent to file a bug with Audacious about this, referencing our bug. (I'll also start on that.)

Also High CPU usage issue here. While idle, the daemon.js process goes at 100% CPU for no obvious reason. When this happens, the configuration menu cannot be accessed (stuck on a loop probably). Kill the process, and everything goes back to normal (until it goes to 100% again).

Actual process command-line:

gjs /home/burdo/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js

Anything I can do to debug that? (never had to deal with gjs)

Can you provide any logs from journalctl or GNOME Logs from that period that might indicate what the problem is?

Ok, think I found something. Someone else at work has GSConnect installed, and I would see his laptop as one of the advertised device. Whenever I had the lockup, I would see some message related to this device trying to connect.

I tried removing the device from the list, but it would reappear on restart. I finally turned off "Discoverable", and removed the device manually using dconf-editor. No problems since.

I'm a bit confused though as why I would see someone else's laptop running GSConnect as being a device I should be able to connect to .... doesn't really make sense, no?

Yep, you can connect any device running a KDE Connect implementation to any other. Android, Sailfish, KDE Connect, GSConnect; they can all connect to each other.

Shouldn't cause a lockup though, unless your co-worker has a very old version of GSConnect or something.

Hey, I'm experiencing this issue as well. I thought updating to the latest version would fix things, but it hasn't. Attaching the log from when it happened to me just now

gsconnecterrors.txt

edit: I grepped the journalctl output for gsconnect, but the log has some more output for process 12970, most being the G_IS_OBJECT assertion failure, and the following few items:

ene 09 17:59:43 douwlaptop gjs[12970]: g_variant_new_string: assertion 'string != NULL' failed
ene 09 17:59:43 douwlaptop dbus-daemon[1824]: [session uid=1000 pid=1824] Connection :1.97 (uid=1000 pid=12970 comm="gjs /home/douwe/.local/share/gnome-shell/extension" label="unconfined") became a monitor.
ene 09 17:59:43 douwlaptop gjs[12970]: WARNING: ValueError: Namespace Folks not available
ene 09 18:03:26 douwlaptop gjs[12970]: g_object_unref: assertion 'G_IS_OBJECT (object)' failed`

@dgel

ene 09 17:59:43 douwlaptop gjs[12970]: WARNING: ValueError: Namespace Folks not available

That error makes me think that libfolks isn't present on your system (GSConnect uses it to pull in contacts from the local address book) — can you check whether the appropriate Folks packages for your distro are installed, and (if not) whether installing them makes a difference in the CPU usage?

@dgel It seems like from the log file you posted that you have installed this previously from GNOME Software:

gnome-software[4301]: State change on user/*/*/shell-extension/gsconnect_andyholmes.github.io/* from available to installed is not OK
...
ureadahead:/home/myuser/.local/share/gnome-shell/extensions/[email protected]/service/ui/packagekit.js: No such file or directory

This seems to indicate GNOME Software is interfering with the install process somehow. I would recommend you completely remove GSConnect using whatever means you originally installed it, then reinstall from this Zip:

[email protected]

rm -rf ~/.local/share/gnome-shell/extensions/[email protected]
unzip -o gsconnect.andyholmes.github.io.zip -d ~/.local/share/gnome-shell/extensions/gsconnect.andyholmes.github.io

You should then restart GNOME Shell.

Fwiw, I just started seeing this issue on Ubuntu 19.04. Re-installing from the aforementioned zipfile fixes the issue, but gnome-shell-extensions then prompts me to upgrade the extension (which then gives high CPU usage again).

Works for me too

I'm seeing this 100% CPU issue with gjs again with the latest gsconnect from git and gjs 1.55.92. It happened just now and in the gjs log there are many, many messages with the same timestamp saying:

JS ERROR: Error: 0x40000020 is not a valid value for flags GSocketMsgFlags
_onIncomingIdentity@/home/rocko/.local/share/gnome-shell/extensions/[email protected]/service/protocol/lan.js:199:24
@/home/rocko/.local/share/gnome-shell/extensions/[email protected]/service/daemon.js:744:2

JS ERROR: Error: 0x40000020 is not a valid value for flags GSocketMsgFlags

This is related to #468 and should be fixed in glib !710 and gobject-instrospection !141.

If I have understood correctly, both https://gitlab.gnome.org/GNOME/glib/merge_requests/710 and https://gitlab.gnome.org/GNOME/gobject-introspection/merge_requests/141 are mainly about removing an extra semicolon from the comment for g_socket_receive_messages_with_timeout, ie from "* @flags: (type GSocketMsgFlags): (inout):", aren't they? (Do the comments get parsed to figure out the arguments that get passed, then?) Or are there more changes that I have missed?

I checked gobject-introspection 1.60.0-1 and that semicolon is already removed; it's still present in libglib2 2.60.0-1, so I built and installed a version without the semi-colon, but I'm still seeing the 100% CPU issue in gjs, so I don't understand what's going on.

Quite apart from the bug in glib, though, isn't the gjs 100% CPU usage issue problem caused because gsconnect calls g_socket_receive_messages_with_timeout, which fails immediately, so gsconnect continually calls it? Is there an error returned that gsconnect could perhaps check for and report its own error rather than causing the 100% CPU problem?

If I have understood correctly, both https://gitlab.gnome.org/GNOME/glib/merge_requests/710 and https://gitlab.gnome.org/GNOME/gobject-introspection/merge_requests/141 are mainly about removing an extra semicolon from the comment for g_socket_receive_messages_with_timeout, ie from "* @flags: (type GSocketMsgFlags): (inout):", aren't they? (Do the comments get parsed to figure out the arguments that get passed, then?) Or are there more changes that I have missed?

Those comments aren't comments. If you look at that file gio-2.0.c in the gobject-introspection repository, the _entire_ contents of the file are nothing but those comment blocks, which contain the generated Gio introspection.

From the GObject Introspection "Overview" doc:

GObject introspection is a middleware layer between C libraries (using GObject) and language bindings. The C library can be scanned at compile time and generate metadata files, in addition to the actual native C library. Then language bindings can read this metadata and automatically provide bindings to call into the C library.

The comment blocks are the metadata which defines the Gio API for the language bindings.

isn't the gjs 100% CPU usage issue problem caused because gsconnect calls g_socket_receive_messages_with_timeout

No-ish. Actually all GSocket message related methods eventually call g_socket_receive_message_with_timeout() indirectly; they're all essentially wrappers around that core function. In GSConnect we would probably use g_socket_receive_message_from() to get the message and remote address in one go if we could, but the GSocket code is still pretty low-level and often requires pointers and structs that aren't really a thing in JavaScript.

We actually call g_socket_read_message() with the G_SOCKET_MSG_PEEK flag when the G_IO_IN condition (input available) triggers. So when we "peek" the data we're not waiting on data that can timeout, we're looking at data that is already waiting without consuming it (and ignoring it actually) so that we can grab the remote IP address as a side effect. We actually read the data later by wrapping the socket in a high-level stream.

The code in question is wrapped in a try-catch, so when the call to g_socket_receive_message() throws an error, there is still data waiting so the G_IO_IN condition triggers again. The only alternative is GSConnect bailing completely and ceasing to work at all.

@ferdnyc is correct about how GIR data is generated. I'm unsure how flags are mapped in memory (0x40000020) however the GJS docs list Gio.SocketMsgFlags.PEEK = 2, so you could try replacing that flag constant with the integer 2. These are actually the platform-level constants (eg. Linux, BSD), so that may work, but for that reason I'm not keen on using a literal number since this might not be 2 on non-Linux platforms like BSD.

In any case, this is a problem in the language bindings that I can't fix in GSConnect, but if you're sure you're running glib2 and gobject-introspection with those changes you should report that as soon as possible. Probably adding a comment on the closed GitLab issue from #468 or one the merge requests above would be the best way to get attention for this.

The possibility of an endless loop on G_IO_IN has been fixed in de32515. I've closed this issue since I believe it's now referred to several closed issues.

The introspection bug in glib2/gobject-introspection will still have to be fixed upstream before broadcasts can be properly received, which will probably prevent connecting to new devices.

Thanks, the latest gsconnect from git fixes the 100% cpu usage problem for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Noobsai picture Noobsai  Â·  4Comments

didierga picture didierga  Â·  5Comments

sk0gen picture sk0gen  Â·  4Comments

wada3n picture wada3n  Â·  7Comments

ricvelozo picture ricvelozo  Â·  4Comments