Jump to content
  • Advertisement
Sign in to follow this  
spirre

Memory errors ?

This topic is 4877 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 When i quit my app i get this error message: First-chance exception at 0x0067a702 (msvcr71d.dll) in gamey.exe: 0xC0000005: Access violation reading location 0x2ba89688. Unhandled exception at 0x0067a702 (msvcr71d.dll) in gamey.exe: 0xC0000005: Access violation reading location 0x2ba89688. this is my stack trace: > msvcr71d.dll!CheckBytes(unsigned char * pb=0x2ba89688, unsigned char bCheck='ý', unsigned int nSize=3) Line 1455 + 0x7 C msvcr71d.dll!_free_dbg_lk(void * pUserData=0x15d1cab0, int nBlockUse=1) Line 1150 + 0x1b C msvcr71d.dll!_free_dbg(void * pUserData=0x15d1cab0, int nBlockUse=1) Line 1070 + 0xd C msvcr71d.dll!free(void * pUserData=0x15d1cab0) Line 1025 + 0xb C It breaks on line 1455 in dbgheap.c static int __cdecl CheckBytes( unsigned char * pb, unsigned char bCheck, size_t nSize ) { int bOkay = TRUE; while (nSize--) { if (*pb++ != bCheck) // <-- breaks here { /* Internal error report is just noise; calling functions all report results - JWM */ /* _RPT3(_CRT_WARN, "memory check error at 0x%p = 0x%02X, should be 0x%02X.\n", */ /* (BYTE *)(pb-1),*(pb-1), bCheck); */ bOkay = FALSE; } } return bOkay; } anybody got any ideas ?

Share this post


Link to post
Share on other sites
Advertisement
Probably a pointer problem. Make sure your not deleting a NULL pointer. Also if you are using DirectX per chance then make sure you are release()'ing all COM objects and Addref()'ing them as appropriate.

ace

Share this post


Link to post
Share on other sites
it's almost 99.9% certain that the CRT code you list isn't where the bug is.
this particular block of code makes up the CRT's built in memory overwrite
checking. this check commonly occurs when you free memory or when the CRT
deinitializes (not sure which one).

you need to find a pointer or array in your program trying to write past
its own memory bounds. (aka stray-pointer-syndrome)

could you possibly list more of your call-stack?
of even show us the code where you free/delete the memory you use.

Share this post


Link to post
Share on other sites
Quote:
Original post by ace_lovegrove
Probably a pointer problem. Make sure your not deleting a NULL pointer.
it is perfectly legal to delete or delete [] a NULL pointer, it is guaranteed a No-Op by conformance to the C++ standard.

Share this post


Link to post
Share on other sites
I abandoned the arrays, and used std::vector instead, and now I don't get any errors.

thanks anyways!

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!