Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2017-06

Res leaks on exiting gtk2 app

12 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Alexey

CudaText app, gtk2 WS. I run it from terminal, it loads dir to Treeview [only top level of /usr], i exit.

user at user-Notebook:~$ cudatext /usr
CudaText: opening dir: /usr
[TGtk2WidgetSet.Destroy] WARNING: There are 4 unreleased DCs, a detailed dump follows:
[TGtk2WidgetSet.Destroy] DCs: 00007F15EAEC7E40 00007F15EAEC5640 00007F15EAEC5440 00007F15EAEC5040
[TGtk2WidgetSet.Destroy] WARNING: There are 19 unreleased GDIObjects, a detailed dump follows:
[TGtk2WidgetSet.Destroy] GDIOs: 00007F15E9A73540 00007F15E9A735C0 00007F15E9A73740 00007F15E9A734C0 00007F15E9A73EC0 00007F15E9A73E40 00007F15E9A73B40
[TGtk2WidgetSet.Destroy] gdiBitmap: 14
[TGtk2WidgetSet.Destroy] gdiBrush: 2
[TGtk2WidgetSet.Destroy] gdiPen: 2
[TGtk2WidgetSet.Destroy] gdiRegion: 1
user at user-Notebook:~$

Regards, Alexey

Reply by email

Alexey
to Alexey

[TGtk2WidgetSet.Destroy] WARNING: There are 19 unreleased GDIObjects, a detailed dump follows:

I see I have 19 icons in app, in 3..4 ImageLists. so all icons from Imagelists leaked? ImageLists placed in design time. They must free by LCL.

Regards, Alexey

Reply by email

Alexey
to Mattias Gaertner
Mattias Gaertner wrote
Why do you think this is a bug in the LCL, and not in cudatext?

I wrote that I have 4 imagelists with 19 icons [imagelists created in design time, icons load some in runtume, some in design time], and 19 objects leak.

Regards, Alexey

Reply by email

Mattias Gaertner
to Alexey
Show quoted text 6 lines
On 14.06.2017 12:14, Mattias Gaertner via Lazarus wrote: > Why do you think this is a bug in the LCL, and not in cudatext? I wrote that I have 4 imagelists with 19 icons [imagelists created in design time, icons load some in runtume, some in design time], and 19 objects leak.

Please test if you can reproduce this in a small project. If yes, please create a bug report.

Mattias

Reply by email

Michael Van Canneyt
to Mattias Gaertner: On Wed, 14 Jun 2017 12:02:34 +0300 Why do you think this is a bug in the LCL, and not in…
Mattias Gaertner wrote 7 lines
On Wed, 14 Jun 2017 12:02:34 +0300 Alexey via Lazarus wrote: > CudaText app, gtk2 WS. I run it from terminal, it loads dir to Treeview > [only top level of /usr], i exit. Why do you think this is a bug in the LCL, and not in cudatext?

Well, seeing it is GTK2, for example I consistently get this when exiting the IDE:

TApplication.HandleException Access violation
Stack trace:
$0000000000000000
$000000000062406E line 69 of include/toolbutton.inc $0000000000623FF6 line 116 of include/toolbutton.inc $00000000005B3468 line 2278 of include/control.inc $00000000005B38F1 line 2416 of include/control.inc $00000000004369E2 line 602 of ../inc/objpas.inc
$00000000005B336D line 2238 of include/control.inc $00000000005B19F6 line 1560 of include/control.inc $00000000005A486C line 4734 of include/wincontrol.inc $00000000005A5EA1 line 5361 of include/wincontrol.inc $000000000077341C line 112 of lclmessageglue.pas
$000000000066D0A1 line 3702 of gtk2/gtk2proc.inc
$000000000067BDE9 line 2141 of gtk2/gtk2callback.inc $000000000067B4D8 line 1899 of gtk2/gtk2callback.inc $00007F74A6B9BAFC
Exception at 0000000000000000: EAccessViolation:
Access violation.

