Bug 2336326 - gtk4 apps fail to start on Xorg (was: gnome-abrt fails to launch in Cinnamon and Xfce (possibly others))
Summary: gtk4 apps fail to start on Xorg (was: gnome-abrt fails to launch in Cinnamon ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mesa
Version: rawhide
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Adam Jackson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: AcceptedFreezeException
Depends On:
Blocks: F42BetaFreezeException
TreeView+ depends on / blocked
 
Reported: 2025-01-08 03:12 UTC by Ian Laurie
Modified: 2025-02-23 17:34 UTC (History)
26 users (show)

Fixed In Version: mesa-24.3.4-4.fc42 mesa-25.0.0-2.fc42
Clone Of:
Environment:
Last Closed: 2025-02-23 17:34:25 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Screenshot showing the problem with ptyxis (763.96 KB, image/png)
2025-01-15 10:46 UTC, Mike FABIAN
no flags Details


Links
System ID Private Priority Status Summary Last Updated
GNOME Gitlab GNOME gtk issues 7346 0 None opened gtk 4.17 should not fall back to Vulkan for non-Wayland 2025-02-17 07:16:06 UTC

Description Ian Laurie 2025-01-08 03:12:34 UTC
gnome-abrt-1.5.0-1.fc42.x86_64 fails to launch in Rawhide with Cinnamon or Xfce desktop environments.  

It does launch in Budgie but the screen rendering is faulty, the top bar is a few mm wider than the window on the right hand side.

Reproducible: Always

Steps to Reproduce:
1. Try to launch "Problem Reporting" from the menu.
2.
3.
Actual Results:  
Something does happen but it is way too fast to see anything.

Expected Results:  
Used to work.

Running it from the console results in this:

rawhide$ gnome-abrt

(gnome-abrt:3382): Gdk-WARNING **: 14:08:43.153: The program 'gnome-abrt' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadRegion (invalid Region parameter)'.
  (Details: serial 845 error_code 140 request_code 139 (XFIXES) minor_code 11)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the GDK_SYNCHRONIZE environment
   variable to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
rawhide$ 

Note the error is the same with Xfce or Cinnamon.  Both systems fully up to date as of this report.

Comment 1 Jens Petersen 2025-01-15 09:41:25 UTC
gnome-text-editor also crashes (thanks mfabian)

Moving to gtk4 (not sure what the correct component is)

Comment 2 Mike FABIAN 2025-01-15 10:46:17 UTC
Created attachment 2066069 [details]
Screenshot showing the problem with ptyxis

ptyxis is also a Gtk4 program, it crashes in a Gnome Xorg session on rawhide.

Comment 3 Mike FABIAN 2025-01-15 10:50:02 UTC
mfabian@rawhide:~$ gnome-abrt

(gnome-abrt:1059325): Gdk-WARNING **: 10:39:20.749: The program 'gnome-abrt' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadRegion (invalid Region parameter)'.
  (Details: serial 1361 error_code 140 request_code 138 (XFIXES) minor_code 11)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the GDK_SYNCHRONIZE environment
   variable to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
mfabian@rawhide:~$ ptyxis

(ptyxis:1062197): Gdk-WARNING **: 11:47:23.269: The program 'ptyxis' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadRegion (invalid Region parameter)'.
  (Details: serial 1723 error_code 140 request_code 138 (XFIXES) minor_code 11)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the GDK_SYNCHRONIZE environment
   variable to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
mfabian@rawhide:~$ gnome-text-editor

(gnome-text-editor:1062331): GLib-CRITICAL **: 11:47:53.664: g_markup_escape_text: assertion 'text != NULL' failed

(gnome-text-editor:1062331): Gdk-WARNING **: 11:47:57.619: The program 'gnome-text-editor' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadRegion (invalid Region parameter)'.
  (Details: serial 1840 error_code 140 request_code 138 (XFIXES) minor_code 11)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the GDK_SYNCHRONIZE environment
   variable to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
mfabian@rawhide:~$ gtk4-demo
** Message: 11:49:17.765: For syntax highlighting, install the “highlight” program

(gtk4-demo:1062557): Gdk-WARNING **: 11:49:21.723: The program 'gtk4-demo' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadRegion (invalid Region parameter)'.
  (Details: serial 1170 error_code 140 request_code 138 (XFIXES) minor_code 11)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the GDK_SYNCHRONIZE environment
   variable to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
mfabian@rawhide:~$ rpm -q gtk4
gtk4-4.17.1-1.fc42.x86_64
mfabian@rawhide:~$

Comment 4 Mike FABIAN 2025-01-15 10:55:34 UTC
The same error occurs when using X forwarding via ssh.

Comment 5 Matthias Clasen 2025-01-15 16:29:10 UTC
Does this crash happen under Xwayland too? It doesn't, here.

Can we get a stacktrace?

Comment 6 Matthias Clasen 2025-01-15 16:31:41 UTC
And what are the versions of gtk4 and Xorg that are involved here?

Comment 7 Jens Petersen 2025-01-15 17:01:07 UTC
I just tested now with Fedora-Xfce-Live-Rawhide-20250115.n.0.x86_64.iso
and downgrading to gtk4-4.16.5-2.fc41 averts the crash, which suggests
it may be related to changes in GTK 4.17.

Current Rawhide has:
gtk4-4.17.2-1.fc42
xorg-x11-server-21.1.15-1.fc42 (same as F41, which no crash occurs)

Comment 8 Michael Catanzaro 2025-01-15 20:21:16 UTC
Guidance for taking a stack trace: https://handbook.gnome.org/issues/stack-traces.html

Don't forget to set the environment variable GDK_SYNCHRONIZE=1 when running the program, as instructed by the error message.

Comment 9 Matthias Clasen 2025-01-16 01:20:58 UTC
> xorg-x11-server-21.1.15-1.fc42

I just ran a couple of gtk4 apps with that very X server, without any obvious problems.

Comment 10 Jens Petersen 2025-01-16 09:59:17 UTC
A few more observation (from Rawhide XFCE):

Firstly I think apps are not crashing (ie there is no core dump) but the noted X11 error seems to occur every time.
The window does appear very briefly but then disappears when the error occurs.
So it seems a bit tricky to get a useful "trace", at least for me, though I tried stepping through in gdb from the initial gdk_x_error breakpoint.
Probably someone with more expertise and experience can do it more easily and quickly.

(BTW I couldn't reproduce the crash with the nightly ubuntu image.)

Perhaps some of the Xorg spins are missing some bits, I dunno - though mfabian also reproduced in Gnome Xorg,
but it could be the exact environment (ie package set) affects the reproducibility?

Anyway it is trivial to reproduce from the Rawhide XFCE Live Spin (instance or install).

Comment 11 Jens Petersen 2025-01-16 10:02:29 UTC
(In reply to Matthias Clasen from comment #5)
> Does this crash happen under Xwayland too?

Sorry, how to do that? ((The crash does not happen in Gnome Wayland, of course))

Comment 13 Olivier Fourdan 2025-01-16 10:50:49 UTC
From the error message, the error is a `BadRegion` error passed to a `XFixesSetRegion()` request (minor code 11 of XFIXES).

The backtrace seems to point at something completely unrelated, happening after an `XFlush()`.

Jens, did you have GDK_SYNCHRONIZE=1 set prior to capture that backtrace as instructed in comment 8?

Comment 14 Sudip Shil 2025-01-16 12:32:53 UTC
I tried downgrading gtk4. in gtk version 4.16.5, gtk4 apps are working in XFCE 
$ rpm -q gtk4 gtk4-devel gtk4-devel-tools
gtk4-4.16.5-1.fc42.x86_64
gtk4-devel-4.16.5-1.fc42.x86_64
gtk4-devel-tools-4.16.5-1.fc42.x86_64



version 4.17.0, 4.17.1, 4.17.2 seems to have a problem. Tested.

Comment 15 Jens Petersen 2025-01-16 12:43:53 UTC
(In reply to Olivier Fourdan from comment #13)
> Jens, did you have GDK_SYNCHRONIZE=1 set prior to capture that backtrace as
> instructed in comment 8?

Thank you, good catch - I think I might have gotten that time - let me recreate it :thanks:

Comment 16 Jens Petersen 2025-01-16 12:46:30 UTC
Updated bt with GDK_SYNCHRONIZE=1:

#0  gdk_x_error (xdisplay=0x555555c58520, error=0x7fffffffd6d0) at ../gdk/x11/gdkmain-x11.c:183
#1  0x00007ffff6850016 in _XError (dpy=dpy@entry=0x555555c58520, rep=rep@entry=0x55555a20bb20)
    at /usr/src/debug/libX11-1.8.10-2.fc42.x86_64/src/XlibInt.c:1494
#2  0x00007ffff685012f in handle_error (dpy=0x555555c58520, err=0x55555a20bb20, in_XReply=<optimized out>)
    at /usr/src/debug/libX11-1.8.10-2.fc42.x86_64/src/xcb_io.c:211
#3  0x00007ffff68501ed in handle_response (dpy=dpy@entry=0x555555c58520, response=0x55555a20bb20, 
    in_XReply=in_XReply@entry=1) at /usr/src/debug/libX11-1.8.10-2.fc42.x86_64/src/xcb_io.c:403
#4  0x00007ffff6851f7d in _XReply (dpy=0x555555c58520, rep=0x7fffffffd8d0, extra=0, discard=1)
    at /usr/src/debug/libX11-1.8.10-2.fc42.x86_64/src/xcb_io.c:722
#5  0x00007ffff6828258 in XGetGeometry (dpy=0x555555c58520, d=d@entry=37748740, root=root@entry=0x7fffffffd998, 
    x=x@entry=0x7fffffffd980, y=y@entry=0x7fffffffd984, width=width@entry=0x7fffffffd988, height=0x7fffffffd98c, 
    borderWidth=0x7fffffffd990, depth=0x7fffffffd994) at /usr/src/debug/libX11-1.8.10-2.fc42.x86_64/src/GetGeom.c:47
#6  0x00007ffff77b329e in gdk_x11_surface_get_geometry (surface=0x555557883c20, x=0x7fffffffda00, y=0x7fffffffda04, 
    width=0x7fffffffda08, height=0x7fffffffda0c) at ../gdk/x11/gdksurface-x11.c:2671
#7  gdk_x11_surface_get_geometry (surface=0x555557883c20, x=0x7fffffffda00, y=0x7fffffffda04, width=0x7fffffffda08, 
    height=0x7fffffffda0c) at ../gdk/x11/gdksurface-x11.c:2651
