GNOME Bugzilla – Bug 768111
Applications exit after "Error 71 (Protocol error) dispatching to Wayland display" while showing menu
Last modified: 2017-04-24 13:18:14 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
2. Firefox builds with Wayland Gdk backend behave similiar on showing any menu (!)
Bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1350060
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://firstname.lastname@example.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+.
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?
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.
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.
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/ ).
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.
(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.
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.
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)
Sorry, I did mean to close a different bug.
I have not seen this bug in a while. Firefox and Evolution got fixed.