Well I've found a reproducable crash I have no idea what is causing it.
Code:
> omnibot_ff.dll!gmGCObjBase::SetNext(gmGCObjBase * a_next=0x23ac930c) Line 101 + 0x29 bytes C++
omnibot_ff.dll!gmGCColorSet::GrayThisObject(gmGCObjBase * a_obj=0x23ac930c) Line 220 C++
omnibot_ff.dll!gmGCColorSet::GrayAWhite(gmGCObjBase * a_obj=0x23ac930c) Line 389 C++
omnibot_ff.dll!gmGarbageCollector::GetNextObject(gmGCObjBase * a_obj=0x23ac930c) Line 289 + 0x32 bytes C++
omnibot_ff.dll!gmMachine::ScanRootsCallBack(gmMachine * a_machine=0x21fd9aa0, gmGarbageCollector * a_gc=0x23ac9228) Line 174 C++
omnibot_ff.dll!gmGarbageCollector::Collect() Line 546 + 0x1b bytes C++
omnibot_ff.dll!gmMachine::CollectGarbage(bool a_forceFullCollect=false) Line 1203 + 0xb bytes C++
omnibot_ff.dll!gmMachine::Execute(unsigned int a_delta=15) Line 1051 C++
omnibot_ff.dll!ScriptManager::Update() Line 214 C++
I've tracked it to this code
Function is:
Code:
typedef std::vector<String> StringVector;
int CommandReciever::DispatchCommand(const StringVector &_tokList)
I've verified the toklist has a valid string in it.
gmMachine *pMachine = ScriptManager::GetInstance()->GetMachine();
gmTableObject *pCommandsTable = ScriptManager::GetInstance()->GetGlobalCommandsTable(); // treturns "Commands" table under the global table
if(pCommandsTable)
{
pMachine->EnableGC(false);
gmCall call;
if(call.BeginTableFunction(pMachine, _tokList[0].c_str(), pCommandsTable))
{
// Add all the params
gmTableObject *pParamTable = pMachine->AllocTableObject();
if(_tokList.size() > 1)
{
for(obuint32 i = 1; i < _tokList.size(); ++i)
{
pParamTable->Set(pMachine, i-1, gmVariable(pMachine->AllocStringObject(_tokList[i].c_str())));
}
}
call.AddParamTable(pParamTable);
call.End();
}
pMachine->EnableGC(true);
return 1;
}
The actual BeginTableFunction ends up failing due to functions not existing that matches the provided name, which is fine. The crash is apparently due to BeginTableFunction because that's the only thing that gets hit.
Even if I commented out the Disable and Enable of the GC it still crashes.
I don't know why this is happening. If I try a BeginTableFunction on a table after the init of the script system it works fine.