Memory alignment changed from studio 2005 to 2010?
-
Hi all, Years ago I wrote a datamapper in 16 bit C which is still in use. Later I added a debugger that is based on the same code with a user interface in front. When we changed to windows interfaces, I rewrote the interface in c++ (Visual Studio 6) still mixing it with the original C mapping code. Then I migrated to Studio 2005. Works fine. I however recently moved to studio 2010. Now, the system crashes on every "malloc" statement in my C code. It throws an exception at the HEAP_ALLOC (Can't really follow anymore, the last part is in assembly for which there is no source studio says). Anyone any idea if there has been a change in memory alignment? Is there a compiler option that I should use?? Please help you wise men and women out there!!!! Thanks in advance William
-
Hi all, Years ago I wrote a datamapper in 16 bit C which is still in use. Later I added a debugger that is based on the same code with a user interface in front. When we changed to windows interfaces, I rewrote the interface in c++ (Visual Studio 6) still mixing it with the original C mapping code. Then I migrated to Studio 2005. Works fine. I however recently moved to studio 2010. Now, the system crashes on every "malloc" statement in my C code. It throws an exception at the HEAP_ALLOC (Can't really follow anymore, the last part is in assembly for which there is no source studio says). Anyone any idea if there has been a change in memory alignment? Is there a compiler option that I should use?? Please help you wise men and women out there!!!! Thanks in advance William
Could you give more details about your project? Is it composed with your
DLL
s?If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Could you give more details about your project? Is it composed with your
DLL
s?If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]The program is a Dialog based program that calls the datamapper's main loop (replaced the original "main" in the production datamapper by a routine called "StartMapping" in case of the debugger) from the "OnInitDialog". The dialog is c++, the datamapper is C and it does call some Studio6 built libraries that hold stuff like a standard error handling, license check etc. That has all been passed when at some point in the mapping, I use a malloc (or - after having removed the malloc for a test - a _fullpath with a NULL pointer for the target) Point is that it all worked fine when compiled in Studio2005, and it no longer works now that I have it compiled by Studio2010. It crashes when calling HeapAlloc in ntdll.dll, which tends me to believe that something changed in memory alignment. William
-
The program is a Dialog based program that calls the datamapper's main loop (replaced the original "main" in the production datamapper by a routine called "StartMapping" in case of the debugger) from the "OnInitDialog". The dialog is c++, the datamapper is C and it does call some Studio6 built libraries that hold stuff like a standard error handling, license check etc. That has all been passed when at some point in the mapping, I use a malloc (or - after having removed the malloc for a test - a _fullpath with a NULL pointer for the target) Point is that it all worked fine when compiled in Studio2005, and it no longer works now that I have it compiled by Studio2010. It crashes when calling HeapAlloc in ntdll.dll, which tends me to believe that something changed in memory alignment. William
Couldn't you rebuild the 'Studio6 built libraries'?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
The program is a Dialog based program that calls the datamapper's main loop (replaced the original "main" in the production datamapper by a routine called "StartMapping" in case of the debugger) from the "OnInitDialog". The dialog is c++, the datamapper is C and it does call some Studio6 built libraries that hold stuff like a standard error handling, license check etc. That has all been passed when at some point in the mapping, I use a malloc (or - after having removed the malloc for a test - a _fullpath with a NULL pointer for the target) Point is that it all worked fine when compiled in Studio2005, and it no longer works now that I have it compiled by Studio2010. It crashes when calling HeapAlloc in ntdll.dll, which tends me to believe that something changed in memory alignment. William
Could do that, but: 1. They are still used in other programs too 2. Some of these programs have also already been built in Studio 2010 and they all work..... William
-
Hi all, Years ago I wrote a datamapper in 16 bit C which is still in use. Later I added a debugger that is based on the same code with a user interface in front. When we changed to windows interfaces, I rewrote the interface in c++ (Visual Studio 6) still mixing it with the original C mapping code. Then I migrated to Studio 2005. Works fine. I however recently moved to studio 2010. Now, the system crashes on every "malloc" statement in my C code. It throws an exception at the HEAP_ALLOC (Can't really follow anymore, the last part is in assembly for which there is no source studio says). Anyone any idea if there has been a change in memory alignment? Is there a compiler option that I should use?? Please help you wise men and women out there!!!! Thanks in advance William
Hi William, Try linking your exe with Data Execution Prevention off: Project->Properties->Linker->Advanced->Data Execution Prevention (DEP)->No. cheers, AR
When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)