MemoryLeaks 64 bit

delphi package - automated exception handling
Post Reply
Han312
Posts: 50
Joined: Mon Mar 14, 2016 3:49 pm

MemoryLeaks 64 bit

Post by Han312 »

I get several memoryleaks reported with MadExcept 5.1 & Delphi 10.4.2.

They seem to be part of a driver

name: \Device\Afd
name: \BaseNamedObjects\SafeNet-SentinelSMEM
part of the leak report
part of the leak report
Unbenannt.png (55.3 KiB) Viewed 154 times
I get these leak reports only with 64-bit not with 32-bit
How can i hide these messages?
madshi
Site Admin
Posts: 10365
Joined: Sun Mar 21, 2004 5:25 pm

Re: MemoryLeaks 64 bit

Post by madshi »

There are various ways how to hide leaks, but of course madExcept can only hide stuff if you're able to clearly communicate what it is you want to hide exactly. You can have a look at the various overloaded "HideLeak()" APIs here:

http://help.madshi.net/madExceptUnit.htm#HideLeak

Maybe one of them will work for you? If leaks are in 3rd party code, usually the callstack based HideLeak() API is the best way to hide leaks. But it works only if the callstack clearly points to the 3rd party code. If it doesn't, you may be out of luck, sadly. Of course you can always try to ask the 3rd party provider to fix their leaks.
Han312
Posts: 50
Joined: Mon Mar 14, 2016 3:49 pm

Re: MemoryLeaks 64 bit

Post by Han312 »

The last years it helped to ignore their unit (there were other leaks)
HideLeak ( 'hasp_unit' );

By adding
HideLeak ( 'AddKernelHandle' );
HideLeak ( 'AddHandle' );
HideLeak ( 'AddMemAlloc' );
I have calm. But I would ignore these leaks in the whole project.

From the MBR it is not possible to see where exactly the problem is?

Code: Select all

allocation number: 16514289
program up time: 19,74 s
type: InitializeCriticalSection
address: $c5ff700
access rights: read/write

thread $51d4:
671ee52b madExcept64.dll madExceptDbg 1509 AddHandle
671f80db madExcept64.dll madExceptDbg 4585 InitializeCriticalSectionCallback

allocation number: 16514256
program up time: 19,74 s
type: HeapAlloc
address: $c5f25e0
size: 1056
access rights: read/write

thread $51d4:
671ee4c4 madExcept64.dll madExceptDbg 1501 AddMemAlloc
671f0233 madExcept64.dll madExceptDbg 2325 HeapAllocCallback

It is just a very general information and I only guess that it is caused by the API for the dongle driver.
madshi
Site Admin
Posts: 10365
Joined: Sun Mar 21, 2004 5:25 pm

Re: MemoryLeaks 64 bit

Post by madshi »

By ignoring "AddKernelHandle" you're ignoring a lot more than just these specific memory leaks. Basically I think you're probably hiding all kernel handle leaks... :sorry: Sadly, the callstack seems to be pretty incomplete. I don't have a good idea how to help you right now, unfortunately.
Post Reply