Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

GTK Dropdown Menu Crashes GTK Program #2032

Open
distek opened this issue Feb 18, 2020 · 15 comments
Open

GTK Dropdown Menu Crashes GTK Program #2032

distek opened this issue Feb 18, 2020 · 15 comments
Labels

Comments

@distek
Copy link

distek commented Feb 18, 2020

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:

swaywm/sway#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


wlroots has migrated to gitlab.freedesktop.org. This issue has been moved to:

https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/2032

@emersion
Copy link
Member

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?

@distek
Copy link
Author

distek commented Feb 19, 2020

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

Edit:
And the config.

@emersion
Copy link
Member

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

The height is too big.

@emersion emersion added the bug label Feb 19, 2020
@distek
Copy link
Author

distek commented Feb 19, 2020

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)

@emersion
Copy link
Member

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

@isabelomakhanya
Copy link

Getting the same issue as @distek too

@distek
Copy link
Author

distek commented Oct 3, 2020

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.

@FreeFull
Copy link

FreeFull commented Oct 3, 2020

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.

@distek
Copy link
Author

distek commented Oct 4, 2020

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

@koxu1996
Copy link

koxu1996 commented Oct 4, 2020

gucharmap is still crashing for me

@distek
Copy link
Author

distek commented Feb 20, 2021

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

@koxu1996
Copy link

@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.

@adia
Copy link

adia commented Feb 21, 2021

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)

@heyLu
Copy link

heyLu commented Oct 12, 2021

I had the same issue with DBeaver 21.2.2 on ArchLinux.

With WAYLAND_DEBUG=1 I also got a [email protected](144, -97, 254, 37574) in the logs which seems like the likely culprit.

On the application side the error is the following:

(DBeaver:107706): Gdk-CRITICAL **: 15:21:00.695: ../gtk/gdk/wayland/gdkdisplay-wayland.c:1403: Unable to create Cairo image surface: invalid value (typically too big) for the size of the input (surface, pattern, etc.)

The fix for me was setting GDK_BACKEND=x11 and then running dbeaver with that.

@joelazar
Copy link

I had the same with Firefox (93.0.1) today on arch. (wlroots 0.14.1-2 and sway 1:1.6.1-2)

(firefox:15): Gdk-CRITICAL **: 09:19:07.550: ../gtk/gdk/wayland/gdkdisplay-wayland.c:1403: Unable to create Cairo image surface: invalid value (typically too big) for the size of the input (surface, pattern, etc.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

8 participants