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 776220 - GTK applications crash when using touchscreen
GTK applications crash when using touchscreen
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: wayland
3.24.x
Other Linux
: High critical
: ---
Assigned To: mutter-maint
mutter-maint
: 774187 783960 786420 791830 795010 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-12-17 21:50 UTC by William Di Luigi
Modified: 2018-04-05 19:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wayland: Only send full sequences of touch events to clients (2.42 KB, patch)
2017-12-21 10:48 UTC, Carlos Garnacho
committed Details | Review

Description William Di Luigi 2016-12-17 21:50:05 UTC
To reproduce:

1) start up gnome shell with wayland backend
2) open a gtk application (evince, nautilus...)
3) touch the date in the upper bar, the calendar will show up
4) click on the gtk application you opened before (outside the calendar)
5) the application will crash

This is the stack trace when I do this with nautilus:

Stack trace of thread 587:
#0  0x00007f5eb69cce50 _create_touch_event (libgdk-3.so.0)
#1  0x00007f5eb69cd6d3 touch_handle_up (libgdk-3.so.0)
#2  0x00007f5eaf1471c8 ffi_call_unix64 (libffi.so.6)
#3  0x00007f5eaf146c2a ffi_call (libffi.so.6)
#4  0x00007f5eb10dd08e wl_closure_invoke (libwayland-client.so.0)
#5  0x00007f5eb10d9d20 dispatch_event (libwayland-client.so.0)
#6  0x00007f5eb10daf74 dispatch_queue (libwayland-client.so.0)
#7  0x00007f5eb69d7734 _gdk_wayland_display_queue_events (libgdk-3.so.0)
#8  0x00007f5eb6977169 gdk_display_get_event (libgdk-3.so.0)
#9  0x00007f5eb69d7422 gdk_event_source_dispatch (libgdk-3.so.0)
#10 0x00007f5eb52b2587 g_main_context_dispatch (libglib-2.0.so.0)
#11 0x00007f5eb52b27f0 n/a (libglib-2.0.so.0)
#12 0x00007f5eb52b289c g_main_context_iteration (libglib-2.0.so.0)
#13 0x00007f5eb586c54d g_application_run (libgio-2.0.so.0)
#14 0x00000000004293ba n/a (nautilus)
#15 0x00007f5eb49c9291 __libc_start_main (libc.so.6)
#16 0x000000000042941a n/a (nautilus)

This is when I do this with evince:

Stack trace of thread 1329:
#0  0x00007f2b232cc3dd touch_handle_motion (libgdk-3.so.0)
#1  0x00007f2b1bd551c8 ffi_call_unix64 (libffi.so.6)
#2  0x00007f2b1bd54c2a ffi_call (libffi.so.6)
#3  0x00007f2b1de6908e wl_closure_invoke (libwayland-client.so.0)
#4  0x00007f2b1de65d20 dispatch_event (libwayland-client.so.0)
#5  0x00007f2b1de66f74 dispatch_queue (libwayland-client.so.0)
#6  0x00007f2b232d2734 _gdk_wayland_display_queue_events (libgdk-3.so.0)
#7  0x00007f2b23272169 gdk_display_get_event (libgdk-3.so.0)
#8  0x00007f2b232d2422 gdk_event_source_dispatch (libgdk-3.so.0)
#9  0x00007f2b21dc2587 g_main_context_dispatch (libglib-2.0.so.0)
#10 0x00007f2b21dc27f0 n/a (libglib-2.0.so.0)
#11 0x00007f2b21dc289c g_main_context_iteration (libglib-2.0.so.0)
#12 0x00007f2b2237c54d g_application_run (libgio-2.0.so.0)
#13 0x000000000041ce1e n/a (evince)
#14 0x00007f2b214d9291 __libc_start_main (libc.so.6)
#15 0x000000000041cf4a n/a (evince)
Comment 1 William Di Luigi 2016-12-17 21:51:13 UTC
Correction: step 4 should say "touch" instead of "click", just like step 3. This issue only happens when using the touch screen.
Comment 2 Carlos Garnacho 2016-12-19 15:49:40 UTC
This is an inconsistency in mutter, the client receives wl_touch.motion with no prior wl_touch.down.
Comment 3 Strangiato 2017-03-30 15:13:12 UTC
I can confirm this crash on Arch running Gnome 3.24.
Comment 4 Volker Sobek (weld) 2017-04-27 20:54:11 UTC
*** Bug 774187 has been marked as a duplicate of this bug. ***
Comment 5 Volker Sobek (weld) 2017-04-27 21:01:16 UTC
This bug is still present in fedora 26. It crashes 100% reliably nautilus, gnome-terminal, evince, ... (by following the steps William described).

