• Advertisement
Sign in to follow this  

Find Buffer Overrun Source, HELP!

This topic is 3576 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello I have a buffer overrun, and because of the debugger, I know it was a allocated 74 byte pointer. But thats all i know. ie I allocated 74 bytes, and wrote to position 132. The app crashes soon after the overwrite, but not when it happens. How can I set a breakpoint so that whenever new, alloc, malloc etc allocate 74 bytes? Or is there a better way to find it? I am using Visual C++; I downloaded windbg, but it does not give me any new info. thanks

Share this post


Link to post
Share on other sites
Advertisement
There is no easy way.

A solution that is sometimes used to track allocation is overriding the global new operator. However, this is not for the faint of heart.

Share this post


Link to post
Share on other sites
Well actually it just so happens that there is an easy way on Windows, it's called "Page heap allocation". I use it often.
You could start here: http://technet2.microsoft.com/windowsserver/en/library/6a183942-57b1-45e0-8b4c-c546aa1b8c471033.mspx?mfr=true

Basically it puts your heap allocations at the end of a 4Kb page of RAM where the page after it is always unallocated i.e. accessing it will cause an immediate access violation.
So your program will break into the debugger on the exact line that does the buffer overrun. The downside is that memory usage goes way up. Any allocation from 1 byte to 4K will require 8Kb (two pages) of virtual address space. Typically you set it to only some percent chance of each allocation being allocated in this way, but if you have enough RAM, then just use do it for all allocations.
This only works for heap allocated memory, not for stack based arrays.

Although people may typically use gflags to set the option, I believe it is turned on simply by adding a registry entry for your app.

Share this post


