Open Bug 2077633 Opened 1 month ago Updated 21 days ago

Parent process exits with X error BadGC (request_code 59, SetClipRectangles) while dragging tabs to reorder on X11

Categories

(Core :: Widget: Gtk, defect)

Firefox 157
defect

Tracking

()

UNCONFIRMED

People

(Reporter: liamw1, Unassigned)

References

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:157.0) Gecko/20100101 Firefox/157.0

Steps to reproduce

  1. Run Firefox in an X11 session with several tabs open.
  2. Drag tabs along the tab strip to reorder them, repeatedly.

This is intermittent. It usually takes many drags before it happens, and I can't trigger it on demand.

Actual results

The whole browser disappears. The crash reporter does not appear and nothing is recorded in about:crashes. When started from a terminal, this is printed:

(firefox:102391): Gdk-WARNING **: 19:37:56.972: The program 'firefox' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadGC (invalid GC parameter)'.
  (Details: serial 152858 error_code 13 request_code 59 (core protocol) minor_code 0)
Exiting due to channel error.

Expected results

Firefox keeps running.

Environment:

  • Firefox 157.0, Linux Mint package (/usr/lib/firefox)
  • Linux Mint 22.3 Cinnamon
  • NVIDIA proprietary driver 580.178.04
  • Compositing: WebRender
  • Window Protocol: x11

Additional information:

Happens with hardware acceleration enabled and disabled.

I got backtraces by running under gdb with a breakpoint on _exit, since GDK's error handler exits without crashing. Both are attached, with info sharedlibrary output in the second one for symbolicating the libxul frames.

Without GDK_SYNCHRONIZE the error is delivered during normal event processing (XGetWindowProperty from gdk_display_get_event).

With GDK_SYNCHRONIZE=1 it seems somewhat harder to reproduce, but I managed it once. The error is still not reported at the call that caused it. It arrives inside an unrelated _XReply in GDK's drag code:

#0  __GI__exit (status=1) at ../sysdeps/unix/sysv/linux/_exit.c:27
#1  0x000075841df9fb0e in ?? () from /lib/x86_64-linux-gnu/libgdk-3.so.0
#2  0x000075841d72e7fb in _XError () from /lib/x86_64-linux-gnu/libX11.so.6
#3  0x000075841d72e90f in ?? () from /lib/x86_64-linux-gnu/libX11.so.6
#4  0x000075841d72e9cd in ?? () from /lib/x86_64-linux-gnu/libX11.so.6
#5  0x000075841d73071d in _XReply () from /lib/x86_64-linux-gnu/libX11.so.6
#6  0x000075841df88e68 in ?? () from /lib/x86_64-linux-gnu/libgdk-3.so.0
#7  0x000075841df909ff in ?? () from /lib/x86_64-linux-gnu/libgdk-3.so.0
#8  0x000075841df96a47 in ?? () from /lib/x86_64-linux-gnu/libgdk-3.so.0
#9  0x000075841df3eb87 in gdk_drag_find_window_for_screen () from /lib/x86_64-linux-gnu/libgdk-3.so.0
#10 0x000075841df98400 in ?? () from /lib/x86_64-linux-gnu/libgdk-3.so.0
#11 0x000075841df9870f in ?? () from /lib/x86_64-linux-gnu/libgdk-3.so.0
#12 0x000075841df3f3de in ?? () from /lib/x86_64-linux-gnu/libgdk-3.so.0
#13 0x000075841df98e2e in ?? () from /lib/x86_64-linux-gnu/libgdk-3.so.0
#14 0x000075841de19635 in g_main_dispatch (context=0x75841fda06c0) at ../../../glib/gmain.c:3344
#15 0x000075841de78bf7 in g_main_context_dispatch_unlocked (context=0x75841fda06c0) at ../../../glib/gmain.c:4152
#16 g_main_context_iterate_unlocked.isra.0 (context=context@entry=0x75841fda06c0, block=block@entry=0, dispatch=dispatch@entry=1, self=<optimized out>) at ../../../glib/gmain.c:4217
#17 0x000075841de18ad3 in g_main_context_iteration (context=0x75841fda06c0, may_block=0) at ../../../glib/gmain.c:4282
#18 0x00007584155defb3 in ?? () from /usr/lib/firefox/libxul.so
#19 0x00007584155dd755 in ?? () from /usr/lib/firefox/libxul.so
#20 0x000075841679cdfe in ?? () from /usr/lib/firefox/libxul.so
#21 0x000075841679cbbc in ?? () from /usr/lib/firefox/libxul.so
#22 0x000075841679cb01 in ?? () from /usr/lib/firefox/libxul.so
#23 0x000075841764f612 in ?? () from /usr/lib/firefox/libxul.so
#24 0x0000758417a429c1 in ?? () from /usr/lib/firefox/libxul.so
#25 0x0000758417a419ad in ?? () from /usr/lib/firefox/libxul.so
#26 0x000057fef836e4c7 in ?? ()
#27 0x0000758427e2a1ca in __libc_start_call_main (main=main@entry=0x57fef836e1f0, argc=argc@entry=1, argv=argv@entry=0x7fff27f4ddc8) at ../sysdeps/nptl/libc_start_call_main.h:58
#28 0x0000758427e2a28b in __libc_start_main_impl (main=0x57fef836e1f0, argc=1, argv=0x7fff27f4ddc8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff27f4ddb8) at ../csu/libc-start.c:360
#29 0x000057fef8376719 in _start ()

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core