gtk3-3.22.12-2.fc26.x86_64
mutter-3.24.1-1.fc26.x86_64
Comment 6 Alexandre Franke 2017-05-07 16:27:45 UTC
Crash → major (not critical since there is a workaround, first clicking again on the menu to make it disappear).
Comment 7 Daniel Boles 2017-08-23 19:38:19 UTC
*** Bug 786420 has been marked as a duplicate of this bug. ***
Comment 8 Daniel Boles 2017-08-23 19:38:45 UTC
*** Bug 783960 has been marked as a duplicate of this bug. ***
Comment 9 Christian Persch 2017-09-14 09:40:33 UTC
(In reply to Alexandre Franke from comment #6)
> Crash → major (not critical since there is a workaround, first clicking
> again on the menu to make it disappear).

Crashes don't have 'workarounds', and the steps in comment 0 appear not to be the only way to trigger this crash, judging from downstream (in b.r.c) gnome-terminal bugs.
Comment 10 Alexandre Franke 2017-09-14 12:19:10 UTC
(In reply to Christian Persch from comment #9)
> Crashes don't have 'workarounds'

Definition from Wikipedia:
> A workaround is a bypass of a recognized problem in a system.

The crash occurs when one clicks directly on an application to get out of a Shell widget and back to the application. As stated in comment #6, if one first clicks again on the Shell menu to get out of it, the crash doesn’t happen which works around the identified problem.


> and the steps in comment 0 appear not to
> be the only way to trigger this crash, judging from downstream (in b.r.c)
> gnome-terminal bugs.

Could you please give links to or quote those downstream reports? Merely stating they exist isn’t really helpful.
Comment 11 Jonathan Briggs 2017-11-07 22:53:31 UTC
(In reply to Alexandre Franke from comment #10)

> Could you please give links to or quote those downstream reports? Merely
> stating they exist isn’t really helpful.

https://bugzilla.redhat.com/show_bug.cgi?id=1491510
Comment 12 Alban Browaeys 2017-11-10 19:36:02 UTC
This trace has more details, touch id value is zero.

gnome-shell/mutter/gnome-terminal 3.26.2
wayland-client 1.14.0
gtk3 3.22.25
glib 2.54.2

I am unable to reproduce the steps to this one. gnome-terminal was already running for a while and I was annoyed by the virtual keyboard constantly popping up. I closed it a few times, disabled it and somehow got this trace.


Thread 1 (Thread 0x7fc15c6b1a80 (LWP 17182))

  • #0 _create_touch_event
    at ../../../../../gdk/wayland/gdkdevice-wayland.c line 2332
  • #1 touch_handle_up
    at ../../../../../gdk/wayland/gdkdevice-wayland.c line 2451
  • #2 ffi_call_unix64
  • #3 ffi_call
  • #4 wl_closure_invoke
    at ../src/connection.c line 935
  • #5 dispatch_event
    at ../src/wayland-client.c line 1310
  • #6 dispatch_queue
    at ../src/wayland-client.c line 1456
  • #7 wl_display_dispatch_queue_pending
    at ../src/wayland-client.c line 1698
  • #8 wl_display_dispatch_pending
    at ../src/wayland-client.c line 1761
  • #9 _gdk_wayland_display_queue_events
    at ../../../../../gdk/wayland/gdkeventsource.c line 201
  • #10 gdk_display_get_event
    at ../../../../gdk/gdkdisplay.c line 438
  • #11 gdk_event_source_dispatch
    at ../../../../../gdk/wayland/gdkeventsource.c line 120
  • #12 g_main_dispatch
    at ../../../../glib/gmain.c line 3148
  • #13 g_main_context_dispatch
    at ../../../../glib/gmain.c line 3813
  • #14 g_main_context_iterate
    at ../../../../glib/gmain.c line 3886
  • #15 g_main_context_iteration
    at ../../../../glib/gmain.c line 3947
  • #16 g_application_run
    at ../../../../gio/gapplication.c line 2401
  • #17 0x0000558208feb80d in
  • #18 __libc_start_main
    at ../csu/libc-start.c line 291
  • #19 0x0000558208feb96a in

Comment 13 Strangiato 2017-12-21 09:12:45 UTC
*** Bug 791830 has been marked as a duplicate of this bug. ***
Comment 14 Carlos Garnacho 2017-12-21 10:48:23 UTC
Created attachment 365834 [details] [review]
wayland: Only send full sequences of touch events to clients

If input happens to be grabbed somewhere along the shell, and ungrabbed
while a touch operation is ongoing, the wayland bits will happily start
sending wl_touch.update events from an undeterminate point, without
clients having ever received wl_touch.down for that id.

Consider those touches grabbed for the entirety of their lifetime, if
wl_touch.down wasn't received by the client, no other events will.
Comment 15 Jonas Ådahl 2017-12-21 11:19:55 UTC
Review of attachment 365834 [details] [review]:

Looks correct to me.
Comment 16 Carlos Garnacho 2017-12-21 11:41:12 UTC
Thanks! Pushed to master and gnome-3-26

Attachment 365834 [details] pushed as 7980264 - wayland: Only send full sequences of touch events to clients
Comment 17 Christian Persch 2018-04-05 19:42:18 UTC
*** Bug 795010 has been marked as a duplicate of this bug. ***