This morning, a bug suddenly appeared out of nowhere in a little graphical application I wrote: it contains a TTabControl, and clicking any of its tabs causes the app to freeze up. The TTabControl is nested in a TNoteBook page via a dynamically created TFrame. Interacting with anything else in the app works without issue. Clicking any tab a second time causes an external SIGSEGV error, with the console message:
Gtk-[1;35mCRITICAL[0m **: [34m19:01:58.732[0m: IA__gtk_widget_child_focus: assertion 'GTK_IS_WIDGET (widget)' failed
In addition, the call stack traces the error to gtk2pagecontrol.inc, line 37 (which is line 7 in the quote below).
// this was created as a workaround of a tnotebook eating rightclick of custom controls
function Notebook_Button_Press(widget:PGtkWidget; event:PGdkEventButton):gboolean; cdecl;
begin
Result := True;
if gtk_get_event_widget(PGdkEvent(event)) <> widget then exit;
if OldNoteBookButtonPress = nil then exit;
Result := OldNoteBookButtonPress(widget, event);
end;
I haven't managed to reproduce the issue yet, which is why I'm asking here rather than posting it on GitLab. Any idea what the cause is, and how I could potentially solve it? It's all the more baffling since the app was compiled as it is a while ago, so it can't be caused by me changing anything in the code. My best guess is that it's due to a recent update to GTK2 as part of a regular Ubuntu update?
## Lazarus Info:
Lazarus 3.99 (rev main_3_99-2836-gdfce0d15a4)
FPC 3.3.1
x86_64-linux-gtk2
## System Info:
- **Firmware Version:** F6
- **OS Name:** Ubuntu 24.04.2 LTS
- **OS Build:** (null)
- **OS Type:** 64-bit
- **GNOME Version:** 46
- **Windowing System:** X11
- **Kernel Version:** Linux 6.8.0-53-generic