delphi package - automated exception handling


Postby santiago » Fri Feb 03, 2017 8:19 pm

Hello madschi,

yesterday madExcept helped us locate a buffer overrun in our software.
Very happy about that. :-)

Now I wanted to test our App a bit more with the 'buffer overrun' check active.
The problem is that I am getting EOutOfMemory Exceptions very early, so I can barely test anything.

It is clear that when this check is active a lot more RAM will be consumed. But I do believe I have found a problem.

I created a bare bones test application. It has just one button:
Button 1: Keeps allocating Memory until EOutOfMemory is thrown.

I added this to the dpr file:
Code: Select all

Since I am running on a 64 bit System this gives my 32 bit test project 4 GB of RAM.

I can verify this is the case, when I hit the button and the madExcept box popups once the EOutOfMemoryException is raised.
Allocated memory is at 3.84 GB.

Now if I enable the buffer overrun test, the EOutOfMemoryException is raised much faster.
Allocated memory is at: 1.90 GB.

So it seems that the custom madExcept Memory Manager is not honoring the IMAGE_FILE_LARGE_ADDRESS_AWARE flag.

Could you please comment on this?

Posts: 33
Joined: Thu May 05, 2016 6:01 pm

Re: debug MemoryManager and IMAGE_FILE_LARGE_ADDRESS_AWARE

Postby madshi » Wed Feb 15, 2017 1:41 pm

Hmmmm... That's a good question. I'm not doing anything special to allow or block large addresses from being used. I'm simply using VirtualAlloc and I'm actually allowing VirtualAlloc to choose whatever buffer address it likes. So it seems to me it should work. However, my debug memory manager is in madExcept32.dll and that dll doesn't have the IMAGE_FILE_LARGE_ADDRESS_AWARE flag set. Maybe that makes a difference? I'm not entirely sure right now...
Site Admin
Posts: 9411
Joined: Sun Mar 21, 2004 5:25 pm

Return to madExcept

Who is online

Users browsing this forum: No registered users and 6 guests