Game Development Community

Scripting language bug, or scripter "incompetence"?

by Chris \"Hobbiticus\" Weiland · in Torque Game Engine · 10/08/2003 (8:42 pm) · 2 replies

So, our servers were crashing a lot whenever the flag was capped out. We just could not figure out what the problem was. Finally tonight, I took a shot in the dark and realized something about the call stack in the console trace. The game function for capping a flag would call GenericGame::endGame() if the score limit was reached. However, somewhere in the execution of endGame() it would delete the game and schedule a new one to start. I think that when the scripting language tried to go back down the stack, some sort of error happened (a null pointer, perhaps), and crashed the server. So, I made anything that could call endGame() to call to EndTheGame, which which would SCHEDULE a call to GenericGame::endGame(), and it seems to be stable again.

Mind you that this did NOT happen in a debug build ever. ONLY release builds. I'm still not completely sure if I actually fixed it or not, but it seemed to be pretty stable after about 5-6 map changes, where it would undoubtably crash in 2-3.

So, is this "intentional" or a bug?

#1
10/09/2003 (5:37 am)
Having to schedule the deletion of the game (instead of deleting it out from underneath oneself) seems reasonable.

Perhaps in debug build the pointers are getting NULLed on deletion, while in releease, they're not?
#2
10/09/2003 (5:49 am)
I had a similar problem in DEDICATED using a modified version of Daniel Neilsen's "game types" resource... there was one "endGame()" too much somewhere and the server would crash while trying to loop through the missions... so I think I just deleted the call to the global "endGame()" function somewhere, but I dont know 100% anymore... :/
but yeah, it worked in normal release and debug builds...