GNOME Bugzilla – Bug 769216
[places-menu extension] JS ERROR: Error: can't convert timestamp to an integer
Last modified: 2016-08-11 07:06:56 UTC
Currently observed in RHEL 7.2 Similar problem to https://git.gnome.org/browse/gnome-shell-extensions/commit/?id=dd620df6205e90dfb1e7cfb5c8be91fb72e027c9 but with the places-menu extension. Fix looks to be to change https://git.gnome.org/browse/gnome-shell-extensions/tree/extensions/places-menu/extension.js#n55 from ``` this._info.launch(event.get_time()); ``` to ``` this._info.launch(-1); ```
(In reply to Chris Daish from comment #0) > Fix looks to be to change > https://git.gnome.org/browse/gnome-shell-extensions/tree/extensions/places- > menu/extension.js#n55 > > from > > ``` > this._info.launch(event.get_time()); > ``` > > to > > ``` > this._info.launch(-1); > ``` That change doesn't look correct - unlike with the issue in the apps-menu extension, this parameter is expected to be a timestamp (see [0] and [1]). [0] https://git.gnome.org/browse/gnome-shell-extensions/tree/extensions/places-menu/placeDisplay.js#n47 [1] https://git.gnome.org/browse/gnome-shell/tree/src/shell-global.c#n1585
It looks like the timestamp might well be the cause of the issue, looking at /var/log/messages for a machine with 95 days uptime I get the following: gnome-shell: GNOME Shell started at Wed Jul 27 2016 09:34:59 GMT+0100 (BST) gnome-session: Gjs-Message: JS LOG: Timestamp arg: 3973305602 gnome-session: (gnome-shell:28180): Gjs-WARNING **: JS ERROR: Error: can't convert timestamp to an integer gnome-session: PlaceInfo<.launch@/usr/share/gnome-shell/extensions/places-menu@gnome-shell-extensions.gcampax.github.com/placeDisplay.js:47 gnome-session: wrapper@resource:///org/gnome/gjs/modules/lang.js:169 gnome-session: PlaceMenuItem<.activate@/usr/share/gnome-shell/extensions/places-menu@gnome-shell-extensions.gcampax.github.com/extension.js:55 gnome-session: wrapper@resource:///org/gnome/gjs/modules/lang.js:169 gnome-session: PopupBaseMenuItem<._onButtonReleaseEvent@resource:///org/gnome/shell/ui/popupMenu.js:118 gnome-session: wrapper@resource:///org/gnome/gjs/modules/lang.js:169 The timestamp value logged appears to be the system uptime in milliseconds. So at ~24.8 days, it passes the int32 limit and the problem starts to occur. Passing in a value of -1 does appear to resolve it, but as you suggest there may well be a better solution.
Created attachment 332213 [details] [review] global: Make timestamp parameter unsigned Negative values don't make sense to timestamps, and an unsigned timestamp as returned by shell_global_get_current_time() or Gdk/Clutter events may exceed the range of signed integers.
(In reply to Chris Daish from comment #2) > It looks like the timestamp might well be the cause of the issue > [...] > Passing in a value of -1 does appear to resolve it, but as you suggest there > may well be a better solution. I didn't want to imply that there was no issue, just that changing a parameter to an arbitrary constant like -1 isn't a proper fix. A uint32 value that is out of range of int32 does indeed look like the source of this issue, I attached a patch that should address this.
Thanks Florian, That looks like a much more sensible fix. Fully appreciate the workaround I provided was nothing more than a hack to resolve my issue locally. Chris
Review of attachment 332213 [details] [review]: could use guint32 to match the gdk api but looks good
Attachment 332213 [details] pushed as af5e65f - global: Make timestamp parameter unsigned