Open nev7n opened 6 years ago
Reproduction steps:
Tried this in 3.10 and it doesn't cause a crash.
The exception is thrown as it reads the gui file and tries to create the GuiObjectView.
Exception thrown: read access violation, call stack...
elements_DEBUG.exe!String::c_str() Line 631 C++ elements_DEBUG.exe!LightManager::getId() Line 99 C++ elements_DEBUG.exe!ProcessedShaderMaterial::_determineFeatures(unsigned int stageNum, MaterialFeatureData & fd, const FeatureSet & features) Line 319 C++ elements_DEBUG.exe!ProcessedShaderMaterial::init(const FeatureSet & features, const GFXVertexFormat * vertexFormat, const fastdelegate::FastDelegate<void __cdecl(ProcessedMaterial *,unsigned int,MaterialFeatureData &,FeatureSet const &)> & featuresDelegate) Line 197 C++ elements_DEBUG.exe!MatInstance::processMaterial() Line 372 C++ elements_DEBUG.exe!MatInstance::init(const FeatureSet & features, const GFXVertexFormat * vertexFormat) Line 285 C++ elements_DEBUG.exe!MaterialList::initMatInstances(const FeatureSet & features, const GFXVertexFormat * vertexFormat) Line 393 C++ elements_DEBUG.exe!TSShapeInstance::initMaterialList(const FeatureSet * features) Line 283 C++ elements_DEBUG.exe!TSShapeInstance::setMaterialList(TSMaterialList * matList) Line 253 C++ elements_DEBUG.exe!TSShapeInstance::buildInstanceData(TSShape * _shape, bool loadMaterials) Line 182 C++ elements_DEBUG.exe!TSShapeInstance::TSShapeInstance(const Resource<TSShape> & shape, bool loadMaterials) Line 122 C++ elements_DEBUG.exe!GuiObjectView::setObjectModel(const String & modelName) Line 361 C++ elements_DEBUG.exe!GuiObjectView::onStaticModified(const char * slotName, const char * newValue) Line 214 C++ elements_DEBUG.exe!SimObject::setDataField(const char * slotName, const char * array, const char * value) Line 942 C++ elements_DEBUG.exe!CodeBlock::exec(unsigned int ip, const char * functionName, Namespace * thisNamespace, unsigned int argc, ConsoleValueRef * argv, bool noCalls, const char * packageName, int setFrame) Line 1579 C++ elements_DEBUG.exe!CodeBlock::compileExec(const char * fileName, const char * inString, bool noCalls, int setFrame) Line 672 C++ elements_DEBUG.exe!Con::executeFile(const char * fileName, bool noCalls, bool journalScript) Line 1435 C++ elements_DEBUG.exe!_fnexecimpl(const char * fileName, bool noCalls, bool journalScript) Line 2368 C++ elements_DEBUG.exe!engineAPI::detail::ThunkHelpers<1,bool,char const *,bool,bool>::dispatchHelper<0,1,2>(int argc, ConsoleValueRef * argv, bool(*)(const char *, bool, bool) fn, const _EngineFunctionDefaultArguments<void __cdecl(char const *,bool,bool)> & defaultArgs, engineAPI::detail::ThunkHelpers<1,bool,char const *,bool,bool>::Seq<0,1,2> __formal) Line 560 C++ elements_DEBUG.exe!_EngineConsoleThunk<1,bool __cdecl(char const *,bool,bool)>::thunk(int argc, ConsoleValueRef * argv, bool(*)(const char *, bool, bool) fn, const _EngineFunctionDefaultArguments<void __cdecl(char const *,bool,bool)> & defaultArgs) Line 606 C++ elements_DEBUG.exe!_execcaster(SimObject * __formal, int argc, ConsoleValueRef * argv) Line 2354 C++ elements_DEBUG.exe!CodeBlock::exec(unsigned int ip, const char * functionName, Namespace * thisNamespace, unsigned int argc, ConsoleValueRef * argv, bool noCalls, const char * packageName, int setFrame) Line 1969 C++ elements_DEBUG.exe!Namespace::Entry::execute(int argc, ConsoleValueRef * argv, ExprEvalState * state) Line 1391 C++ elements_DEBUG.exe!Con::_internalExecute(SimObject * object, int argc, ConsoleValueRef * argv, bool thisCallOnly) Line 1584 C++ elements_DEBUG.exe!_BaseEngineConsoleCallbackHelper::_exec() Line 2710 C++ elements_DEBUG.exe!_EngineConsoleExecCallbackHelper<SimSet *>::call<ConsoleValueRef,char const *>(const char * simCB) Line 1252 C++ elements_DEBUG.exe!Con::executef<SimSet *,char const *>(SimSet * r, const char * <argTs_0>) Line 919 C++ elements_DEBUG.exe!ModuleManager::loadModuleGroup(const char * pModuleGroup) Line 446 C++ elements_DEBUG.exe!_ModuleManagerloadGroupframe::_exec(const char * pModuleGroup) Line 68 C++ elements_DEBUG.exe!engineAPI::detail::ThunkHelpers<2,bool,char const *>::dispatchHelper<_ModuleManagerloadGroupframe,0>(int argc, ConsoleValueRef * argv, bool(const _ModuleManagerloadGroupframe::*)(const char *) fn, _ModuleManagerloadGroupframe * frame, const _EngineFunctionDefaultArguments<void __cdecl(ModuleManager *,char const *)> & defaultArgs, engineAPI::detail::ThunkHelpers<2,bool,char const *>::Seq<0> __formal) Line 565 C++ elements_DEBUG.exe!_EngineConsoleThunk<2,bool __cdecl(char const *)>::thunk<_ModuleManagerloadGroupframe>(int argc, ConsoleValueRef * argv, bool(const _ModuleManagerloadGroupframe::*)(const char *) fn, _ModuleManagerloadGroupframe * frame, const _EngineFunctionDefaultArguments<void __cdecl(ModuleManager *,char const *)> & defaultArgs) Line 611 C++ elements_DEBUG.exe!_ModuleManagerloadGroupcaster(SimObject * object, int argc, ConsoleValueRef * argv) Line 61 C++ elements_DEBUG.exe!CodeBlock::exec(unsigned int ip, const char * functionName, Namespace * thisNamespace, unsigned int argc, ConsoleValueRef * argv, bool noCalls, const char * packageName, int setFrame) Line 1969 C++ elements_DEBUG.exe!CodeBlock::compileExec(const char * fileName, const char * inString, bool noCalls, int setFrame) Line 672 C++ elements_DEBUG.exe!Con::evaluate(const char * string, bool echo, const char * fileName) Line 1467 C++ elements_DEBUG.exe!StandardMainLoop::handleCommandLine(int argc, const char * * argv) Line 560 C++ elements_DEBUG.exe!TorqueMain(int argc, const char * * argv) Line 307 C++ elements_DEBUG.exe!run(int argc, const char * * argv) Line 336 C++ elements_DEBUG.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * __formal, char * lpszCmdLine, int __formal) Line 394 C++
Looks like it's an initialization order issue. I know there's some bits with the full template that inits in a less than ideal way and has caused problems like that in the past.
Reproduction steps:
Tried this in 3.10 and it doesn't cause a crash.
The exception is thrown as it reads the gui file and tries to create the GuiObjectView.
Exception thrown: read access violation, call stack...