Could you share your crash report?

Flags: needinfo?(liamw1)
Severity: -- → S3

This should be an instance of bug 1905517.

See Also: → 1905517

Unfortunately, this crash doesn't produce a crash report at all. The best I could do was try to reproduce it while running Firefox under gdb to see where it's happening. I put the information I was able to gather in my bug report.

If it's at all helpful, I tried setting nglayout.enable_drag_images = false and that seems to be preventing the crash. I tried this after submitting my report and haven't had a crash since (where it was happening every couple days before under normal use). Seems to be something related to the tab drag preview images.

Flags: needinfo?(liamw1)

Same crash here, and in Firefox 159 it produces crash reports. Thanks to the change from bug 1905517 they carry the X error as crash reason:

bp-20d2a051-b21d-413a-8cfd-37ce40261103
bp-c2e4dced-1788-4809-aa42-fea4d0261103
bp-d30e00e7-daaa-4308-b39d-f6a170261103
Firefox 159.0 (20261027034604, Manjaro package), Cinnamon 6.6.9 on X11 with compositing, Xorg 21.1.24, Intel HD Graphics 620 (Mesa), 1920×1080.

The error was 'BadGC (invalid GC parameter)'. (Details: serial 26161 error_code 13 request_code 59 (core protocol) minor_code 0)

All three have the same stack as the gdb trace in comment 0: the error surfaces in _XReply from _gdk_x11_get_window_child_info ← get_client_window_at_coords_recurse ← gdk_x11_drag_context_find_window ← gdk_drag_update, and HandleGLibMessage turns the Gdk warning into a crash.

It happened in 3 of about 7 tab drags that went from the tab strip to the left screen edge, over the drop targets of another application (EdgeZones, which shows a column of drop targets for every drag). Longer drags across the screen seem to hit it much more often than reordering. I could not reproduce it in Xvfb with openbox (with and without picom) and a fresh profile: 80 scripted tab drags, no crash.

(In reply to TK from comment #5)

Same crash here, and in Firefox 159 it produces crash reports. Thanks to the change from bug 1905517 they carry the X error as crash reason:

bp-20d2a051-b21d-413a-8cfd-37ce40261103
bp-c2e4dced-1788-4809-aa42-fea4d0261103
bp-d30e00e7-daaa-4308-b39d-f6a170261103
Firefox 159.0 (20261027034604, Manjaro package), Cinnamon 6.6.9 on X11 with compositing, Xorg 21.1.24, Intel HD Graphics 620 (Mesa), 1920×1080.

The error was 'BadGC (invalid GC parameter)'. (Details: serial 26161 error_code 13 request_code 59 (core protocol) minor_code 0)

All three have the same stack as the gdb trace in comment 0: the error surfaces in _XReply from _gdk_x11_get_window_child_info ← get_client_window_at_coords_recurse ← gdk_x11_drag_context_find_window ← gdk_drag_update, and HandleGLibMessage turns the Gdk warning into a crash.

It happened in 3 of about 7 tab drags that went from the tab strip to the left screen edge, over the drop targets of another application (EdgeZones, which shows a column of drop targets for every drag). Longer drags across the screen seem to hit it much more often than reordering. I could not reproduce it in Xvfb with openbox (with and without picom) and a fresh profile: 80 scripted tab drags, no crash.

The drop target was from EdgeZones (https://codeberg.org/turbooster/edgezones) when I was adding firefox tab support in case that matters.

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