Page 1 of 1

Game crashes on very last line ( return 0)

PostPosted: Mar 11, 2003 @ 5:43pm
by Conan
When I exit from my in-development game I get an exception with error number -1073741819
This happens on the ARM release, the VC6 Debug but not the VC6 release version.

I'm guessing that it's something to do with not releasing memory but I have delete'd everything I new'ed. Does anyone have any pointers ( no pun intended )

for example my main arrays are created like this :-
system_data *systems;
systems = new system_data[MAX_SYSTEM];
and deleted with:-
delete systems;

PostPosted: Mar 11, 2003 @ 7:21pm
by gersen

debugging continued

PostPosted: Mar 11, 2003 @ 7:41pm
by Conan
Thanks, I needed to know that & have now implemented []. It does not stop the crash however. I did get my VC6 debug build to stop crashing by removing one of the delete's so it may be that there's more stuff in there that's wrong.

I also get asked for the path to DBGDEL.CPP which I can't find on my VC6 or eVC setup.

Pixel shader demo also crashes

PostPosted: Mar 11, 2003 @ 9:28pm
by Conan

PostPosted: Mar 12, 2003 @ 7:28am
by adde
First of all, I would like to point out that (as with almost all other operators) the delete [] can also be written as delete[].

Then, here's what I think is wrong with your code. -1073741819 is the same as 0xC0000005 which is the "access violation" error code. And since the debugger fails during a delete (This is why it asks for the dbgdel.cpp. It wants the debug information for the delete function.) there are two possible scenarios:

1. You are using threads and forgot to link your project to the MT version of the runtime library (CLIB). If the single thread version of the runtime library is used with multiple threads that use new and delete you will get race conditions since they will all use the same heap to allocate/deallocate memory. On my platform SDK for eVC however, I only have one library to link to (=CE Runtime) and I think it's the same for all WinCE platforms. This library is an MT library so this can't be the problem.

2. You used the pointer (or array) to write outside the allocated memory area. Sometimes the debugger doesn't report this as an access error until you try to delete the array and this is what I think happened.

So, take a close look at your code and double check every access to the array that caused the error. My bet is that you used an illegal array index somewhere.

thanks for the advice

PostPosted: Mar 12, 2003 @ 8:48am
by Conan
Thanks Adde, you may be correct with the secord suggestion. If so this may mean that somewhere either PF or my own code is being naughty with arrays. I will find out how best to debug this kind of problem & get on it.

thanks for the advice

PostPosted: Mar 12, 2003 @ 8:54am
by Kzinti

PostPosted: Mar 12, 2003 @ 12:42pm
by refractor

problem fixed

PostPosted: Mar 17, 2003 @ 9:37am
by Conan