Game Development Community

Random Crash Bug With TGEA 1.8.1 + FGE

by Roland Orr · in Torque Game Engine Advanced · 06/20/2009 (6:24 pm) · 5 replies

ok I am using TGEA 1.8.1 with the Flight Game Example.

I have added the GuiMeterCtrl Resource, AiFlyingVehicle, aiRepairshipFlyingvehicle, FGE Needed Scripts, GuiRadarCtrl, and GuiRecticleHud. All code and scripts have been upgraded by myself to work correctly with TGEA 1.8.1 plus i have added in some bug fixes as posted by GG staff.

The problem i am having is my game will randomly crash, sometimes it crashes when i try and load the mission, sometimes it crashes after i have died and try to respawn (respawn crash), sometimes it crashes for no reason at all, some times is crashes when a AI BOT is spawning, sometimes it will freeze up then throw a none descript windows crash error window.

All video card drivers are up to date
DirectX is up to date
Tried running in compatiblity mode for WinXP SP2 -> no change.

No script errors are reported by the console.

---

The only things i can think of is these:

1) a possible bug in the respawn script
2) a bug in the deleteObject() engine code (running a debug exe shows that the deleteObject() fuction as the last called function before crash in all cases of crashes, however i am not sure what is being deleted or trying to be deleted that is making TGEA barf)

I have tried to fix this issue myself, but after 5 days of this i need help. hopefully someone can shed some light.

any help would be great. Thanks in advance.

#1
06/20/2009 (6:28 pm)
as a side note i have read a few posts here about TGEA+FGE and Win Vista random crashes. I run Windows Vist Home Premium x64, all demo's of TGEA run great, just not FGE+TGEA1.8.1

thanks.
#2
06/20/2009 (7:42 pm)
oh yeah i forgot to mention that i also have the WheeledFlyingVehicle working in TGEA 181 as well. It works great, and if i set my plane up right even the debris system works great.
#3
06/22/2009 (5:55 am)

Have you tried tracing where it crashes? Think the best approach would be to have it run in the debugger and then see where it crashes. If it doesn't crash in debug builds or when running in the debugger, then it's bad but chances are good it does. If you post a stack trace, it would be helpful to see what's going on.
#4
06/22/2009 (8:10 am)
It crashes in both release and debug builds. Maybe the error is easy to see but i am kinda at a lose.

Visual Studio Stack Trace Debug:

"Access Violation Reading Location"

--

> AirHeroes_DEBUG.exe!BitSet32::test(const unsigned int m=8) Line 52 + 0xf bytes C++
AirHeroes_DEBUG.exe!SimObject::deleteObject() Line 485 + 0xd bytes C++
AirHeroes_DEBUG.exe!ShapeBase::setImageState(unsigned int imageSlot=4, unsigned int newState=3722304989, bool force=false) Line 1535 + 0x14 bytes C++
AirHeroes_DEBUG.exe!ShapeBase::updateImageState(unsigned int imageSlot=4, float dt=0.00000000) Line 1708 C++
AirHeroes_DEBUG.exe!ShapeBase::setImageTriggerState(unsigned int imageSlot=4, bool trigger=false) Line 1462 C++
AirHeroes_DEBUG.exe!Vehicle::updateMove(const Move * move=0x0e0a8fd8) Line 869 C++
AirHeroes_DEBUG.exe!WheeledFlyingVehicle::updateMove(const Move * move=0x0e0a8fd8) Line 1078 C++
AirHeroes_DEBUG.exe!Vehicle::processTick(const Move * move=0x0e0a8fd8) Line 648 C++
AirHeroes_DEBUG.exe!WheeledFlyingVehicle::processTick(const Move * move=0x0e0a8fd8) Line 1064 C++
AirHeroes_DEBUG.exe!ServerProcessList::onTickObject(ProcessObject * pobj=0x1153d2e4) Line 352 C++
AirHeroes_DEBUG.exe!ProcessList::advanceObjects() Line 225 C++
AirHeroes_DEBUG.exe!ServerProcessList::advanceObjects() Line 391 C++
AirHeroes_DEBUG.exe!ProcessList::onAdvanceObjects() Line 90 + 0x19 bytes C++
AirHeroes_DEBUG.exe!ProcessList::advanceTime(unsigned int timeDelta=1024) Line 196 + 0xd bytes C++
AirHeroes_DEBUG.exe!serverProcess(unsigned int timeDelta=1024) Line 218 + 0xe bytes C++
AirHeroes_DEBUG.exe!processTimeEvent(int elapsedTime=1024) Line 80 + 0x9 bytes C++
AirHeroes_DEBUG.exe!fastdelegate::FastDelegate1<int,void>::InvokeStaticFunction(int p1=3359) Line 1021 + 0xe bytes C++
AirHeroes_DEBUG.exe!fastdelegate::FastDelegate1<int,void>::operator()(int p1=3359) Line 993 + 0x1a bytes C++
AirHeroes_DEBUG.exe!Signal<void __cdecl(int)>::trigger(int a=3359) Line 354 C++
AirHeroes_DEBUG.exe!Journal::Call<Signal<void __cdecl(int)>,int>(Signal<void __cdecl(int)> * obj=0x03fac578, void (int)* method=0x007d7c6f, int a=3359) Line 540 + 0xa8 bytes C++
AirHeroes_DEBUG.exe!JournaledSignal<void __cdecl(int)>::trigger(int a=3359) Line 52 + 0x12 bytes C++
AirHeroes_DEBUG.exe!TimeManager::_updateTime() Line 30 C++
AirHeroes_DEBUG.exe!fastdelegate::FastDelegate0<void>::operator()() Line 908 + 0x16 bytes C++
AirHeroes_DEBUG.exe!Signal<void __cdecl(void)>::trigger() Line 338 C++
AirHeroes_DEBUG.exe!Process::processEvents() Line 53 C++
AirHeroes_DEBUG.exe!StandardMainLoop::doMainLoop() Line 468 + 0x5 bytes C++
AirHeroes_DEBUG.exe!TorqueMain(int argc=1, const char * * argv=0x036751b8) Line 35 + 0x5 bytes C++
AirHeroes_DEBUG.exe!run(int argc=1, const char * * argv=0x036751b8) Line 279 + 0xd bytes C++
AirHeroes_DEBUG.exe!WinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * __formal=0x00000000, char * lpszCmdLine=0x01432d30, HINSTANCE__ * __formal=0x00000000) Line 343 + 0x17 bytes C++
AirHeroes_DEBUG.exe!__tmainCRTStartup() Line 263 + 0x2c bytes C
AirHeroes_DEBUG.exe!WinMainCRTStartup() Line 182 C
kernel32.dll!7715e4a5()
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
ntdll.dll!777ccfed()
ntdll.dll!777cd1ff()
#5
06/22/2009 (8:34 am)
Apparently it tries to delete an invalid SimObject reference. Have you modified the setImageState method? In stock 1.8.0 it doesn't trigger a call to deleteObject() directly and skimming over it, I could find no place that would implicitly trigger the call.

Anyways, the next step is to find out why the SimObject reference is invalid. What kind of object is it? Has it been already deleted somewhere else before? Where does the reference come from?

If it is stored somewhere as a plain SimObject*, then it often helps to turn that into a SimObjectPtr which will get nulled out if the object goes away. If it is correct for the object to have died by the time the deleteObject() happens above, then simply check for NULL and delete only if the object is still there.