Wlroots: GTK Dropdown Menu Crashes GTK Program

Created on 18 Feb 2020  路  13Comments  路  Source: swaywm/wlroots

Hello

Encountering an issue with GTK drop down menus in Sway specifically(haven't tried other wlroots based WMs/compositors). Raising this issue here as it doesn't appear to be tracked after the close of this issue from Sway:

https://github.com/swaywm/sway/issues/1577

When clicking the menu in gucharmap for example:

(gucharmap:828816): Gdk-CRITICAL **: 10:27:43.550: ../gtk/gdk/wayland/gdkdisplay-wayland.c:1399: Unable to create Cairo image surface: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
Segmentation fault (core dumped)

This is the only output I get from the app.

Only thing I could find in sway.log:

(gucharmap:1018596): Gdk-CRITICAL **: 11:03:11.280: ../gtk/gdk/wayland/gdkdisplay-wayland.c:1399: Unable to create Cairo image surface: invalid value (typically too big) for the size of the input (surface, pattern, etc.)
2020-02-18 11:03:11 - [sway/ipc-server.c:937] Added IPC reply of type 0x80000003 to client 75 queue: { "change": "close", "container": { "id": 20, "name": "Character Map", "rect": { "x": 25, "y": 63, "width": 2510, "height": 1352 }, "focused": true, "focus": [ ], "border": "pixel", "current_border_width": 6, "layout": "none", "orientation": "none", "percent": 1.0, "window_rect": { "x": 6, "y": 6, "width": 2498, "height": 1340 }, "deco_rect": { "x": 0, "y": 0, "width": 0, "height": 0 }, "geometry": { "x": 0, "y": 0, "width": 1440, "height": 810 }, "window": null, "urgent": false, "floating_nodes": [ ], "sticky": false, "type": "con", "fullscreen_mode": 0, "pid": 1018596, "app_id": "gucharmap", "visible": true, "marks": [ ], "max_render_time": 0, "nodes": [ ] } }

Works fine in X.
I do know from using it in X, the drop down extends past the window border. I'm assuming this is related to the "Cairo image surface"

In the referenced issue, it's stated that it will be fixed by wlroots, but that was about two years ago. Is this an abandoned/wontfix issue?
It's not imperative to my use of Sway/Wayland, just a nicety.

Possibly relevant env variables:

GDK_BACKEND=wayland
WINIT_UNIX_BACKEND=x11

Sway config snippet:

set $gnome-schema org.gnome.desktop.interface

exec_always {
    gsettings set $gnome-schema gtk-theme 'oomox-o3312090fucking'
    gsettings set $gnome-schema icom-theme 'oomox-Gredient'
    gsettings set $gnome-schema cursor-theme 'Adwaita'
    gsettings set $gnome-schema cursor-size 27
}

Let me know if you need anything else.

Thanks for all the work on this, it's been an amazing experience thus far.

sway --debug 2> sway.log:
http://ix.io/2c8K

WAYLAND_DEBUG=1 gucharmap &> gucharmap.log:
http://ix.io/2c8L

config:
http://ix.io/2c8P

bug

Most helpful comment

gucharmap is still crashing for me

All 13 comments

Your bug report is missing debug logs and your config file. Please add a link to the full debug log file and the config.

Can you run the app with WAYLAND_DEBUG=1 and post the app logs here?

@emersion Updated original post with the output from both of those.

Edit:
And the config.

[email protected](6, -74, 292, 23686)

The height is too big.

Can I do anything to assist further?
I confirmed that, in i3, the popup takes the entire height of the screen (1440px in this instance)

It would be interesting to try to see where this big value is coming from in wlroots.

Getting the same issue as @distek too

So this doesn't occur on any other device that I have, one of which is also running nouveau, and two that's on Intel integrated.

I assume that I have, at some point in the past, screwed something up related to this on this particular work station.

@isabelomakhanya , if you're still having this issue, update here and I can leave it open. Otherwise, I'll close it in about a week.

I can't reproduce this with gucharmap, but I did manage to reproduce this with glade, by testing a project that happened to have a GtkMenuBar inside it. Reproduction of this doesn't seem to be reliable; For some reason, I managed to reproduce it a couple of times, but soon after I wasn't able to reproduce it any more. What I have noticed though, is even now that it doesn't crash, the dropdown menus from the GtkMenuBar show up at the wrong location, which might somehow be related?

image

Edit: I have managed to reproduce the crash reliably again. When I floated the glade window, I've noticed that for some reason it ended up bigger than my screen. Once I shrank it down to a reasonable size, clicking on an element of the GtkMenuBar crashes glade every time. But, now that I have found a reliable test, I have also tested it in Weston.. And glade has crashed there, too. Therefore, this is either a bug in the Wayland libraries, a bug in GTK 3, or just a bug in glade.

@FreeFull Have you tested in other stand-alone GTK programs?

gucharmap is still crashing for me

Quick update on this: gucharmap seems to now be native wayland and thus works as expected.

@distek It has had wayland support for a long time. I tried two versions: 13.0.5 and latest master (0402e52d) - they are still crashing.

Could it be a bug in gucharmap; For me it used to crash, but currently it doesn't - the fonts drop-down menu appears as a black rectangle from the top to the bottom of the screen, and the following appears in the sway log:

00:09:30.502 [ERROR] [GLES2] GL_INVALID_VALUE in glTexImage2D(invalid width=293 or height=27868 or depth=1)
00:09:30.592 [ERROR] [GLES2] GL_INVALID_OPERATION in glTexSubImage2D(invalid texture level 0)

Although I can't see the font names, clicking on the rectangle selects an entry so the underlying drop down does work.

I tried running it under KDE (plasma-wayland) with WAYLAND_DEBUG=1, where it worked correctly, as well as under sway, and I'm attaching the two logs here - in both I clicked to activate the drop down, clicked on a random entry, and then closed the program from the "File" menu:

log-plasma.txt
log-sway.txt

Under plasma, it does [email protected](6, -29, 249, 1044) while under sway [email protected](6, -54, 279, 27854)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ferdi265 picture Ferdi265  路  5Comments

emersion picture emersion  路  5Comments

dcz-purism picture dcz-purism  路  5Comments

p-hamann picture p-hamann  路  4Comments

maletor picture maletor  路  4Comments