Jump to content
  • Advertisement
Sign in to follow this  
likeafox

Memory errors I don't understand

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

I'm writing an app using D3D9 and Winsock in C++. There are two memory errors I frequently get when exiting my program: The first that occurs is an "illegal operation". I've narrowed down the cause of it to the line "free(statik);" in my cleanup() function. It seems to crash like this with with all of my dynamically allocated memory, and only when I free it. I'll note that malloc() and realloc() have always worked flawlessly for me. I just don't get it o_O; My second error also occurs when my program is exiting: The instruction at "0x007a6696" referenced memory at "0x007a6696". The memory could not be "written". An alternate version of this I get reads "The memory could not be "read"." Now what I first thought when seeing this is "0x007a6696 == 0x007a6696, that's probably not a good thing, heh", and I figured I had done something stupid like pointing a pointer to itself. I went through all my code and couldn't find anything problematic like that. So now I'm thinking "buffer overflow" or something. I dunno if I'm even in the right ball park, though. Could someone tell me what kind of thing causes an error like this? I'll note that I didn't have this problem until I wrote code for my UDP interface and my client and server started sending packets to eachother

Share this post


Link to post
Share on other sites
Advertisement
You are likely mucking with memory you do not 'own'. Hunt for dangling pointers, double-free and the like.

Share this post


Link to post
Share on other sites
Thanks! That actually fixes my first problem. cleanup(), unknowethly to me, was being called twice.

[Edited by - likeafox on October 9, 2004 1:05:24 AM]

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!