Running the webdriver suite with GTK4 has been suffering from frequent flaky crashes in the teardown of many prompt tests (which are very common in the suite). On the bot, this is causing the disk to fill rather quickly, despite shortening the interval to clean up the generated core dumps. For example: imported/w3c/webdriver/tests/get_element_css_value/user_prompts.py::test_default[prompt-None] During the teardown, if a crash happens, it shows: ``` Ignored exception unknown error (500): Ignored exception invalid session id (404): session deleted because of page crash or hang. ``` Inspecting the dump (through GDB inside the flatpak SDK) looks like the WebKitScriptDialogImpl defaultButton is invalidated/deleted while being still used as the default widget of the window (or something like that). Dump: #0 0x00007f53bdd028ef in gtk_widget_remove_css_class (widget=0x5600175d54b0, css_class=0x7f53bdf21c30 "default") at ../gtk/gtkwidget.c:12747 12747 g_return_if_fail (GTK_IS_WIDGET (widget)); [Current thread is 1 (Thread 0x7f53b6e679c0 (LWP 1861))] #0 0x00007f53bdd028ef in gtk_widget_remove_css_class (widget=0x5600175d54b0, css_class=0x7f53bdf21c30 "default") at ../gtk/gtkwidget.c:12747 #1 0x00007f53bdd0c35c in gtk_window_set_default_widget (window=0x56001755a310 [BrowserWindow], default_widget=0x0) at ../gtk/gtkwindow.c:2282 #2 0x00007f53bdd0c548 in maybe_unset_focus_and_default (window=0x56001755a310 [BrowserWindow]) at ../gtk/gtkwindow.c:4670 #3 surface_render (surface=surface@entry=0x560017358170 [GdkX11Toplevel], region=region@entry=0x56001a5365a0, widget=0x56001755a310 [BrowserWindow]) at ../gtk/gtkwindow.c:4683 #4 0x00007f53bddf9438 in _gdk_marshal_BOOLEAN__BOXEDv (closure=closure@entry=0x56001a91fb70, return_value=return_value@entry=0x7ffe05a91db0, instance=instance@entry=0x560017358170, args=args@entry=0x7ffe05a91e80, marshal_data=marshal_data@entry=0x0, n_params=n_params@entry=1, param_types=0x560017355d90) at gdk/gdkmarshalers.c:130 #5 0x00007f53b8482229 in _g_closure_invoke_va (closure=closure@entry=0x56001a91fb70, return_value=return_value@entry=0x7ffe05a91db0, instance=instance@entry=0x560017358170, args=args@entry=0x7ffe05a91e80, n_params=1, param_types=0x560017355d90) at ../gobject/gclosure.c:893 #6 0x00007f53b849ad9b in g_signal_emit_valist (instance=0x560017358170, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffe05a91e80) at ../gobject/gsignal.c:3406 #7 0x00007f53b849bcb3 in g_signal_emit (instance=instance@entry=0x560017358170, signal_id=<optimized out>, detail=detail@entry=0) at ../gobject/gsignal.c:3553 #8 0x00007f53bde20f37 in gdk_surface_process_updates_internal (surface=0x560017358170 [GdkX11Toplevel]) at ../gdk/gdksurface.c:1344 #9 gdk_surface_paint_on_clock (clock=<optimized out>, data=<optimized out>) at ../gdk/gdksurface.c:1432 #10 0x00007f53b8482229 in _g_closure_invoke_va (closure=closure@entry=0x5600175e4360, return_value=return_value@entry=0x0, instance=instance@entry=0x560017356300, args=args@entry=0x7ffe05a92180, n_params=0, param_types=0x0) at ../gobject/gclosure.c:893 #11 0x00007f53b849ba98 in g_signal_emit_valist (instance=0x560017356300, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffe05a92180) at ../gobject/gsignal.c:3406 #12 0x00007f53b849bcb3 in g_signal_emit (instance=instance@entry=0x560017356300, signal_id=<optimized out>, detail=detail@entry=0) at ../gobject/gsignal.c:3553 #13 0x00007f53bde13103 in _gdk_frame_clock_emit_paint (frame_clock=frame_clock@entry=0x560017356300 [GdkFrameClockIdle]) at ../gdk/gdkframeclock.c:709 #14 0x00007f53bde13b9e in gdk_frame_clock_paint_idle (data=<error reading variable: value has been optimized out>) at ../gdk/gdkframeclockidle.c:602 #15 0x00007f53c3387e28 in g_timeout_dispatch (source=0x560019169760, callback=<optimized out>, user_data=<optimized out>) at ../glib/gmain.c:4933 #16 0x00007f53c3387294 in g_main_dispatch (context=0x560017354a70) at ../glib/gmain.c:3381 #17 g_main_context_dispatch (context=0x560017354a70) at ../glib/gmain.c:4099 #18 0x00007f53c3387638 in g_main_context_iterate (context=context@entry=0x560017354a70, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4175 #19 0x00007f53c3387703 in g_main_context_iteration (context=context@entry=0x560017354a70, may_block=may_block@entry=1) at ../glib/gmain.c:4240 #20 0x00007f53b85bf765 in g_application_run (application=0x56001736c260 [GtkApplication], argc=94970852, argv=<optimized out>) at ../gio/gapplication.c:2569 #21 0x0000560016a5655b in main ()
Created attachment 445512 [details] Tentative patch
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See https://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Committed r286354 (244713@main): <https://commits.webkit.org/244713@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 445512 [details].
<rdar://problem/85910770>