(lazarus:12951): GLib-GObject-CRITICAL **: g_object_get_data: assertion 'G_IS_OBJECT (object)' failed TApplication.HandleException Access violation
Stack trace:
$00000000004368BC line 539 of ../inc/objpas.inc
$00000000004359E6 line 42 of ../inc/objpas.inc
$000000000067B3F5 line 1767 of gtk2/gtk2callback.inc $000000000067B53E line 1914 of gtk2/gtk2callback.inc $00007F74A6B9BAFC
Exception at 00000000004368BC: EAccessViolation:
Access violation.
LAZARUS END - cleaning up ...
[FORMS.PP] ExceptionOccurred
Sender=EAccessViolation
Exception=Access violation
Stack trace:
$00007F74A6837820
TApplication.HandleException Access violation
Stack trace:
$00007F74A6837820
Exception at 00007F74A6837820: EAccessViolation:
Access violation.

Reply by email

Mattias Gaertner
to Michael Van Canneyt
Show quoted text 16 lines
On Wed, 14 Jun 2017, Mattias Gaertner via Lazarus wrote: > On Wed, 14 Jun 2017 12:02:34 +0300 > Alexey via Lazarus wrote: > >> CudaText app, gtk2 WS. I run it from terminal, it loads dir to Treeview >> [only top level of /usr], i exit. > > Why do you think this is a bug in the LCL, and not in cudatext? Well, seeing it is GTK2, for example I consistently get this when exiting the IDE: TApplication.HandleException Access violation Stack trace: $0000000000000000 $000000000062406E line 69 of include/toolbutton.inc

This is apparently something else.
It is normal to get unreleased DCs after an AV.

Can you create a full stack trace with gdb and open another mail thread?

Mattias

Reply by email

Mattias Gaertner
to Alexey
Show quoted text 6 lines
On 14.06.2017 12:38, Mattias Gaertner via Lazarus wrote: > reproduce this in a small project. Cannot repeat it : event with my custom controls and Python. Leak is here only after i open folder in Cudatext [it calls Python engine to load filelist and show it in Treeview].

If you can't provide a simple example, then you must debug it yourself. Check if the imagelist is freed.

Mattias

Reply by email

Alexey
to Mattias Gaertner

I think Imagelist is freed [it must be] but WS gtk2 don't free it's handles or smth, can it be like it?
CudaText gives leak not always. Maybe some lock in gtk2.

If you can't provide a simple example, then you must debug it yourself. Check if the imagelist is freed. Mattias
Regards, Alexey

Reply by email

Mattias Gaertner
to Alexey
I think Imagelist is freed [it must be] but WS gtk2 don't free it's handles or smth, can it be like it? CudaText gives leak not always. Maybe some lock in gtk2.

Since you are the only one with this problem, it must be something you are doing with the imagelist.
You must give some clues what you are doing otherwise no one can help.

Mattias

Show quoted text 6 lines
> If you can't provide a simple example, then you must debug it yourself. > Check if the imagelist is freed. > > Mattias

Reply by email

Alexey
to Mattias Gaertner
Mattias Gaertner wrote
it must be something you are doing with the imagelist. You must give some clues what you are doing otherwise no one can help.

I'm doing loading of png files [Imagelist size 16x] to it--

function UpdateImagelistWithIconFromFile(AImagelist: TCustomImagelist;
   const AFilename: string): boolean;
var
   bmp: TCustomBitmap;
begin
   Result:= false;
   if AImagelist=nil then exit;
   if not FileExistsUtf8(AFilename) then exit;
   if ExtractFileExt(AFilename)='.bmp' then
     bmp:= TBitmap.Create
   else
   if ExtractFileExt(AFilename)='.png' then
     bmp:= TPortableNetworkGraphic.Create
   else
     exit;
   try
     try
       bmp.LoadFromFile(AFilename);
       bmp.Transparent:= true;
       AImagelist.Add(bmp, nil);
       Result:= true;
     finally
       FreeAndNil(bmp);
     end;
   except
   end;
end;

for many icons.

Regards, Alexey

Reply by email