#8  0x00007ffff77e2ec5 in gdk_display_get_monitor_at_surface (display=0x555555c6ab60, surface=0x555557883c20)
    at ../gdk/gdkdisplay.c:2374
#9  0x00007ffff77b4f31 in compute_toplevel_size (surface=surface@entry=0x555557883c20, 
    update_geometry=update_geometry@entry=1, width=width@entry=0x7fffffffdb44, height=height@entry=0x7fffffffdb40)
    at ../gdk/x11/gdksurface-x11.c:261
#10 0x00007ffff77b5291 in compute_size_idle (user_data=user_data@entry=0x555557883c20) at ../gdk/x11/gdksurface-x11.c:382
#11 0x00007ffff7e9ffdd in g_idle_dispatch (source=0x555557867620, callback=0x7ffff77b5250 <compute_size_idle>, 
    user_data=0x555557883c20) at ../glib/gmain.c:6247
#12 0x00007ffff7e9978c in g_main_dispatch (context=0x555555c03160) at ../glib/gmain.c:3361
#13 g_main_context_dispatch_unlocked (context=0x555555c03160) at ../glib/gmain.c:4212
#14 0x00007ffff7efa778 in g_main_context_iterate_unlocked.isra.0 (context=context@entry=0x555555c03160, block=block@entry=1, 
    dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4277
