View Issue Details

IDProjectCategoryView StatusLast Update
0038332LazarusWidgetsetpublic2021-01-09 08:50
ReporterMartin Friebe Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
PlatformLinuxOSUbuntu 20 
Product Version2.1 (SVN) 
Summary0038332: GTK2: access to freed memory in DestroyWidget
DescriptionSee attached valgrind trace

lcl\interfaces\gtk2\gtk2proc.inc
line 4205

--------------
Some guesswork of me. Please verify against the valgrind trace.
See 2 comments in code.
Those comments are what I deducted from the valgrind trace. They may be wrong / need verification.

procedure DestroyWidget(Widget: PGtkWidget);
var
  Info: PWidgetInfo;
  AWinControl: TWinControl;
  Mess: TLMessage;
begin
  //DebugLn(['DestroyWidget A ',GetWidgetDebugReport(Widget)]);
  {$IFDEF DebugLCLComponents}
  if DebugGtkWidgets.FindInfo(Widget)=nil then
    DebugLn(['DestroyWidget ',GetWidgetDebugReport(Widget)]);
  {$ENDIF}
  Info:=GetWidgetInfo(Widget);
  if Info<>nil then begin
    if (Info^.LCLObject is TWinControl) then begin
      AWinControl:=TWinControl(Info^.LCLObject);
      if AWinControl.HandleAllocated
      and ({%H-}PGtkWidget(AWinControl.Handle)=Widget) then begin
        // send the LM_DESTROY message before destroying the widget
        FillChar(Mess{%H-},SizeOf(Mess),0);
        Mess.msg := LM_DESTROY;
        DeliverMessage(Info^.LCLObject, Mess);
      end;
    end;
    FreeWidgetInfo(Widget); ///////////////////////////////////////////////// The INFO is freed here <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  end;
  {$IFDEF DebugLCLComponents}
  DebugGtkWidgets.MarkDestroyed(Widget);
  {$ENDIF}
  gtk_widget_destroy(Widget); ////////////////////////////////////////// this leads to a callback to gtkdestroyCB which accesses the INFO <<<<<<<<<<<<<<<<<<<<<<<<<<<<
  //DebugLn(['DestroyWidget B']);
end;
Steps To ReproduceOne way to reproduce is using the debugger locals windows. Not sure of the exact other circumstances. May need to display some values / change some values ?
TagsNo tags attached.
Fixed in Revision
LazTarget
WidgetsetGTK 2
Attached Files

Activities

Martin Friebe

2021-01-08 18:38

manager  

