Jump to content
  • Advertisement
Sign in to follow this  
ChrisPepper1989

Heap Corruption, Addresses and Map files how to use them?

This topic is 2614 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

Hi Everyone,

I'm sure ive done this before but i cant for the life of me remember how! when you get a nice Heap Corruption and it gives you an address is it not possible to match that up with something in a vs generated map file? to help locate where it happens? or am i just imagining this? im sure there is a way of using that address?

I know you can also add a breakpoint on an adress in visual studio, can anybody tell me if there is a equivalent in WinDbg? I'm a complete noob at kernel debugging and i havent got familiar with the WinDBG environment at all!

I'm currently trying the define trick mentioned on here to see if this can help me track it down.

i would appreciate any help!

Thank you, Chris

- EDIT -

dur! i remember now in my old work it used to dump the map address in the debug window, and in this situation if i click "Retry" a very map looking address pops up in the winDebug! hopefully this will help me find the error!

- EDIT -

Share this post


Link to post
Share on other sites
Advertisement
The map file would only contain the locations of actual code or read-only data segments etc, and that's before any DLLs are rebased as they are loaded, if necessary. It doesn't contain the location of memory that you dynamically allocated on the heap, for example.

Perhaps we can give more help about the direct problem instead.
You're probably more likely to solve the heap corruption by looking at the nature of how and when the memory is corrupted etc. I.e what it is overwritten with, and what was that piece of memory being used for, which parts of your code have run and which haven't.
I'd also go quickly over the code to look for any suspect things like using ZeroMemory(this, sizeof(*this)); on a non-POD class, and look for possible buffer overruns, maybe adding a few asserts. Check for not obeying the rule of three on any classes. Make sure that you allocate enough memory in the places where you allocate memory, check your sizeof's etc.
If you can give more detail, we might find the problem for you and you may learn enough in the process to do the same next time.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!