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 768111 - Applications exit after "Error 71 (Protocol error) dispatching to Wayland display" while showing menu
Applications exit after "Error 71 (Protocol error) dispatching to Wayland dis...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
3.20.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: WaylandRelated
 
 
Reported: 2016-06-27 19:46 UTC by Christian Stadelmann
Modified: 2017-04-24 13:18 UTC
See Also:
GNOME target: ---
GNOME version: 3.19/3.20


Attachments
Output of $ LC_ALL=C WAYLAND_DEBUG=1 libreoffice (259.43 KB, text/plain)
2016-06-29 07:55 UTC, Christian Stadelmann
Details
Output of $ LC_ALL=C WAYLAND_DEBUG=1 firefox (129.58 KB, text/plain)
2016-06-29 13:10 UTC, Christian Stadelmann
Details

Description Christian Stadelmann 2016-06-27 19:46:17 UTC
With Gtk+ 3.x applications running with a wayland Gdk backend I recently discovered an issue which exits applications in rare cases. They happen while/after showing a menu. Right before the application exits, it prints this warning

Gdk-WARNING **: Error 71 (Protocol error) dispatching to Wayland display.

from gdk/wayland/gdkeventsource.c:197. There are 2 cases I can reproduce:

1. In LibreOffice Impress, when using the "View" menu, in some cases it just exits after printing the warning added above.
Bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1343752#c7 
Backtrace: https://bugzilla.redhat.com/attachment.cgi?id=1172226

2. Firefox builds with Wayland Gdk backend behave similiar on showing any menu (!)
Bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1350060
Backtrace: https://bugzilla.redhat.com/attachment.cgi?id=1172224
Note that this doesn't work with default Firefox builds because they enforce using x11 as Gdk backend on linux. You have to use the builds from https://copr.fedorainfracloud.org/coprs/stransky/firefox-wayland/ instead. See this mailing list thread for details: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/54P3DQEOHXJQNUPUMHLA2GSQCWU4ZKXE/

I'm reporting this here because it happens in 2 very different applications and because a LibreOffice developer commented this would be an issue in Gtk+ in https://bugzilla.redhat.com/show_bug.cgi?id=1343752#c10

Despite using gnome+wayland heavily, this bug hasn't occurred to me anywhere else before so I guess it is either recently introduced or due to the special way how Firefox and LibreOffice use Gtk+.
Comment 1 Jonas Ådahl 2016-06-28 04:28:49 UTC
This could be related incorrect usage of xdg_shell. Could you attach the stderr output when reproducing while having the WAYLAND_DEBUG=1 environmental variable set?
Comment 2 Christian Stadelmann 2016-06-29 07:55:43 UTC
Created attachment 330535 [details]
Output of $ LC_ALL=C WAYLAND_DEBUG=1 libreoffice

I've attached the requested output of libreoffice with WAYLAND_DEBUG=1. Note that I had to click the menu several times (ca. 12) until the issue could be reproduced.
Comment 3 Jonas Ådahl 2016-06-29 08:10:56 UTC
As far as I can tell what is happening is that:

1. a popup is created with the toplevel window as parent
2. another popup is created while the previous popup is still mapped, also with the toplevel window as parent

This is not allowed, as the compositor wouldn't know what to dismiss when the popup grab is broken.

I'm guessing that either libreoffice is 1) missing to destroy an old menu, or 2) using the wrong parent for a child menu, or 3) it accidentally creates two popups when it meant to create only one.
Comment 4 Christian Stadelmann 2016-06-29 13:10:21 UTC
Created attachment 330575 [details]
Output of $ LC_ALL=C WAYLAND_DEBUG=1 firefox

Same log file for firefox (Build 47.0-8.wayland.fc24.x86_64, see https://copr.fedorainfracloud.org/coprs/stransky/firefox-wayland/package/firefox/ ).
Comment 5 Jonas Ådahl 2016-06-29 13:33:20 UTC
Firefox does the same; it tries to create two popups on top of the same toplevel, which isn't allowed. Maybe we should add debug messages and let gtk+ simply ignore such requests.
Comment 6 Christian Stadelmann 2016-06-29 13:42:21 UTC
(In reply to Jonas Ådahl from comment #5)
> Firefox does the same; it tries to create two popups on top of the same
> toplevel, which isn't allowed. Maybe we should add debug messages and let
> gtk+ simply ignore such requests.

Ok, so it is a downstream issue. Debug messages + ignoring these requests is probably the better way, since a library should not simply exit an application.
Comment 7 pierpaolo.vittorini 2016-12-16 11:50:57 UTC
The same bug also affects evolution-3.22.3-1.fc25.x86_64. Evolution crashes when I write an email address, and more precisely when auto-completes the email address through the address book.
Comment 8 Christian Stadelmann 2017-02-15 20:53:40 UTC
This bug is gone with Nightly builds for wayland, 52.0a1, BuildID 20170215004354, downloaded from https://firefox-flatpak.mojefedora.cz/ (created with build scripts from https://github.com/xhorak/firefox-devedition-flatpak)
Comment 9 Christian Stadelmann 2017-02-15 20:55:46 UTC
Sorry, I did mean to close a different bug.
Comment 10 Christian Stadelmann 2017-04-24 13:18:14 UTC
I have not seen this bug in a while. Firefox and Evolution got fixed.