Link to post
Share on other sites
In addition, if you know what address is being written to (and it's consistent, or you can figure it out ahead of time in a single run), you can just use a data breakpoint. No code changes are required at all.

Share this post


Link to post
Share on other sites
Hi iMalc,

That sounds promising - I have the same problem - only I really don't understand how turning on the option works.... Is it when I am debugging in VC++ that the problematic line will crash? I notice that the report of the leak happens when I try to delete a certain object...

Can you explain how to set this up properly?

Thanks,
Mike

Share this post


Link to post
Share on other sites
I just tried to connect to work to get the required registry info for you, but I'm having connection problems. But basically it causes an access violation the instant your app tries to write past the end of the array. Then if you're debugging in VS at the time your app will give you the usual Abort/Retry/Ignore dialog box IIRC, and you click retry to be dropped into the debugger with the yellow arrow that indicates the execution point, pointing at the line that caused the fault. You then examine the related variables and code to determine the problem.
If not running under the debugger you'll get an instant crash, though you can set DrWatson up to generate a crash dump for you if you're into post-mortem debugging.

Other methods, such as light page heap checking or what VS itself does in debug builds will only tend to detect the problem upon freeing the memory, and you might have no idea which bit of code caused the real problem.

Note that page-heap-allocation can only be used to detect buffer-overrun OR buffer-underrun, not both at the same time. It places the block at the start of a page with the preceeding page being inaccessible to detect buffer-underrun.

For now I suggest downloading and installing Debugging tools for Windows, and using gflags to set page-heap-allocation up for your application. When I can get the info about the exact registry key you can add to turn this on manually I'll repost.

Share this post


Link to post
Share on other sites
Check out Paul Nettle's Memory Manager code at www.paulnettle.com. Its under the code section of his website.

His memory manager is basically a few files that you can drop into your project (you'll also need to include the mmgr.h file at the top of each source file) that will track all of the memory allocations and will let you know when and where problems occur.

Say for example you allocate an array of 100 bytes and start writing past the bounds of the array. The memory manager will let you know when and what line this happened on.

It'll also log all of the allocations, deallocations during execution and any memory leaks you might have when the program is terminated.

The only caveat is that it doesn't tolerate multi-threaded applications at all, but I'm sure the code could be modified to work in such an environment.

Beyond that it's an excellent piece of software.

-=[ Megahertz ]=-

Share this post


Link to post
Share on other sites
Quote:
Original post by Megahertz
Say for example you allocate an array of 100 bytes and start writing past the bounds of the array. The memory manager will let you know when and what line this happened on.
Paul Nettle's Memory Manager lets you know where the allocation was made from, not exactly which line of code caused the buffer overrun. However this may enough to track down the problem in some cases though anyway.

If you download Debugging tools for Windows, this is the command to turn on page-heap-debugging:
gflags /p /enable YourAppNameHere.exe /random 75
(where 75 is the percent chance that an allocation uses page-heap-allocation)
The following disables it again:
gflags /p /disable YourAppNameHere.exe

[Edited by - iMalc on April 5, 2008 3:48:56 AM]

Share this post


Link to post
Share on other sites
Thanks for your great responses! I did give Paul Nettle's code a try - but can't get it to compile - I have Visual Studio 2008 (v. 9). I have about 1000 errors - maybe if you see them you will know what I have to do to fix it?

1>c:\dev\inc\mmgr.h(41) : warning C4117: macro name '__FUNCTION__' is reserved, '#define' ignored
1>c:\program files\microsoft visual studio 9.0\vc\include\new(51) : error C2544: expected ')' for operator '()'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(51) : error C2146: syntax error : missing ';' before identifier 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(51) : warning C4229: anachronism used : modifiers on data are ignored
1>c:\program files\microsoft visual studio 9.0\vc\include\new(51) : error C2182: '()' : illegal use of type 'void'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(51) : error C2457: '__FUNCTION__': predefined macro cannot appear outside of a function body
1>c:\program files\microsoft visual studio 9.0\vc\include\new(51) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\include\new(51) : error C2365: 'm_setOwner' : redefinition; previous definition was 'function'
1> c:\dev\inc\mmgr.h(95) : see declaration of 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(51) : error C2078: too many initializers
1>c:\program files\microsoft visual studio 9.0\vc\include\new(51) : error C2440: 'initializing' : cannot convert from 'const char [1]' to 'int'
1> There is no context in which this conversion is possible
1>c:\program files\microsoft visual studio 9.0\vc\include\new(51) : error C2059: syntax error : 'constant'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(51) : error C2059: syntax error : ')'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(51) : error C2059: syntax error : 'delete'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : error C2544: expected ')' for operator '()'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : error C2146: syntax error : missing ';' before identifier 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : warning C4229: anachronism used : modifiers on data are ignored
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : error C2182: '()' : illegal use of type 'void'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : error C2433: '()' : 'inline' not permitted on data declarations
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : error C2086: 'int ()' : redefinition
1> c:\program files\microsoft visual studio 9.0\vc\include\new(51) : see declaration of '()'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : error C2457: '__FUNCTION__': predefined macro cannot appear outside of a function body
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : error C2365: 'm_setOwner' : redefinition; previous definition was 'function'
1> c:\dev\inc\mmgr.h(95) : see declaration of 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : error C2078: too many initializers
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : error C2440: 'initializing' : cannot convert from 'const char [1]' to 'int'
1> There is no context in which this conversion is possible
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : error C2059: syntax error : 'constant'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : error C2059: syntax error : ')'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : error C2059: syntax error : 'delete'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(75) : error C2143: syntax error : missing ';' before '{'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(75) : error C2447: '{' : missing function header (old-style formal list?)
1>c:\program files\microsoft visual studio 9.0\vc\include\new(79) : error C2544: expected ')' for operator '()'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(79) : error C2146: syntax error : missing ';' before identifier 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(79) : warning C4229: anachronism used : modifiers on data are ignored
1>c:\program files\microsoft visual studio 9.0\vc\include\new(79) : error C2182: '()' : illegal use of type 'void'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(79) : error C2086: 'int ()' : redefinition
1> c:\program files\microsoft visual studio 9.0\vc\include\new(51) : see declaration of '()'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(79) : error C2457: '__FUNCTION__': predefined macro cannot appear outside of a function body
1>c:\program files\microsoft visual studio 9.0\vc\include\new(79) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\include\new(79) : error C2365: 'm_setOwner' : redefinition; previous definition was 'function'
1> c:\dev\inc\mmgr.h(95) : see declaration of 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(79) : error C2078: too many initializers
1>c:\program files\microsoft visual studio 9.0\vc\include\new(79) : error C2440: 'initializing' : cannot convert from 'const char [1]' to 'int'
1> There is no context in which this conversion is possible
1>c:\program files\microsoft visual studio 9.0\vc\include\new(79) : error C2059: syntax error : 'constant'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(79) : error C2059: syntax error : ')'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(79) : error C2059: syntax error : 'delete'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(32) : error C2544: expected ')' for operator '()'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(32) : error C2146: syntax error : missing ';' before identifier 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(32) : warning C4229: anachronism used : modifiers on data are ignored
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(32) : error C2040: '()' : 'void *' differs in levels of indirection from 'int'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(32) : error C3453: 'vc_attributes::Post': attribute not applied because qualifier 'returnvalue' did not match
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(32) : error C2457: '__FUNCTION__': predefined macro cannot appear outside of a function body
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(32) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(32) : error C2365: 'm_setOwner' : redefinition; previous definition was 'function'
1> c:\dev\inc\mmgr.h(95) : see declaration of 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(32) : error C2078: too many initializers
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(32) : error C2440: 'initializing' : cannot convert from 'const char [1]' to 'int'
1> There is no context in which this conversion is possible
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(32) : error C2059: syntax error : 'constant'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(32) : error C2059: syntax error : ')'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(32) : error C2059: syntax error : 'new'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(36) : error C2544: expected ')' for operator '()'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(36) : error C2146: syntax error : missing ';' before identifier 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(36) : warning C4229: anachronism used : modifiers on data are ignored
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(36) : error C2040: '()' : 'void *' differs in levels of indirection from 'int'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(36) : error C3453: 'vc_attributes::Post': attribute not applied because qualifier 'returnvalue' did not match
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(36) : error C2457: '__FUNCTION__': predefined macro cannot appear outside of a function body
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(36) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(36) : error C2365: 'm_setOwner' : redefinition; previous definition was 'function'
1> c:\dev\inc\mmgr.h(95) : see declaration of 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(36) : error C2078: too many initializers
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(36) : error C2440: 'initializing' : cannot convert from 'const char [1]' to 'int'
1> There is no context in which this conversion is possible
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(36) : error C2059: syntax error : 'constant'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(36) : error C2059: syntax error : ')'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(36) : error C2059: syntax error : 'new'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(40) : error C2544: expected ')' for operator '()'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(40) : error C2146: syntax error : missing ';' before identifier 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(40) : warning C4229: anachronism used : modifiers on data are ignored
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(40) : error C2182: '()' : illegal use of type 'void'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(40) : error C2086: 'int ()' : redefinition
1> c:\program files\microsoft visual studio 9.0\vc\include\new(51) : see declaration of '()'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(40) : error C2457: '__FUNCTION__': predefined macro cannot appear outside of a function body
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(40) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(40) : error C2365: 'm_setOwner' : redefinition; previous definition was 'function'
1> c:\dev\inc\mmgr.h(95) : see declaration of 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(40) : error C2078: too many initializers
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(40) : error C2440: 'initializing' : cannot convert from 'const char [1]' to 'int'
1> There is no context in which this conversion is possible
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(40) : error C2059: syntax error : 'constant'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(40) : error C2059: syntax error : ')'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(40) : error C2059: syntax error : 'delete'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(44) : error C2544: expected ')' for operator '()'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(44) : error C2146: syntax error : missing ';' before identifier 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(44) : warning C4229: anachronism used : modifiers on data are ignored
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(44) : error C2182: '()' : illegal use of type 'void'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(44) : error C2086: 'int ()' : redefinition
1> c:\program files\microsoft visual studio 9.0\vc\include\new(51) : see declaration of '()'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(44) : error C2457: '__FUNCTION__': predefined macro cannot appear outside of a function body
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(44) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(44) : error C2365: 'm_setOwner' : redefinition; previous definition was 'function'
1> c:\dev\inc\mmgr.h(95) : see declaration of 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(44) : error C2078: too many initializers
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(44) : error C2440: 'initializing' : cannot convert from 'const char [1]' to 'int'
1> There is no context in which this conversion is possible
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(44) : error C2059: syntax error : 'constant'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(44) : error C2059: syntax error : ')'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(44) : error C2059: syntax error : 'delete'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(143) : error C2544: expected ')' for operator '()'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(143) : error C2146: syntax error : missing ';' before identifier 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(143) : warning C4229: anachronism used : modifiers on data are ignored
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(143) : error C2059: syntax error : 'string'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(143) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(143) : error C2059: syntax error : 'constant'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(143) : warning C4183: 'm_setOwner': missing return type; assumed to be a member function returning 'int'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(143) : error C2059: syntax error : '?'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(143) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(149) : error C2544: expected ')' for operator '()'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(149) : error C2146: syntax error : missing ';' before identifier 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(149) : warning C4229: anachronism used : modifiers on data are ignored
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(149) : error C2086: 'void *std::locale::facet::()' : redefinition
1> c:\program files\microsoft visual studio 9.0\vc\include\xlocale(143) : see declaration of 'std::locale::facet::()'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(149) : error C2059: syntax error : 'string'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(149) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(149) : error C2535: 'int std::locale::facet::m_setOwner(void)' : member function already defined or declared
1> c:\program files\microsoft visual studio 9.0\vc\include\xlocale(143) : see declaration of 'std::locale::facet::m_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(149) : error C2059: syntax error : 'constant'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(149) : warning C4183: 'm_setOwner': missing return type; assumed to be a member function returning 'int'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(149) : error C2059: syntax error : '?'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(149) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(155) : error C2544: expected ')' for operator '()'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(155) : error C2146: syntax error : missing ';' before identifier 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(155) : warning C4229: anachronism used : modifiers on data are ignored
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(155) : error C2182: '()' : illegal use of type 'void'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(155) : error C2040: 'std::locale::facet::()' : 'int' differs in levels of indirection from 'void *'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(155) : error C2059: syntax error : 'string'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(155) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(155) : error C2535: 'int std::locale::facet::m_setOwner(void)' : member function already defined or declared
1> c:\program files\microsoft visual studio 9.0\vc\include\xlocale(143) : see declaration of 'std::locale::facet::m_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(155) : error C2059: syntax error : 'constant'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(155) : warning C4183: 'm_setOwner': missing return type; assumed to be a member function returning 'int'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(155) : error C2059: syntax error : '?'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(155) : fatal error C1003: error count exceeds 100; stopping compilation
1>DatabaseAdaptor.cpp
1>c:\dev\inc\mmgr.h(41) : warning C4117: macro name '__FUNCTION__' is reserved, '#define' ignored
1>c:\program files\microsoft visual studio 9.0\vc\include\new(51) : error C2544: expected ')' for operator '()'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(51) : error C2146: syntax error : missing ';' before identifier 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(51) : warning C4229: anachronism used : modifiers on data are ignored
1>c:\program files\microsoft visual studio 9.0\vc\include\new(51) : error C2182: '()' : illegal use of type 'void'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(51) : error C2457: '__FUNCTION__': predefined macro cannot appear outside of a function body
1>c:\program files\microsoft visual studio 9.0\vc\include\new(51) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\include\new(51) : error C2365: 'm_setOwner' : redefinition; previous definition was 'function'
1> c:\dev\inc\mmgr.h(95) : see declaration of 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(51) : error C2078: too many initializers
1>c:\program files\microsoft visual studio 9.0\vc\include\new(51) : error C2440: 'initializing' : cannot convert from 'const char [1]' to 'int'
1> There is no context in which this conversion is possible
1>c:\program files\microsoft visual studio 9.0\vc\include\new(51) : error C2059: syntax error : 'constant'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(51) : error C2059: syntax error : ')'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(51) : error C2059: syntax error : 'delete'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : error C2544: expected ')' for operator '()'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : error C2146: syntax error : missing ';' before identifier 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : warning C4229: anachronism used : modifiers on data are ignored
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : error C2182: '()' : illegal use of type 'void'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : error C2433: '()' : 'inline' not permitted on data declarations
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : error C2086: 'int ()' : redefinition
1> c:\program files\microsoft visual studio 9.0\vc\include\new(51) : see declaration of '()'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : error C2457: '__FUNCTION__': predefined macro cannot appear outside of a function body
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : error C2365: 'm_setOwner' : redefinition; previous definition was 'function'
1> c:\dev\inc\mmgr.h(95) : see declaration of 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : error C2078: too many initializers
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : error C2440: 'initializing' : cannot convert from 'const char [1]' to 'int'
1> There is no context in which this conversion is possible
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : error C2059: syntax error : 'constant'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : error C2059: syntax error : ')'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(74) : error C2059: syntax error : 'delete'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(75) : error C2143: syntax error : missing ';' before '{'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(75) : error C2447: '{' : missing function header (old-style formal list?)
1>c:\program files\microsoft visual studio 9.0\vc\include\new(79) : error C2544: expected ')' for operator '()'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(79) : error C2146: syntax error : missing ';' before identifier 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(79) : warning C4229: anachronism used : modifiers on data are ignored
1>c:\program files\microsoft visual studio 9.0\vc\include\new(79) : error C2182: '()' : illegal use of type 'void'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(79) : error C2086: 'int ()' : redefinition
1> c:\program files\microsoft visual studio 9.0\vc\include\new(51) : see declaration of '()'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(79) : error C2457: '__FUNCTION__': predefined macro cannot appear outside of a function body
1>c:\program files\microsoft visual studio 9.0\vc\include\new(79) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\include\new(79) : error C2365: 'm_setOwner' : redefinition; previous definition was 'function'
1> c:\dev\inc\mmgr.h(95) : see declaration of 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(79) : error C2078: too many initializers
1>c:\program files\microsoft visual studio 9.0\vc\include\new(79) : error C2440: 'initializing' : cannot convert from 'const char [1]' to 'int'
1> There is no context in which this conversion is possible
1>c:\program files\microsoft visual studio 9.0\vc\include\new(79) : error C2059: syntax error : 'constant'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(79) : error C2059: syntax error : ')'
1>c:\program files\microsoft visual studio 9.0\vc\include\new(79) : error C2059: syntax error : 'delete'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(32) : error C2544: expected ')' for operator '()'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(32) : error C2146: syntax error : missing ';' before identifier 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(32) : warning C4229: anachronism used : modifiers on data are ignored
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(32) : error C2040: '()' : 'void *' differs in levels of indirection from 'int'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(32) : error C3453: 'vc_attributes::Post': attribute not applied because qualifier 'returnvalue' did not match
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(32) : error C2457: '__FUNCTION__': predefined macro cannot appear outside of a function body
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(32) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(32) : error C2365: 'm_setOwner' : redefinition; previous definition was 'function'
1> c:\dev\inc\mmgr.h(95) : see declaration of 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(32) : error C2078: too many initializers
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(32) : error C2440: 'initializing' : cannot convert from 'const char [1]' to 'int'
1> There is no context in which this conversion is possible
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(32) : error C2059: syntax error : 'constant'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(32) : error C2059: syntax error : ')'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(32) : error C2059: syntax error : 'new'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(36) : error C2544: expected ')' for operator '()'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(36) : error C2146: syntax error : missing ';' before identifier 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(36) : warning C4229: anachronism used : modifiers on data are ignored
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(36) : error C2040: '()' : 'void *' differs in levels of indirection from 'int'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(36) : error C3453: 'vc_attributes::Post': attribute not applied because qualifier 'returnvalue' did not match
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(36) : error C2457: '__FUNCTION__': predefined macro cannot appear outside of a function body
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(36) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(36) : error C2365: 'm_setOwner' : redefinition; previous definition was 'function'
1> c:\dev\inc\mmgr.h(95) : see declaration of 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(36) : error C2078: too many initializers
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(36) : error C2440: 'initializing' : cannot convert from 'const char [1]' to 'int'
1> There is no context in which this conversion is possible
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(36) : error C2059: syntax error : 'constant'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(36) : error C2059: syntax error : ')'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(36) : error C2059: syntax error : 'new'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(40) : error C2544: expected ')' for operator '()'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(40) : error C2146: syntax error : missing ';' before identifier 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(40) : warning C4229: anachronism used : modifiers on data are ignored
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(40) : error C2182: '()' : illegal use of type 'void'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(40) : error C2086: 'int ()' : redefinition
1> c:\program files\microsoft visual studio 9.0\vc\include\new(51) : see declaration of '()'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(40) : error C2457: '__FUNCTION__': predefined macro cannot appear outside of a function body
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(40) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(40) : error C2365: 'm_setOwner' : redefinition; previous definition was 'function'
1> c:\dev\inc\mmgr.h(95) : see declaration of 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(40) : error C2078: too many initializers
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(40) : error C2440: 'initializing' : cannot convert from 'const char [1]' to 'int'
1> There is no context in which this conversion is possible
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(40) : error C2059: syntax error : 'constant'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(40) : error C2059: syntax error : ')'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(40) : error C2059: syntax error : 'delete'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(44) : error C2544: expected ')' for operator '()'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(44) : error C2146: syntax error : missing ';' before identifier 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(44) : warning C4229: anachronism used : modifiers on data are ignored
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(44) : error C2182: '()' : illegal use of type 'void'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(44) : error C2086: 'int ()' : redefinition
1> c:\program files\microsoft visual studio 9.0\vc\include\new(51) : see declaration of '()'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(44) : error C2457: '__FUNCTION__': predefined macro cannot appear outside of a function body
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(44) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(44) : error C2365: 'm_setOwner' : redefinition; previous definition was 'function'
1> c:\dev\inc\mmgr.h(95) : see declaration of 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(44) : error C2078: too many initializers
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(44) : error C2440: 'initializing' : cannot convert from 'const char [1]' to 'int'
1> There is no context in which this conversion is possible
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(44) : error C2059: syntax error : 'constant'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(44) : error C2059: syntax error : ')'
1>c:\program files\microsoft visual studio 9.0\vc\include\xdebug(44) : error C2059: syntax error : 'delete'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(143) : error C2544: expected ')' for operator '()'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(143) : error C2146: syntax error : missing ';' before identifier 'm_setOwner'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(143) : warning C4229: anachronism used : modifiers on data are ignored
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(143) : error C2059: syntax error : 'string'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(143) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(143) : error C2059: syntax error : 'constant'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(143) : warning C4183: 'm_setOwner': missing return type; assumed to be a member function returning 'int'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(143) : error C2059: syntax error : '?'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(143) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(149) : error C2544: expected ')' for operator '()'
1>c:\program files\microsoft visual studio 9.0\vc\include\xlocale(149) : error C2146: syntax error : missing ';' before identifier 'm_setOwner'

Share this post


Link to post
Share on other sites
Hello again gentlemen,

FANTASTIC! it looks like I have found a probem - I removed all the #include "mmgr.h" directives in the source and it looks like the code is now being used! I have found an allocation/deallocation mismatch - I am pretty sure I am now on the right track to using this amazing software!

Many many thanks. I had a feeling that game programmers would be the best and most helpful!

Best,
Mike

Share this post


Link to post
Share on other sites
Yeah, I've not used it since the VC6 days, and I'm sure there will be some challenges in getting it to work with VC2005+ but it sounds like you're on your way.

Maybe when I get some time I can drop it in a test project and see how it goes.

Good Luck =)

-=[ Megahertz ]=-

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement