Heya, just a little question...

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
Nogard
Posts: 14
Joined: July 5th, 2012, 4:03 am

Heya, just a little question...

Post by Nogard » July 18th, 2012, 3:17 pm

Hey, it's me again, the boring guy of the giant texts! Haha, Well, i haven't finished yet the lessons, i'm on 15, but i will see the 16 and 17 before finish, anyway, i just started another project, another game...

This time it's something really bigger than my first, i'm still doing the mechanics, using tons of arrays, structs and enums, and a damned math haha... But i had a small problem that made me curious, the game don't have anything yet, just the logic, no drawing, so, about 90% of the code remains "untestable" ( i have know idea if you can understand this word, but... i hope you did... ).

But, i made some junk at the Compose frame that i will fully delete before finish, just to test if the logics were working, and i think everything went fine. Buuuut... The game itself don't crash, but when you close the game ( hitting the red cross of death ) it shows something weird like that:

"A buffer overrun has occurred in Wow-Arena.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program."

Can anyone of you guys tell me more about "buffer overrun"s? I tried to find out what was the problem and then the machine just said me that there was something wrong about this:

Code: Select all

#if defined (_CRTBLD) && !defined (_SYSCRT)
    DebuggerWasPresent = IsDebuggerPresent();
    _CRT_DEBUGGER_HOOK(_CRT_DEBUGGER_GSFAILURE);
#endif  /* defined (_CRTBLD) && !defined (_SYSCRT) */

    /* Make sure any filter already in place is deleted. */
    SetUnhandledExceptionFilter(NULL);

    UnhandledExceptionFilter((EXCEPTION_POINTERS *)&GS_ExceptionPointers);
Well, i just want to know a little bit about this Buffer Overrun, the problem i can fix later, because i'm almost sure where the problem is, if i don't find the fix, then i come back here again to ask you guys for help, but for now, i just want to know about the buffer... =P
[/color]

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Heya, just a little question...

Post by LuX » July 18th, 2012, 6:10 pm

Most likely means you are accessing out side the boundaries of an array, and since RAM is just one continuous mess of memory, you might accidentally access another programs memory.

Remember that when you make an array: "int intarr [10]", the slots of "intarr" is not 1-10 but 0-9.
ʕ •ᴥ•ʔ

Nogard
Posts: 14
Joined: July 5th, 2012, 4:03 am

Re: Heya, just a little question...

Post by Nogard » July 19th, 2012, 6:52 am

Yeah yeah, i always remember that the arrays begins at 0 and ends at ( n - 1 )... Thats weird because i'm pretty sure there is nothing trying to access some "ultrapassing array number", but... For sure, there is a real insane number of arrays/structures, and even structures (that have arrays in its components) with arrays... Can that be the mistake?

There are lots of enums too, i think there is some error on the structures, everything is working, but, this structures are insane, they have tons of components and each structure takes a lot of data, so, i probably mess something up with them.

Buuuut, can it be something else? Because i'm coding very carefully about this arrays, because i already know that there is a high chance to miss something with this amount of arrays/structures...

Anyway, thank you! I'm going to review all the code trying to find some "ultrapassing array number", ;)

Nogard
Posts: 14
Joined: July 5th, 2012, 4:03 am

Re: Heya, just a little question...

Post by Nogard » July 19th, 2012, 9:27 am

Well, nevermind, i just found the error, it was because i was testing some functions, and this functions were calling other functions that contains some values that weren't declared, i just "commented" the functions and tested again, and no buffer overrun! Then uncommented and debugg again to make sure, and there was it, the buffer overrun. :P

Well, i think i just finished the organization, the definitions of the game, now i can start making it...

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Heya, just a little question...

Post by chili » July 20th, 2012, 3:20 am

Good luck. ;)
Chili

Post Reply