#15 0x00007ffff7e9ac83 in g_main_context_iteration (context=context@entry=0x555555c03160, may_block=may_block@entry=1)
    at ../glib/gmain.c:4342
#16 0x00007ffff72e046d in g_application_run (application=0x555555bff2b0, argc=<optimized out>, argv=0x0)
--Type <RET> for more, q to quit, c to continue without paging--
    at ../gio/gapplication.c:2715
#17 0x00007ffff703f048 in __libc_start_call_main (main=main@entry=0x555555555590 <main>, argc=argc@entry=1, 
    argv=argv@entry=0x7fffffffdea8) at ../sysdeps/nptl/libc_start_call_main.h:58
#18 0x00007ffff703f10b in __libc_start_main_impl (main=0x555555555590 <main>, argc=1, argv=0x7fffffffdea8, 
    init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffde98)
    at ../csu/libc-start.c:360
#19 0x0000555555555635 in _start ()

Comment 19 Jens Petersen 2025-01-16 14:42:07 UTC
(I merged my backtrace without GDK_SYNCHRONIZE private to avoid confusion)

Comment 20 Sudip Shil 2025-01-16 14:59:43 UTC
tried debugging gtk4-demo
I pasted terminal outputs in a text file. maybe it can help.
textfile link: https://drive.google.com/file/d/175L6jndShwpY58731QRF8XR3fDCjAvvM/view?usp=sharing

