ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 LoadFromFileIev memory leak and Out of memory
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

RudBus

Canada
6 Posts

Posted - Feb 22 2022 :  16:55:14  Show Profile  Reply
Hi,

I just updated to ImageEn 10.3.0_41640 and I still have 2 issues with ievect.LoadFromFileIev.

First I have a memory leak with softshadow when loading an image from LoadFromFileIev because it raises in the Stream.Read(Name^, q) that follows the softshadow create. Here is the call stack:

System.ZLib.ZDecompressCheckWithoutBufferError(-3)
System.ZLib.TZDecompressionStream.Read(???,1701564)
ievect.TImageEnVect.ReadObj($7D97AF00,87,True,0)
ievect.TImageEnVect.LoadFromStreamIEV($7D95E360,False)
ievect.TImageEnVect.LoadFromFileIEV('ImageNameCorrupted.iev',True)


And I also have an Out of memory with another image. Here is the call stack:

hyieutils.IEStrDup(#1)
hyieutils.IEStrDup('€¬’'#3'€€€€€€€€€€€€€€€€€€€...
ievect.TImageEnVect.AddVObject($19F27C)
ievect.TImageEnVect.ReadObj($7D97AF00,84,True,1)
ievect.TImageEnVect.ReadObj($7D97AF00,84,True,1)
ievect.TImageEnVect.LoadFromStreamIEV($7D95DB40,True)
ievect.TImageEnVect.LoadFromFileIEV('ImageOutOfMemory.iev',True)


I have attached both images a zip file. I'm using FastMM4. While I guess both images are corrupted and that corruption can be very unpredictable, do you think there is anything that could be done to prevent those 2 issues ? Thank you.

attach/RudBus/2022222165358_Images.zip
914 Bytes

xequte

38608 Posts

Posted - Feb 22 2022 :  19:26:24  Show Profile  Reply
Hi

We have made some improvements to cope with corrupted files. You can email me to test the update.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

RudBus

Canada
6 Posts

Posted - Feb 24 2022 :  17:19:31  Show Profile  Reply
Thank you Nigel, I see you made improvements in the ReadObj for the corrupted files and it's working fine for the Out of memory problem!

About the memory leak issue (ImageNameCorrupted.iev) the softshadow leaks no more but there is still a leak. This is the leak I have (I'm still using version 10.3.0 with the ReadObj from the 10.3.1 Beta update):

A memory block has been leaked. The size is: 1703780

This block was allocated by thread 0x3D24, and the stack trace (return addresses) at the time was:
40A066 [System.pas][System][@GetMem$qqri][4745]
1DB1142 [ievect.pas][ievect][TImageEnVect.ReadObj$qqrp22System.Classes.TStreamucoi][9496]
77BEFBD0 [RtlRegisterSecureMemoryCacheCallback]
1B7459C [iexLayers.pas][iexLayers][TIELayer.GetWidthD$qqrv][9159]
77B82C4C [ZwSetInformationFile]
76D6D962 [SetFilePointer]
76D6D987 [SetFilePointer]
76D6D987 [SetFilePointer]
5C49A7 [inflate.c][System.ZLib][Zlib.inflatePrime$qr20System.Zlib.z_streamii][413]
5C5ECF [inflate.c][System.ZLib][Zlib.inflate$qr20System.Zlib.z_streami][1244]
4C6CC3 [System.Classes.pas][System.Classes][Classes.THandleStream.Seek$qqrxj26System.Classes.TSeekOrigin][8759]

The block is currently used for an object of class: Unknown


It seems tricky though.
Go to Top of Page

xequte

38608 Posts

Posted - Feb 27 2022 :  21:08:36  Show Profile  Reply
Hi

I tested ImageNameCorrupted.iev as follows:

- Created a blank project
- Added a TImageEnVect and a button
- Added to the button click code: ImageEnVect1.LoadFromFileIEV( 'D:\ImageNameCorrupted.iev' );
- Enable memory leak detection for the project

>>> I did not see any memory leak error on closure. Can you try the above and let me know.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

RudBus

Canada
6 Posts

Posted - Mar 01 2022 :  13:22:25  Show Profile  Reply
I'm sorry the leak is for another image I didn't attach before. You may try with this one and you should have the leak now.

attach/RudBus/20223113207_ImageLineCorrupted.zip
847 Bytes
Go to Top of Page

xequte

38608 Posts

Posted - Mar 01 2022 :  22:25:10  Show Profile  Reply
Thanks. We'll have a fix for this in the next release.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: