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 764662 - Simultaneous left and right mouse button press cause freeze
Simultaneous left and right mouse button press cause freeze
Status: RESOLVED FIXED
Product: libchamplain
Classification: Core
Component: view
unspecified
Other Linux
: Normal normal
: ---
Assigned To: libchamplain-maint
libchamplain-maint
Depends on:
Blocks:
 
 
Reported: 2016-04-05 21:25 UTC by Marius Stanciu
Modified: 2016-04-08 22:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
champlain-view: Add safety check to view_find_suitable_zoom function (1007 bytes, patch)
2016-04-05 21:27 UTC, Marius Stanciu
none Details | Review

Description Marius Stanciu 2016-04-05 21:25:59 UTC
To replicate, follow these exact steps( I tried it with gnome-maps and demos/launcher on Fedora):

(1) Press and hold the left mouse button on the map view

(2) While doing (1), press and hold right mouse button

(3) While doing (1) and (2), move mouse

(4) Enjoy freeze

From what I managed to debug, the freeze is caused by an infinite loop in
champlain-view.c: view_find_suitable_zoom

Apparently, the sequence of events described above is recognized as a ClutterZoomGesture. 
The "zoom" signal (https://developer.gnome.org/clutter/stable/ClutterZoomAction.html#ClutterZoomAction-zoom ) is picked up by the view, and the callback ends up calling view_find_suitable_zoom() with factor == inf (this causes the infinite loop)

This looks like a clutter bug to me, but I cannot find any info on it. What do you think?

Regardless, I've made a fix/workaround patch for it: it adds a safety check to the while condition. In my opinion this check should be there even if this proves to be a clutter bug.

Another fix would be to discard the event or treat it differently.
Comment 1 Marius Stanciu 2016-04-05 21:27:16 UTC
Created attachment 325455 [details] [review]
champlain-view: Add safety check to view_find_suitable_zoom function
Comment 2 Jiri Techet 2016-04-08 22:21:08 UTC
Thanks Marius, your patch looks like a good thing to do. I think I found the reason for the actual zooming problem - see the patch I've just committed.