----------------------------------------------------------------------------------------------------------------
Thread 1 "gtk4-demo" hit Breakpoint 1.1, gdk_x_error (xdisplay=0x555555cc5cd0, error=0x7fffffffdd30)
    at ../gdk/x11/gdkmain-x11.c:183
183	{
(gdb) bt full
#0  gdk_x_error (xdisplay=0x555555cc5cd0, error=0x7fffffffdd30) at ../gdk/x11/gdkmain-x11.c:183
        error_display = <optimized out>
        manager = <optimized out>
        displays = <optimized out>
        gdk_display = <optimized out>
        __inst = <optimized out>
        __t = <optimized out>
        __r = <optimized out>
#1  0x00007ffff684a016 in _XError (dpy=dpy@entry=0x555555cc5cd0, rep=rep@entry=0x555557a1aae0)
    at /usr/src/debug/libX11-1.8.10-2.fc42.x86_64/src/XlibInt.c:1494
        rtn_val = <optimized out>
        thread_info = {next = 0x0, error_thread = 140737315679808}
        prev = <optimized out>

-------------------------------------------------------------------------------------------------------------------
#2  0x00007ffff684a12f in handle_error (dpy=0x555555cc5cd0, err=0x555557a1aae0, in_XReply=<optimized out>)
    at /usr/src/debug/libX11-1.8.10-2.fc42.x86_64/src/xcb_io.c:211
        ext = <optimized out>
        ret_code = 32767
#3  0x00007ffff684a1ed in handle_response
    (dpy=dpy@entry=0x555555cc5cd0, response=0x555557a1aae0, in_XReply=in_XReply@entry=1)
    at /usr/src/debug/libX11-1.8.10-2.fc42.x86_64/src/xcb_io.c:403
        async = <optimized out>
        next = <optimized out>
#4  0x00007ffff684bf7d in _XReply (dpy=0x555555cc5cd0, rep=0x7fffffffdf30, extra=0, discard=1)
    at /usr/src/debug/libX11-1.8.10-2.fc42.x86_64/src/xcb_io.c:722
        event = <optimized out>
        req = 0x555559c7f010
        response = 0x7ffefc000b70
        xcb_xlib_threads_sequence_lost = <optimized out>
        error = 0x0
        c = <optimized out>
        reply = <optimized out>
        current = 0x555559c7f010
        dpy_request = <optimized out>
        __PRETTY_FUNCTION__ = "_XReply"
#5  0x00007ffff6822258 in XGetGeometry
    (dpy=0x555555cc5cd0, d=d@entry=20971524, root=root@entry=0x7fffffffdff8, x=x@entry=0x7fffffffdfe0, y=y@entry=0x7fffffffdfe4, width=width@entry=0x7fffffffdfe8, height=0x7fffffffdfec, borderWidth=0x7fffffffdff0, depth=0x7fffffffdff4)
    at /usr/src/debug/libX11-1.8.10-2.fc42.x86_64/src/GetGeom.c:47
        rep = {type = 1 '\001', depth = 0 '\000', sequenceNumber = 0, length = 0, root = 0, x = 0, y = 0, width = 57376, height = 65535, borderWidth = 32767, pad1 = 0, pad2 = 4159636892, pad3 = 32767}
        req = <optimized out>
#6  0x00007ffff77b329e in gdk_x11_surface_get_geometry
    (surface=0x555555d57000 [GdkX11Toplevel], x=0x7fffffffe060, y=0x7fffffffe064, width=0x7fffffffe068, height=0x7fffffffe06c) at ../gdk/x11/gdksurface-x11.c:2671
        impl = 0x555555d57000 [GdkX11Toplevel]
        root = 140737345788040
        tx = -8092
        twidth = 4294959208
        theight = 32767
        tborder_width = 4294959168
        child = 140737488347184
        ty = 32767
        tdepth = 32767
        impl = <optimized out>
        root = <optimized out>
        child = <optimized out>
        tx = <optimized out>
        ty = <optimized out>
        twidth = <optimized out>
        theight = <optimized out>
        tborder_width = <optimized out>
        tdepth = <optimized out>
#7  gdk_x11_surface_get_geometry
    (surface=0x555555d57000 [GdkX11Toplevel], x=0x7fffffffe060, y=0x7fffffffe064, width=0x7fffffffe068, height=0x7fffffffe06c) at ../gdk/x11/gdksurface-x11.c:2651
        impl = <optimized out>
        root = <optimized out>
        child = <optimized out>
        tx = <optimized out>
        ty = <optimized out>
        twidth = <optimized out>
        theight = <optimized out>
        tborder_width = <optimized out>
        tdepth = <optimized out>
#8  0x00007ffff77e2ec5 in gdk_display_get_monitor_at_surface
    (display=0x555555cd7ca0 [GdkX11Display], surface=0x555555d57000 [GdkX11Toplevel]) at ../gdk/gdkdisplay.c:2374
        win = {x = 1440067456, y = 21845, width = 0, height = 0}
        monitors = <optimized out>
        i = <optimized out>
        area = 0
        best = 0x0
        class = <optimized out>
        __func__ = "gdk_display_get_monitor_at_surface"
#9  0x00007ffff77b4f31 in compute_toplevel_size
    (surface=surface@entry=0x555555d57000 [GdkX11Toplevel], update_geometry=update_geometry@entry=1, width=width@entry=0x7fffffffe1a4, height=height@entry=0x7fffffffe1a0) at ../gdk/x11/gdksurface-x11.c:261
        impl = 0x555555d57000 [GdkX11Toplevel]
        display = <optimized out>
        monitor = <optimized out>
        size = {bounds_width = 40, bounds_height = 48, width = -7712, height = 32767, min_width = -7904, min_height = 32767, shadow = {is_valid = -1142828288, left = -58489985, right = -7680, top = 32767, bottom = -134746261}}
        bounds_width = <optimized out>
        bounds_height = <optimized out>
#10 0x00007ffff77b5291 in compute_size_idle (user_data=user_data@entry=0x555555d57000) at ../gdk/x11/gdksurface-x11.c:382
        surface = 0x555555d57000 [GdkX11Toplevel]
        impl = 0x555555d57000 [GdkX11Toplevel]
        width = 32767
        height = -7712
#11 0x00007ffff7e98fdd in g_idle_dispatch
    (source=0x555559aa45f0, callback=0x7ffff77b5250 <compute_size_idle>, user_data=0x555555d57000) at ../glib/gmain.c:6247
        idle_source = 0x555559aa45f0
        again = <optimized out>
#12 0x00007ffff7e9278c in g_main_dispatch (context=0x555555d5af80) at ../glib/gmain.c:3361
        dispatch = 0x7ffff7e98fb0 <g_idle_dispatch>
        prev_source = 0x0
        begin_time_nsec = 2698821346394
        was_in_call = 0
        user_data = 0x555555d57000
        callback = 0x7ffff77b5250 <compute_size_idle>
        cb_funcs = 0x7ffff7fa6280 <g_source_callback_funcs>
        cb_data = 0x555559aa4350
        need_destroy = <optimized out>
        source = 0x555559aa45f0
        current = 0x5555578f6710
        i = 0
        __func__ = {<optimized out> <repeats 16 times>}
#13 g_main_context_dispatch_unlocked (context=0x555555d5af80) at ../glib/gmain.c:4212
#14 0x00007ffff7ef3778 in g_main_context_iterate_unlocked.isra.0
    (context=context@entry=0x555555d5af80, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at ../glib/gmain.c:4277
        max_priority = -110
        timeout_usec = 0
        some_ready = 1
        nfds = <optimized out>
        allocated_nfds = <optimized out>
        fds = 0x55555798ede0
        begin_time_nsec = 2698821342880
#15 0x00007ffff7e93c83 in g_main_context_iteration (context=context@entry=0x555555d5af80, may_block=may_block@entry=1)
    at ../glib/gmain.c:4342
        retval = <optimized out>
#16 0x00007ffff72e046d in g_application_run
    (application=application@entry=0x555555cd9e10 [GtkApplication], argc=argc@entry=1, argv=argv@entry=0x7fffffffe5d8)
    at ../gio/gapplication.c:2715
        arguments = 0x5555578feda0
        status = 0
        context = 0x555555d5af80
        acquired_context = <optimized out>
        __func__ = "g_application_run"
#17 0x000055555555b06a in main (argc=1, argv=0x7fffffffe5d8) at ../demos/gtk-demo/main.c:1153
        app = 0x555555cd9e10 [GtkApplication]
        accels = {{action_and_target = 0x5555555c3a70 "app.about", accelerators = {0x5555555c3a7a "F1", 0x0}}, {action_and_target = 0x5555555c3a7d "app.quit", accelerators = {0x5555555c3a86 "<Control>q", 0x0}}}
        i = 2
        version = "4.17.2-devel\n", '\000' <repeats 11 times>, "\300\377\377\377\377\377\377\377\350\345\377\377\377\177\000\000\270h\300\367\377\177\000\000\220\344\377\377\377\177\000\000\0029\272\366\377\177\000\000\300\344\377\377\377\177\000\000\363+\272\366\377\177\000"
        app_entries = {{name = 0x5555555bc676 "about", activate = 0x55555558c520 <activate_about>, parameter_type = 0x0, state = 0x0, change_state = 0x0, padding = {0, 0, 0}}, {name = 0x5555555bc649 "quit", activate = 0x55555558c830 <activate_quit>, parameter_type = 0x0, state = 0x0, change_state = 0x0, padding = {0, 0, 0}}, {name = 0x5555555c4b8a "inspector", activate = 0x55555558c870 <activate_inspector>, parameter_type = 0x0, state = 0x0, change_state = 0x0, padding = {0, 0, 0}}}
(gdb) print *error
$1 = {type = 0, display = 0x555555cc5cd0, resourceid = 0, serial = 721, error_code = 140 '\214', request_code = 138 '\212', 
  minor_code = 11 '\v'}
(gdb) print xdisplay
$2 = (Display *) 0x555555cc5cd0

Comment 22 Olivier Fourdan 2025-01-16 15:09:04 UTC
Ah my bad, no, it's the return address !

Comment 23 Olivier Fourdan 2025-01-16 15:20:48 UTC
The backtraces show a different code path which does not include the original error with XFixesSetRegion(), but that is not entirely surprising considering we are now running synchronously.

The backtraces, unfortunately, do not show the actual XError, could you please also provide the error message when run with GDK_SYNCHRONIZE=1 (but without gdb)?

(FWIW, I just tried both apps with GTK from the main branch from git upstream, with xfce running in Xwayland rootful and with GDK_BACKEND=x11 with GNOME Shell and cannot reproduce unfortunately)

Comment 24 Jens Petersen 2025-01-17 03:39:51 UTC
$ GDK_SYNCHRONIZE=1 gtk4-demo-application 

(gtk4-demo-application:9346): Gdk-WARNING **: 11:36:34.061: The program 'gtk4-demo-application' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadRegion (invalid Region parameter)'.
  (Details: serial 1232 error_code 140 request_code 138 (XFIXES) minor_code 11)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the GDK_SYNCHRONIZE environment
   variable to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

Comment 25 Jens Petersen 2025-01-17 06:14:51 UTC
(In reply to Olivier Fourdan from comment #23)
> (FWIW, I just tried both apps with GTK from the main branch from git
> upstream, with xfce running in Xwayland rootful and with GDK_BACKEND=x11
> with GNOME Shell and cannot reproduce unfortunately)

Interesting, so actually I *can* reproduce also in GNOME Wayland with GDK_BACKEND=x11

In a Fedora-Workstation-Live-x86_64-Rawhide-20250116.n.0.iso Live instance:

liveuser@localhost-live:~$ gnome-text-editor 

:

(gnome-text-editor:3450): Gdk-WARNING **: 01:11:44.057: The program 'gnome-text-editor' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadRegion (invalid Region parameter)'.
  (Details: serial 964 error_code 140 request_code 138 (XFIXES) minor_code 11)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the GDK_SYNCHRONIZE environment
   variable to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

Comment 26 Jens Petersen 2025-01-17 06:52:27 UTC
(In reply to Olivier Fourdan from comment #23)
> (FWIW, I just tried both apps with GTK from the main branch from git
> upstream, with xfce running in Xwayland rootful and with GDK_BACKEND=x11
> with GNOME Shell and cannot reproduce unfortunately)

Perhaps you could try with gtk4-4.17.2-1.fc42 ?


(I just dnf updated an old rawhide VM (created in July) and can also reproduce in GNOME Wayland with "GDK_BACKEND=x11 gnome-text-editor" there.)

Comment 27 Jens Petersen 2025-01-17 08:32:14 UTC
I can also reproduce in a Fedora-Workstation-Live-x86_64-Rawhide-20250116.n.0.iso Live instance with "GDK_BACKEND=x11 gnome-text-editor"

Comment 28 Jens Petersen 2025-01-17 08:32:58 UTC
(In reply to Jens Petersen from comment #27)
> I can also reproduce in a
> Fedora-Workstation-Live-x86_64-Rawhide-20250116.n.0.iso Live instance with
> "GDK_BACKEND=x11 gnome-text-editor"

Okay I already wrote that...

Comment 29 Jens Petersen 2025-01-17 08:35:46 UTC
Also: I am running in virt-manager with virtio graphics.

Comment 30 Matthias Clasen 2025-01-17 12:11:40 UTC
Still waiting for a stacktrace with GDK_SYNCHRONIZE=1

Comment 31 Matthias Clasen 2025-01-17 12:46:58 UTC
> (Details: serial 845 error_code 140 request_code 139 (XFIXES) minor_code 11)

Meanwhile

```
define X_XFixesSetRegion                   11
```

This is almost certain to be a red herring - GTKs x11 code only makes very few XFixes requests, and none of them deal with regions.

Comment 32 Jens Petersen 2025-01-17 13:49:49 UTC
As far as I can tell by "bissecting" my few older Workstation Rawhide iso images this started happening in November:

# Fedora-Workstation-Live-x86_64-Rawhide-20241112.n.0.iso is fine

liveuser@localhost-live:~$ gnome-text-editor 
liveuser@localhost-live:~$ 
liveuser@localhost-live:~$ GDK_BACKEND=x11 gnome-text-editor 
libEGL warning: DRI3: Screen seems not DRI3 capable
libEGL warning: DRI3: Screen seems not DRI3 capable
MESA: error: ZINK: failed to choose pdev
libEGL warning: egl: failed to create dri2 screen
liveuser@localhost-live:~$ 

# with Fedora-Workstation-Live-x86_64-Rawhide-20241125.n.0.iso I see the X11 error

liveuser@localhost-live:~$ gnome-text-editor 
liveuser@localhost-live:~$ 
liveuser@localhost-live:~$ GDK_BACKEND=x11 gnome-text-editor 

(gnome-text-editor:3202): Gdk-WARNING **: 08:48:13.107: The program 'gnome-text-editor' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadRegion (invalid Region parameter)'.
  (Details: serial 990 error_code 140 request_code 138 (XFIXES) minor_code 11)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the GDK_SYNCHRONIZE environment
   variable to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
liveuser@localhost-live:~$ 


Running in virt-manager with virtio, 2 vcpus and Spice server

Comment 33 Jens Petersen 2025-01-17 14:09:43 UTC
They both have gtk4-4.17.0-1.fc42 (so naively at least that seems to preclude/exonerate gtk4)

Comment 34 Jens Petersen 2025-01-17 14:19:44 UTC
Apart from the kernel, perhaps mesa which had a version bump?

Indeed if I upgrade Fedora-Workstation-Live-x86_64-Rawhide-20241112.n.0.iso to mesa-24.3.3-1.fc42, the error starts.

Though note that Fedora-Workstation-Live-x86_64-Rawhide-20241125.n.0.iso already had mesa-24.3.0-1.fc42 which also errors.

Comment 35 Matthias Clasen 2025-01-17 14:48:21 UTC
GSK_BACKEND=cairo gnome-abrt works fine

GDK_DISABLE=vulkan gome-abrt also works fine

and in fact, the mesa vulkan x11 wsi code does use xfixes regions, via xcb

So, I would look there

Comment 36 Matthias Clasen 2025-01-17 15:32:40 UTC
What ends up happening is: 

$ GSK_DEBUG=renderer /usr/bin/gnome-abrt
Not using 'GskVulkanRenderer': platform is not Wayland
Not using 'GskNglRenderer': renderer is llvmpipe
Using renderer 'GskVulkanRenderer' for surface 'GdkX11Toplevel'

So we end up falling back to Vulkan on X11.

Which we shouldn't do, because the mesa vulkan x11 wsi code doesn't work.

So there's two bugs here:

- mesas vulkan x11 wsi code is not working
- gtk falls back to using it anyway

Comment 37 Jens Petersen 2025-02-14 07:12:41 UTC
Proposing for F42 Beta Freeze Exception

Comment 38 Dave Airlie 2025-02-17 06:38:24 UTC
Is there any pointer to an issue filed about the wsi x11 code not working? like has someone said this can't work, or just nobody has debugged it enough to fix it.


Though since it's always been broken, probably best for gtk to fix it's fallbacks for now

@jexposit might be able to help debug a bit more

Comment 39 Jens Petersen 2025-02-17 07:16:06 UTC
I opened https://gitlab.freedesktop.org/mesa/mesa/-/issues/12628 for the mesa side.

----

Also in F42 Workstation

liveuser@localhost-live:~$ GSK_DEBUG=renderer GDK_BACKEND=x11 gnome-text-editor  

Not using 'GskVulkanRenderer': platform is not Wayland
Not using 'GskGLRenderer': renderer is llvmpipe
Using renderer 'GskVulkanRenderer' for surface 'GdkX11Toplevel'
:
<<X11 error>

I also opened https://gitlab.gnome.org/GNOME/gtk/-/issues/7346 for gtk4.

Let me move this back to gtk4 for now since it may be easier to workaround first there in the short term.

Comment 40 Jens Petersen 2025-02-18 14:49:46 UTC
Okay moved back to mesa again.

Dave Airlie pushed fixes to F42 + Rawhide mesa which fix the problem - I tested on both Xorg and Xwayland (GDK_BACKEND=x11):

mesa-25.0.0~rc3-2.fc43
mesa-24.3.4-4.fc42

Thank you!

Comment 41 Fedora Update System 2025-02-20 10:13:04 UTC
FEDORA-2025-38dc8bb2f4 (mesa-25.0.0-2.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-38dc8bb2f4

Comment 42 Adam Williamson 2025-02-20 22:30:54 UTC
+3 in https://pagure.io/fedora-qa/blocker-review/issue/1753 , marking accepted FE.

Comment 43 Fedora Update System 2025-02-23 17:34:25 UTC
FEDORA-2025-38dc8bb2f4 (mesa-25.0.0-2.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.