Game Development Community

Crash when opening Mission Editor due to bug in GuiTextEditCtrl?

by James Spellman · in Torque Game Engine · 10/08/2007 (11:19 am) · 4 replies

We have a mission that started crashing when you open the mission editor. Try as I might, I was not able to track it down to any one thing. Then after using a Release build with debug symbols, it finally pointed me to GuiTextEditCtrl::updateHistory.

The code:
const UTF16* txt = inTxt->getPtr();

   if(!txt)
      return;
seems to imply that txt could be NULL but I'm betting it never will be. I changed it to if (!dStrlen( txt)).

It looks to be a mostly harmless bug and not related to my crash. FYI, TGEA is written the same way.

Edit: Removed comments about Mem Manager and no more crashing.

#1
10/09/2007 (9:59 am)
This bug may be related to the my bug report about GuiTextEditCtrl:

http://www.garagegames.com/mg/forums/result.thread.php?qt=67826

The only way I was able to fix my crashes was just to disable the entire text edit history functionality.
#2
10/09/2007 (10:39 am)
My actual crash is exactly like you describe. I revised my post to reflect the minor change I made. I will continue my comments in your thread.
#3
10/09/2007 (11:07 am)
Anyone have a repro ?

maybe dynamically create and destroy 1000s of GuiTextEditCtrls on a random schedule ?
#4
10/30/2007 (12:19 pm)
I've seen this kind of crash on startup of the editor, with the txt pointer apparently valid but pointing to a string that starts with '0'. Not sure why it would be adding an empty string (?) to the history, and why add anything on startup anyway. I'm adding the zero length string check mentioned, hoping it will reduce this infrequent crash.