`gdk_x11_surface_get_xid` hard crashes on ubuntu 22.04

One of my users is reporting a crash on Ubuntu 22.04 when creating a Adw.Window.

This is the entirety of the stacktrace

[29233] signal (11.1): Segmentation fault
in expression starting at /home/ufechner/.julia/packages/mousetrap/FW8Qs/test/runtests.jl:2628
gdk_x11_surface_get_xid at /home/ufechner/.julia/artifacts/5498f875c31a1b3422ce1b64ef770407109eff30/lib/libgtk-4.so (unknown line)

This is on a regular desktop machine running X11, it only has one screen.

Does someone have an idea what this could be? Or at least how I would go to try to reproduce this? The same code is working for me on both of my linux machines.

Same problem here, for details see: On some Ubuntu 22.04 systems moustrap 0.2 crashes · Issue #25 · Clemapfel/Mousetrap.jl · GitHub

Are you sure that the code is running in an X11 session? Because the only way for gdk_x11_surface_get_xid() to crash is if you’re trying to get an XID out of a windowing system surface that is not an X11 one.

It could be you’re running on Wayland, or it could be that the object has been finalised and you’re trying to access some garbage.

In any case, you’ll have to run the code under GDB and get a proper backtrace. See: GettingInTouch/Bugzilla/GettingTraces - GNOME Wiki!

ufechner@ufryzen:~$ echo "$XDG_SESSION_TYPE"

How can I run the code under GDB?
Do I have to install additional debug packages, and if yes which?


gdb your-application

if you’re using an interpreted language you may need to use this, instead:

gdb --args the-interpreter the-file-that-acts-as-entry-point

Since it seems you’re going through a language binding, you will need to ask the binding developers to help you.

It depends on your platform/Linux distribution. You’ll need the debugging symbols for the various C dependencies; if you’re using Debian, Ubuntu, or Fedora, those packages are generally named with dbg or debug; if you’re using Arch, you’ll need to recompile everything after enabling the debugging symbols.

1 Like

I found out that it works when using the nouveau graphics driver and crashes when using nvidia-525 or nvidia-535 graphics driver, all with x11. Not a real solution, though, as there is no OpenGL acceleration with the nouveau driver…

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.