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 765474 - Wayland: Dialogs without transient parent crash the inspector
Wayland: Dialogs without transient parent crash the inspector
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
3.20.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-04-23 19:05 UTC by Timm Bäder
Modified: 2016-04-26 12:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Testcase (102 bytes, text/plain)
2016-04-23 19:05 UTC, Timm Bäder
  Details
C code (489 bytes, text/plain)
2016-04-26 07:32 UTC, Olivier Fourdan
  Details
wayland: Clean up naming of GdkWaylandDisplay pointers (28.72 KB, patch)
2016-04-26 07:44 UTC, Jonas Ådahl
committed Details | Review
wayland: Track orphaned dialogs per display (4.26 KB, patch)
2016-04-26 07:44 UTC, Jonas Ådahl
committed Details | Review

Description Timm Bäder 2016-04-23 19:05:46 UTC
Created attachment 326602 [details]
Testcase

While it appears to be working, it will crash as soon as one tries to start the Inspector.
Comment 1 Olivier Fourdan 2016-04-26 07:32:31 UTC
Created attachment 326722 [details]
C code

I am not very familiar with vala (I think I even disable vala at build time because of some issues in the past) so I tried with this C code instead (which I reckon should be similar), when started with:

  GTK_DEBUG=interactive ./dialog

I get:

  (dialog:8492): Gdk-WARNING **: Error 22 (Invalid argument) dispatching to Wayland display.

Is that the same problem you have?

If so, it's a protocol error:

[1238417.613] xdg_surface@26.configure(957, 547, array, 121)
[1238417.634]  -> xdg_surface@26.set_window_geometry(26, 23, 957, 547)
[1238417.650]  -> xdg_surface@26.ack_configure(121)
[1238417.657]  -> xdg_surface@28.set_parent(xdg_surface@26)
[1238417.666] wl_keyboard@22.modifiers(123, 64, 0, 0, 0)
[1238417.690] wl_keyboard@22.enter(123, wl_surface@20, array)
[1238417.706] wl_data_device@18.selection(nil)
[1238417.717] gtk_primary_selection_device@17.selection(nil)
[1238417.967] wl_display@1.error(wl_display@1, 1, "invalid arguments for xdg_surface@28.set_parent")

(dialog:8595): Gdk-WARNING **: Error 22 (Invalid argument) dispatching to Wayland display.
Comment 2 Olivier Fourdan 2016-04-26 07:42:24 UTC
mutter (rightfully) complains because it doesn't "know" that object:

(gnome-shell:7781): mutter-WARNING **: WL: unknown object (26), message set_parent(?o)
Comment 3 Jonas Ådahl 2016-04-26 07:44:15 UTC
(In reply to Olivier Fourdan from comment #1)
> Created attachment 326722 [details]
> C code
> 
> I am not very familiar with vala (I think I even disable vala at build time
> because of some issues in the past) so I tried with this C code instead
> (which I reckon should be similar), when started with:
> 
>   GTK_DEBUG=interactive ./dialog
> 
> I get:
> 
>   (dialog:8492): Gdk-WARNING **: Error 22 (Invalid argument) dispatching to
> Wayland display.
> 
> Is that the same problem you have?

Yes indeed. I have a fix; one moment.
Comment 4 Jonas Ådahl 2016-04-26 07:44:42 UTC
Created attachment 326724 [details] [review]
wayland: Clean up naming of GdkWaylandDisplay pointers

The naming of pointers to GdkWaylandDisplay's were inconsistent.
Running the following commands in gtk+/gdk/wayland illustrate the
inconsistency:

$ grep -r '\<display_wayland\>' *.[ch] | wc -l
195
$ grep -r '\<wayland_display\>' *.[ch] | wc -l
81

This patch renames all occurrences of "wayland_display" to
"display_wayland". This is also consistent with naming in the X11
backend. A couple of whitespace changes were done as well in places
where the rename was already done, that added line breaks to long lines
that stood out.
Comment 5 Jonas Ådahl 2016-04-26 07:44:54 UTC
Created attachment 326725 [details] [review]
wayland: Track orphaned dialogs per display

Don't track all orphaned dialogs globally, as mixing them up with each
other would in most cases trigger errors when we try to pass bogus
values to Wayland requests.
Comment 6 Timm Bäder 2016-04-26 07:52:08 UTC
(In reply to Olivier Fourdan from comment #1)
> Created attachment 326722 [details]
> C code
> 
> I am not very familiar with vala (I think I even disable vala at build time
> because of some issues in the past) so I tried with this C code instead
> (which I reckon should be similar)

Sorry, that test case resulted as part of a much more complex one in vala,
I should have written a small C sample. That would've been similar to your C code, yes.
Comment 7 Carlos Garnacho 2016-04-26 11:16:32 UTC
Comment on attachment 326725 [details] [review]
wayland: Track orphaned dialogs per display

Makes sense.
Comment 8 Carlos Garnacho 2016-04-26 11:16:48 UTC
Comment on attachment 326724 [details] [review]
wayland: Clean up naming of GdkWaylandDisplay pointers

Conflicts will be funky with my local seat refactor branch, thanks for doing this anyway :), much needed.
Comment 9 Matthias Clasen 2016-04-26 12:38:45 UTC
Attachment 326724 [details] pushed as cb73bec - wayland: Clean up naming of GdkWaylandDisplay pointers
Attachment 326725 [details] pushed as 145b626 - wayland: Track orphaned dialogs per display