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 769216 - [places-menu extension] JS ERROR: Error: can't convert timestamp to an integer
[places-menu extension] JS ERROR: Error: can't convert timestamp to an integer
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: extensions
3.14.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2016-07-27 10:23 UTC by Chris Daish
Modified: 2016-08-11 07:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
global: Make timestamp parameter unsigned (1.69 KB, patch)
2016-07-27 14:04 UTC, Florian Müllner
committed Details | Review

Description Chris Daish 2016-07-27 10:23:32 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);
```
Comment 1 Florian Müllner 2016-07-27 10:55:12 UTC
(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
Comment 2 Chris Daish 2016-07-27 11:57:45 UTC
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.
Comment 3 Florian Müllner 2016-07-27 14:04:45 UTC
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.
Comment 4 Florian Müllner 2016-07-27 14:11:42 UTC
(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.
Comment 5 Chris Daish 2016-07-27 14:49:26 UTC
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
Comment 6 Rui Matos 2016-08-10 15:47:31 UTC
Review of attachment 332213 [details] [review]:

could use guint32 to match the gdk api but looks good
Comment 7 Florian Müllner 2016-08-11 07:06:48 UTC
Attachment 332213 [details] pushed as af5e65f - global: Make timestamp parameter unsigned