Welcome! Log In Create A New Profile

Advanced

reasons for a code dump

Posted by g_man 
reasons for a code dump
November 29, 2010 02:53AM
I've been having a lot of issues with code dumps in my code, and I don't really know all the reasons why they would happen. I have a slight idea, but I was wondering if I could get a concrete answer to the question, what can cause a code dump. Examples would be nice also.
Thank you
Re: reasons for a code dump
November 29, 2010 06:15AM
The usual c/c++ bad allocation, overrun and corruptions.

see :- [www.yolinux.com]
Re: reasons for a code dump
November 29, 2010 10:59AM
Just to name a few:
-Forgetting to initialize a pointer (works sometimes, failes at random times)
-Dangling pointer (using a pointer to already freed memory)
-Freeing the same pointer twice (not sure what happens, but it is bad)
-Stack corruption (buffer overflow on the stack can cause all kind of havoc)

I had a strange case of dumps when I tried to allocate way more memory then the Wii has. Or negative amounts of memory.

If your code also can run in Linux then I recommend Valgrind: [valgrind.org] which can detect most of these errors at the location where they happen instead of the final result of the error.

EDIT: Might be that a division by 0 also causes a dump. But could have been a different platform.



Edited 1 time(s). Last edit at 11/29/2010 11:01AM by Daid.
Sorry, only registered users may post in this forum.

Click here to login