linux_close.trc (16,682 bytes)   
==60230== Memcheck, a memory error detector
==60230== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==60230== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==60230== Command: ./lazarus
==60230== Parent PID: 11182
==60230== 
==60230== Invalid read of size 8
==60230==    at 0x70D792: GTK2PROC_$$_GTKDESTROYCB$PGTKWIDGET$POINTER$$BOOLEAN32 (gtk2callback.inc:1231)
==60230==    by 0x4F16801: g_closure_invoke (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x4F2A813: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x4F35B9D: g_signal_emit_valist (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x4F360D2: g_signal_emit (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x4AA4C85: ??? (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.32)
==60230==    by 0x4F1D4D0: g_object_run_dispose (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x4ADFACB: ??? (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.32)
==60230==    by 0x4A0205A: ??? (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.32)
==60230==    by 0x4F16801: g_closure_invoke (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x4F2AB04: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x4F35B9D: g_signal_emit_valist (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x4F360D2: g_signal_emit (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x4AA4C85: ??? (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.32)
==60230==    by 0x4F1D4D0: g_object_run_dispose (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x6FE78D: GTK2PROC_$$_DESTROYWIDGET$PGTKWIDGET (gtk2proc.inc:4231)
==60230==    by 0x52B1D2: GTK2INT$_$TGTK2WIDGETSET_$__$$_DESTROYCONNECTEDWIDGET$PGTKWIDGET$BOOLEAN (gtk2widgetset.inc:4845)
==60230==    by 0x52AE2D: GTK2INT$_$TGTK2WIDGETSET_$__$$_DESTROYLCLCOMPONENT$TOBJECT (gtk2widgetset.inc:4756)
==60230==    by 0x876690: GTK2WSCONTROLS$_$TGTK2WSWINCONTROL_$__$$_DESTROYHANDLE$TWINCONTROL (gtk2wscontrols.pp:601)
==60230==    by 0x901EE5: GTK2WSCOMCTRLS$_$TGTK2WSCUSTOMLISTVIEW_$__$$_DESTROYHANDLE$TWINCONTROL (gtk2wscustomlistview.inc:1824)
==60230==    by 0x5EF725: CONTROLS$_$TWINCONTROL_$__$$_DESTROYWND (wincontrol.inc:7869)
==60230==    by 0x687CA9: COMCTRLS$_$TCUSTOMLISTVIEW_$__$$_DESTROYWND (customlistview.inc:1150)
==60230==    by 0x5E79C6: CONTROLS$_$TWINCONTROL_$__$$_DESTROYHANDLE (wincontrol.inc:5331)
==60230==    by 0x5E799B: CONTROLS$_$TWINCONTROL_$__$$_DESTROYHANDLE (wincontrol.inc:5327)
==60230==    by 0x5EBB31: CONTROLS$_$TWINCONTROL_$__$$_DESTROY (wincontrol.inc:6615)
==60230==    by 0x60850A: CONTROLS$_$TCUSTOMCONTROL_$__$$_DESTROY (customcontrol.inc:40)
==60230==    by 0x49299A: FORMS$_$TSCROLLINGWINCONTROL_$__$$_DESTROY (scrollingwincontrol.inc:321)
==60230==    by 0x494688: FORMS$_$TCUSTOMFORM_$__$$_DESTROY (customform.inc:137)
==60230==    by 0xC684E7: DEBUGGERDLG$_$TDEBUGGERDLG_$__$$_DESTROY (debuggerdlg.pp:509)
==60230==    by 0x4370D7: SYSTEM$_$TOBJECT_$__$$_FREE (objpas.inc:336)
==60230==  Address 0xe22f458 is 8 bytes inside a block of size 160 free'd
==60230==    at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==60230==    by 0x4514DF: CMEM_$$_CFREEMEM$POINTER$$QWORD (cmem.pp:75)
==60230==    by 0x43DD72: fpc_freemem (heap.inc:367)
==60230==    by 0x6FE6B0: GTK2PROC_$$_FREEWIDGETINFO$POINTER (gtk2proc.inc:4185)
==60230==    by 0x6FE784: GTK2PROC_$$_DESTROYWIDGET$PGTKWIDGET (gtk2proc.inc:4226)
==60230==    by 0x52B1D2: GTK2INT$_$TGTK2WIDGETSET_$__$$_DESTROYCONNECTEDWIDGET$PGTKWIDGET$BOOLEAN (gtk2widgetset.inc:4845)
==60230==    by 0x52AE2D: GTK2INT$_$TGTK2WIDGETSET_$__$$_DESTROYLCLCOMPONENT$TOBJECT (gtk2widgetset.inc:4756)
==60230==    by 0x876690: GTK2WSCONTROLS$_$TGTK2WSWINCONTROL_$__$$_DESTROYHANDLE$TWINCONTROL (gtk2wscontrols.pp:601)
==60230==    by 0x901EE5: GTK2WSCOMCTRLS$_$TGTK2WSCUSTOMLISTVIEW_$__$$_DESTROYHANDLE$TWINCONTROL (gtk2wscustomlistview.inc:1824)
==60230==    by 0x5EF725: CONTROLS$_$TWINCONTROL_$__$$_DESTROYWND (wincontrol.inc:7869)
==60230==    by 0x687CA9: COMCTRLS$_$TCUSTOMLISTVIEW_$__$$_DESTROYWND (customlistview.inc:1150)
==60230==    by 0x5E79C6: CONTROLS$_$TWINCONTROL_$__$$_DESTROYHANDLE (wincontrol.inc:5331)
==60230==    by 0x5E799B: CONTROLS$_$TWINCONTROL_$__$$_DESTROYHANDLE (wincontrol.inc:5327)
==60230==    by 0x5EBB31: CONTROLS$_$TWINCONTROL_$__$$_DESTROY (wincontrol.inc:6615)
==60230==    by 0x60850A: CONTROLS$_$TCUSTOMCONTROL_$__$$_DESTROY (customcontrol.inc:40)
==60230==    by 0x49299A: FORMS$_$TSCROLLINGWINCONTROL_$__$$_DESTROY (scrollingwincontrol.inc:321)
==60230==    by 0x494688: FORMS$_$TCUSTOMFORM_$__$$_DESTROY (customform.inc:137)
==60230==    by 0xC684E7: DEBUGGERDLG$_$TDEBUGGERDLG_$__$$_DESTROY (debuggerdlg.pp:509)
==60230==    by 0x4370D7: SYSTEM$_$TOBJECT_$__$$_FREE (objpas.inc:336)
==60230==    by 0xC41272: DEBUGMANAGER$_$TDEBUGMANAGER_$__$$_DESTROYDEBUGDIALOG$TDEBUGDIALOGTYPE (debugmanager.pas:1746)
==60230==    by 0xC4227F: DEBUGMANAGER$_$TDEBUGMANAGER_$__$$_DESTROY (debugmanager.pas:1953)
==60230==    by 0x4370D7: SYSTEM$_$TOBJECT_$__$$_FREE (objpas.inc:336)
==60230==    by 0x74D3CC: LAZUTILITIES_$$_FREETHENNIL$formal (lazutilities.pas:46)
==60230==    by 0x4C4321: MAIN$_$TMAINIDE_$__$$_DESTROY (main.pp:1730)
==60230==    by 0x4370D7: SYSTEM$_$TOBJECT_$__$$_FREE (objpas.inc:336)
==60230==    by 0x4219BE: main (lazarus.pp:166)
==60230==  Block was alloc'd at
==60230==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==60230==    by 0x451498: CMEM_$$_CGETMEM$QWORD$$POINTER (cmem.pp:62)
==60230==    by 0x43DD52: fpc_getmem (heap.inc:362)
==60230==    by 0x6FE3EF: GTK2PROC_$$_CREATEWIDGETINFO$POINTER$$PWIDGETINFO (gtk2proc.inc:4120)
==60230==    by 0x6FE45D: GTK2PROC_$$_CREATEWIDGETINFO$POINTER$TOBJECT$TCREATEPARAMS$$PWIDGETINFO (gtk2proc.inc:4128)
==60230==    by 0x8786E0: GTK2WSCONTROLS$_$TGTK2WSBASESCROLLINGWINCONTROL_$__$$_CREATEHANDLE$TWINCONTROL$TCREATEPARAMS$$HWND (gtk2wscontrols.pp:1273)
==60230==    by 0x901AFC: GTK2WSCOMCTRLS$_$TGTK2WSCUSTOMLISTVIEW_$__$$_CREATEHANDLE$TWINCONTROL$TCREATEPARAMS$$HWND (gtk2wscustomlistview.inc:1727)
==60230==    by 0x5EE3DD: CONTROLS$_$TWINCONTROL_$__$$_CREATEWND (wincontrol.inc:7545)
==60230==    by 0x5EDB61: CONTROLS$_$TWINCONTROL_$__$$_CREATEHANDLE (wincontrol.inc:7455)
==60230==    by 0x5EF84E: CONTROLS$_$TWINCONTROL_$__$$_HANDLENEEDED (wincontrol.inc:7908)
==60230==    by 0x5EE772: CONTROLS$_$TWINCONTROL_$__$$_CREATEWND (wincontrol.inc:7590)
==60230==    by 0x49121D: FORMS$_$TSCROLLINGWINCONTROL_$__$$_CREATEWND (scrollingwincontrol.inc:23)
==60230==    by 0x49DA06: FORMS$_$TCUSTOMFORM_$__$$_CREATEWND (customform.inc:2721)
==60230==    by 0x49F49F: FORMS$_$TFORM_$__$$_CREATEWND (customform.inc:3185)
==60230==    by 0x5EDB61: CONTROLS$_$TWINCONTROL_$__$$_CREATEHANDLE (wincontrol.inc:7455)
==60230==    by 0x5EF84E: CONTROLS$_$TWINCONTROL_$__$$_HANDLENEEDED (wincontrol.inc:7908)
==60230==    by 0x5E1EBB: CONTROLS$_$TWINCONTROL_$_DOALLAUTOSIZE_$$_CHECKHANDLEALLOCATED$TWINCONTROL$$BOOLEAN (wincontrol.inc:3478)
==60230==    by 0x5E1981: CONTROLS$_$TWINCONTROL_$__$$_DOALLAUTOSIZE (wincontrol.inc:3529)
==60230==    by 0x60740E: CONTROLS$_$TCONTROL_$__$$_ENABLEAUTOSIZING (control.inc:5767)
==60230==    by 0x602C6A: CONTROLS$_$TCONTROL_$__$$_SETVISIBLE$BOOLEAN (control.inc:4566)
==60230==    by 0x49565A: FORMS$_$TCUSTOMFORM_$__$$_SETVISIBLE$BOOLEAN (customform.inc:417)
==60230==    by 0x49C7B6: FORMS$_$TCUSTOMFORM_$__$$_SHOWONTOP (customform.inc:2361)
==60230==    by 0xAC5A25: IDEWINDOWINTF$_$TSIMPLEWINDOWLAYOUTLIST_$__$$_APPLYANDSHOW$crc11A3EF49 (idewindowintf.pas:1792)
==60230==    by 0xAC891A: IDEWINDOWINTF$_$TIDEWINDOWCREATORLIST_$__$$_SHOWFORM$TCUSTOMFORM$BOOLEAN$TLAYOUTMOVETOVISBLEMODE (idewindowintf.pas:2237)
==60230==    by 0xAC8CD0: IDEWINDOWINTF$_$TIDEWINDOWCREATORLIST_$__$$_RESTORESIMPLELAYOUT (idewindowintf.pas:2294)
==60230==    by 0xE0D6CD: ENVIRONMENTOPTS$_$TDESKTOPOPT_$__$$_RESTOREDESKTOP (environmentopts.pp:1993)
==60230==    by 0x4C8C6D: MAIN$_$TMAINIDE_$__$$_RESTOREIDEWINDOWS (main.pp:2498)
==60230==    by 0x4C3DC8: MAIN$_$TMAINIDE_$__$$_STARTIDE (main.pp:1646)
==60230==    by 0x421849: main (lazarus.pp:146)
==60230== 
==60230== Invalid read of size 8
==60230==    at 0x4F3E669: g_type_check_instance_is_fundamentally_a (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x4F1BB98: g_object_unref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x49E2A8D: ??? (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.32)
==60230==    by 0x4F1BD0D: g_object_unref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x4B8C37E: ??? (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.32)
==60230==    by 0x4F1BD0D: g_object_unref (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x4B794F4: gtk_tree_view_remove_column (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.32)
==60230==    by 0x4B7F86E: ??? (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.32)
==60230==    by 0x4F16707: g_closure_invoke (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x4F2AB04: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x4F35B9D: g_signal_emit_valist (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x4F360D2: g_signal_emit (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x4AA4C85: ??? (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.32)
==60230==    by 0x4F1D4D0: g_object_run_dispose (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x4ADFACB: ??? (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.32)
==60230==    by 0x4A0205A: ??? (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.32)
==60230==    by 0x4F16801: g_closure_invoke (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x4F2AB04: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x4F35B9D: g_signal_emit_valist (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x4F360D2: g_signal_emit (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x4AA4C85: ??? (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.32)
==60230==    by 0x4F1D4D0: g_object_run_dispose (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x6FE78D: GTK2PROC_$$_DESTROYWIDGET$PGTKWIDGET (gtk2proc.inc:4231)
==60230==    by 0x52B1D2: GTK2INT$_$TGTK2WIDGETSET_$__$$_DESTROYCONNECTEDWIDGET$PGTKWIDGET$BOOLEAN (gtk2widgetset.inc:4845)
==60230==    by 0x52AE2D: GTK2INT$_$TGTK2WIDGETSET_$__$$_DESTROYLCLCOMPONENT$TOBJECT (gtk2widgetset.inc:4756)
==60230==    by 0x876690: GTK2WSCONTROLS$_$TGTK2WSWINCONTROL_$__$$_DESTROYHANDLE$TWINCONTROL (gtk2wscontrols.pp:601)
==60230==    by 0x901EE5: GTK2WSCOMCTRLS$_$TGTK2WSCUSTOMLISTVIEW_$__$$_DESTROYHANDLE$TWINCONTROL (gtk2wscustomlistview.inc:1824)
==60230==    by 0x5EF725: CONTROLS$_$TWINCONTROL_$__$$_DESTROYWND (wincontrol.inc:7869)
==60230==    by 0x687CA9: COMCTRLS$_$TCUSTOMLISTVIEW_$__$$_DESTROYWND (customlistview.inc:1150)
==60230==    by 0x5E79C6: CONTROLS$_$TWINCONTROL_$__$$_DESTROYHANDLE (wincontrol.inc:5331)
==60230==  Address 0x923e8b0 is 0 bytes inside a block of size 96 free'd
==60230==    at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==60230==    by 0x4F3D36B: g_type_free_instance (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x901E90: GTK2WSCOMCTRLS$_$TGTK2WSCUSTOMLISTVIEW_$__$$_DESTROYHANDLE$TWINCONTROL (gtk2wscustomlistview.inc:1821)
==60230==    by 0x5EF725: CONTROLS$_$TWINCONTROL_$__$$_DESTROYWND (wincontrol.inc:7869)
==60230==    by 0x687CA9: COMCTRLS$_$TCUSTOMLISTVIEW_$__$$_DESTROYWND (customlistview.inc:1150)
==60230==    by 0x5E79C6: CONTROLS$_$TWINCONTROL_$__$$_DESTROYHANDLE (wincontrol.inc:5331)
==60230==    by 0x5E799B: CONTROLS$_$TWINCONTROL_$__$$_DESTROYHANDLE (wincontrol.inc:5327)
==60230==    by 0x5EBB31: CONTROLS$_$TWINCONTROL_$__$$_DESTROY (wincontrol.inc:6615)
==60230==    by 0x60850A: CONTROLS$_$TCUSTOMCONTROL_$__$$_DESTROY (customcontrol.inc:40)
==60230==    by 0x49299A: FORMS$_$TSCROLLINGWINCONTROL_$__$$_DESTROY (scrollingwincontrol.inc:321)
==60230==    by 0x494688: FORMS$_$TCUSTOMFORM_$__$$_DESTROY (customform.inc:137)
==60230==    by 0xC684E7: DEBUGGERDLG$_$TDEBUGGERDLG_$__$$_DESTROY (debuggerdlg.pp:509)
==60230==    by 0x4370D7: SYSTEM$_$TOBJECT_$__$$_FREE (objpas.inc:336)
==60230==    by 0xC41272: DEBUGMANAGER$_$TDEBUGMANAGER_$__$$_DESTROYDEBUGDIALOG$TDEBUGDIALOGTYPE (debugmanager.pas:1746)
==60230==    by 0xC4227F: DEBUGMANAGER$_$TDEBUGMANAGER_$__$$_DESTROY (debugmanager.pas:1953)
==60230==    by 0x4370D7: SYSTEM$_$TOBJECT_$__$$_FREE (objpas.inc:336)
==60230==    by 0x74D3CC: LAZUTILITIES_$$_FREETHENNIL$formal (lazutilities.pas:46)
==60230==    by 0x4C4321: MAIN$_$TMAINIDE_$__$$_DESTROY (main.pp:1730)
==60230==    by 0x4370D7: SYSTEM$_$TOBJECT_$__$$_FREE (objpas.inc:336)
==60230==    by 0x4219BE: main (lazarus.pp:166)
==60230==  Block was alloc'd at
==60230==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==60230==    by 0x4FB9CD8: g_malloc (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6400.3)
==60230==    by 0x4FD22C5: g_slice_alloc (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6400.3)
==60230==    by 0x4FD28ED: g_slice_alloc0 (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6400.3)
==60230==    by 0x4F3D0CF: g_type_create_instance (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x4F1C34C: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x4F1E377: g_object_new_valist (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x4F1E6CC: g_object_new (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.6400.3)
==60230==    by 0x4EE5427: gdk_pixbuf_new_from_data (in /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0.4000.0)
==60230==    by 0x4EE2D95: gdk_pixbuf_copy (in /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0.4000.0)
==60230==    by 0x8FC6DD: GTK2WSCOMCTRLS_$$_GTK2_PIXBUFFROMBITMAP$TBITMAP$POINTER (gtk2wscustomlistview.inc:53)
==60230==    by 0x9032CE: GTK2WSCOMCTRLS$_$TGTK2WSCUSTOMLISTVIEW_$__$$_SETIMAGELIST$crcBFC3B5AB (gtk2wscustomlistview.inc:2247)
==60230==    by 0x9010B4: GTK2WSCOMCTRLS$_$TGTK2WSCUSTOMLISTVIEW_$__$$_ITEMSETIMAGE$crc8230233B (gtk2wscustomlistview.inc:1492)
==60230==    by 0x67EBBE: COMCTRLS$_$TLISTITEM_$__$$_SETIMAGEINDEX$TIMAGEINDEX (listitem.inc:684)
==60230==    by 0x14345DC: CALLSTACKDLG$_$TCALLSTACKDLG_$__$$_UPDATEVIEW (callstackdlg.pp:369)
==60230==    by 0x14330CF: CALLSTACKDLG$_$TCALLSTACKDLG_$__$$_CALLSTACKCHANGED$TOBJECT (callstackdlg.pp:210)
==60230==    by 0xC57059: DEBUGGER$_$TDEBUGGERCHANGENOTIFICATIONLIST_$__$$_NOTIFYCHANGE$TOBJECT (debugger.pp:4256)
==60230==    by 0xC64597: DEBUGGER$_$TIDECALLSTACKMONITOR_$__$$_NOTIFYCHANGE (debugger.pp:6540)
==60230==    by 0xC55029: DEBUGGER$_$TCURRENTCALLSTACK_$__$$_DOENTRIESUPDATED (debugger.pp:3875)
==60230==    by 0xC77558: DBGINTFDEBUGGERBASE$_$TCALLSTACKSUPPLIER_$__$$_REQUESTENTRIES$TCALLSTACKBASE (dbgintfdebuggerbase.pp:4825)
==60230==    by 0x160667A: LLDBDEBUGGER$_$TLLDBCALLSTACK_$__$$_PARENTREQUESTENTRIES$TCALLSTACKBASE (lldbdebugger.pas:1607)
==60230==    by 0x16060B5: LLDBDEBUGGER$_$TLLDBDEBUGGERCOMMANDCALLSTACK_$__$$_STACKINSTRUCTIONFINISHED$TOBJECT (lldbdebugger.pas:1534)
==60230==    by 0x14F8163: DEBUGINSTRUCTIONS$_$TDBGINSTRUCTION_$__$$_MARKASSUCCESS (debuginstructions.pas:363)
==60230==    by 0x16142B4: LLDBINSTRUCTIONS$_$TLLDBINSTRUCTIONSTACKTRACE_$__$$_PROCESSINPUTFROMDBG$ANSISTRING$$BOOLEAN (lldbinstructions.pas:1405)
==60230==    by 0x14F8D6B: DEBUGINSTRUCTIONS$_$TDBGINSTRUCTIONQUEUE_$__$$_DODBGLINERECEIVED$TOBJECT$ANSISTRING (debuginstructions.pas:470)
==60230==    by 0x14F5858: DEBUGPROCESS$_$TDEBUGPROCESS_$__$$_DOREADDATA$TOBJECT (debugprocess.pas:413)
==60230==    by 0x14F4F4F: DEBUGPROCESS$_$TDEBUGASYNCPROCESS_$__$$_HANDLEPIPEINPUT$INT64$TPIPEREASONS (debugprocess.pas:250)
==60230==    by 0x14F4DC4: DEBUGPROCESS$_$TDEBUGASYNCPROCESS_$__$$_THREADDATAAVAIL (debugprocess.pas:222)
==60230==    by 0x568283: CLASSES_$$_EXECUTETHREADQUEUEENTRY$TThread.PTHREADQUEUEENTRY (classes.inc:294)
==60230==    by 0x56889D: CLASSES_$$_CHECKSYNCHRONIZE$LONGINT$$BOOLEAN (classes.inc:492)
==60230== 
linux_close.trc (16,682 bytes)   

August Klein

2021-01-09 08:44

reporter   ~0128193

Last edited: 2021-01-09 08:50

View 2 revisions

Also some guesswork here...

GetWidgetInfo fuction returns the PWidgetInfo from main widget (via GetMainWidget fuction):
https://github.com/graemeg/lazarus/blob/upstream/lcl/interfaces/gtk2/gtk2proc.inc#L4144-L4146

But FreeWidgetInfo fuction gets the PWidgetInfo directly from gtk:
https://github.com/graemeg/lazarus/blob/upstream/lcl/interfaces/gtk2/gtk2proc.inc#L4167-L4169

As gtkdestroyCB fuction uses GetWidgetInfo, PWidgetInfo pointer may be different than the one returned from FreeWidgetInfo:
https://github.com/graemeg/lazarus/blob/upstream/lcl/interfaces/gtk2/gtk2callback.inc#L1227

Issue History

Date Modified Username Field Change
2021-01-08 18:38 Martin Friebe New Issue
2021-01-08 18:38 Martin Friebe File Added: linux_close.trc
2021-01-09 08:44 August Klein Note Added: 0128193
2021-01-09 08:50 August Klein Note Edited: 0128193 View Revisions