debug MemoryManager and IMAGE_FILE_LARGE_ADDRESS_AWARE

delphi package - automated exception handling
Post Reply
santiago
Posts: 73
Joined: Thu May 05, 2016 6:01 pm

debug MemoryManager and IMAGE_FILE_LARGE_ADDRESS_AWARE

Post by santiago »

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

{$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE}
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?

Thanks!
madshi
Site Admin
Posts: 10749
Joined: Sun Mar 21, 2004 5:25 pm

Re: debug MemoryManager and IMAGE_FILE_LARGE_ADDRESS_AWARE

Post by madshi »

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...
santiago
Posts: 73
Joined: Thu May 05, 2016 6:01 pm

Re: debug MemoryManager and IMAGE_FILE_LARGE_ADDRESS_AWARE

Post by santiago »

madschi,

I read on some other thread on this forum that the next major version of madExcept will support the 'buffer overrun' feature for 64 but apps.

Do you have a rough estimate into when we could be expecting madExcept v 5?

Thanks!

sb
madshi
Site Admin
Posts: 10749
Joined: Sun Mar 21, 2004 5:25 pm

Re: debug MemoryManager and IMAGE_FILE_LARGE_ADDRESS_AWARE

Post by madshi »

Probably early next year.
Post Reply