1.4 Crash in resurrect() on driver change
by Aaron Oneal · in Torque Game Engine · 09/11/2005 (11:04 am) · 8 replies
Running 1.4 on an nVidia GeForce 6800. Pulled from CVS on 9/10. Compiled the SDK and changed main.cs to point to starter.fps. Launched, clicked options, and changed video driver to D3D. Received the following stack trace upon apply. It appears textureName was NULL and it tried to copy anyway. Other values in probe look ok, including probe->next. I found one other post referring to a similar issue, but seeing as how this is a clean install, I'm not sure what's up.
torqueDemo_DEBUG.exe!strcat() Line 173 Asm
torqueDemo_DEBUG.exe!dStrcpy(char * dst=0x0012ddd0, const char * src=0x00000000) Line 138 + 0xd C++
torqueDemo_DEBUG.exe!TextureManager::loadBitmapInstance(const char * textureName=0x00000000) Line 1271 + 0x10 C++
> torqueDemo_DEBUG.exe!TextureManager::resurrect() Line 467 + 0xc C++
torqueDemo_DEBUG.exe!DemoGame::textureResurrect() Line 712 C++
torqueDemo_DEBUG.exe!Video::setDevice(const char * renderName=0x01428af0, unsigned int width=800, unsigned int height=600, unsigned int bpp=0, bool fullScreen=false) Line 303 + 0x12 C++
torqueDemo_DEBUG.exe!csetDisplayDevice(SimObject * __formal=0x01b05cd0, int argc=6, const char * * argv=0x00d06380) Line 37 + 0x1c C++
torqueDemo_DEBUG.exe!CodeBlock::exec(unsigned int ip=1526, const char * functionName=0x01aae5f0, Namespace * thisNamespace=0x01865ce8, unsigned int argc=1, const char * * argv=0x00d06380, bool noCalls=false, const char * packageName=0x00000000) Line 1043 + 0x20 C++
torqueDemo_DEBUG.exe!CodeBlock::exec(unsigned int ip=8, const char * functionName=0x00000000, Namespace * thisNamespace=0x00000000, unsigned int argc=0, const char * * argv=0x00000000, bool noCalls=false, const char * packageName=0x00000000) Line 969 C++
torqueDemo_DEBUG.exe!CodeBlock::compileExec(const char * fileName=0x00000000, const char * string=0x01aadae0, bool noCalls=false) Line 526 C++
torqueDemo_DEBUG.exe!Con::evaluate(const char * string=0x01aadae0, bool echo=false, const char * fileName=0x00000000) Line 864 C++
torqueDemo_DEBUG.exe!GuiControl::onAction() Line 1206 + 0x13 C++
torqueDemo_DEBUG.exe!GuiButtonBaseCtrl::onAction() Line 299 C++
torqueDemo_DEBUG.exe!GuiButtonBaseCtrl::onMouseUp(const GuiEvent & __formal={...}) Line 207 + 0x10 C++
torqueDemo_DEBUG.exe!GuiCanvas::rootMouseUp(const GuiEvent & event={...}) Line 662 + 0x2e C++
torqueDemo_DEBUG.exe!GuiCanvas::processInputEvent(const InputEvent * event=0x0012f6e4) Line 527 + 0x19 C++
torqueDemo_DEBUG.exe!DemoGame::processInputEvent(InputEvent * event=0x0012f6e4) Line 586 + 0x23 C++
torqueDemo_DEBUG.exe!GameInterface::processEvent(Event * event=0x0012f6e4) Line 66 + 0x11 C++
torqueDemo_DEBUG.exe!GameInterface::postEvent(Event & event={...}) Line 154 + 0x11 C++
torqueDemo_DEBUG.exe!mouseButtonEvent(int action=2, int objInst=256) Line 518 + 0x17 C++
torqueDemo_DEBUG.exe!OurDispatchMessages() Line 765 + 0xc C++
torqueDemo_DEBUG.exe!ProcessMessages() Line 807 C++
torqueDemo_DEBUG.exe!Platform::process() Line 822 + 0x5 C++
torqueDemo_DEBUG.exe!DemoGame::main(int argc=1, const char * * argv=0x0149c280) Line 452 C++
torqueDemo_DEBUG.exe!run(int argc=1, const char * * argv=0x0149c280) Line 1274 + 0x1a C++
torqueDemo_DEBUG.exe!WinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * __formal=0x00000000, char * lpszCmdLine=0x00141f5a, HINSTANCE__ * __formal=0x00000000) Line 1344 + 0x17 C++
torqueDemo_DEBUG.exe!WinMainCRTStartup() Line 251 + 0x30 C
kernel32.dll!7c816d4f()
ntdll.dll!7c915b4f()
kernel32.dll!7c8399f3()
torqueDemo_DEBUG.exe!strcat() Line 173 Asm
torqueDemo_DEBUG.exe!dStrcpy(char * dst=0x0012ddd0, const char * src=0x00000000) Line 138 + 0xd C++
torqueDemo_DEBUG.exe!TextureManager::loadBitmapInstance(const char * textureName=0x00000000) Line 1271 + 0x10 C++
> torqueDemo_DEBUG.exe!TextureManager::resurrect() Line 467 + 0xc C++
torqueDemo_DEBUG.exe!DemoGame::textureResurrect() Line 712 C++
torqueDemo_DEBUG.exe!Video::setDevice(const char * renderName=0x01428af0, unsigned int width=800, unsigned int height=600, unsigned int bpp=0, bool fullScreen=false) Line 303 + 0x12 C++
torqueDemo_DEBUG.exe!csetDisplayDevice(SimObject * __formal=0x01b05cd0, int argc=6, const char * * argv=0x00d06380) Line 37 + 0x1c C++
torqueDemo_DEBUG.exe!CodeBlock::exec(unsigned int ip=1526, const char * functionName=0x01aae5f0, Namespace * thisNamespace=0x01865ce8, unsigned int argc=1, const char * * argv=0x00d06380, bool noCalls=false, const char * packageName=0x00000000) Line 1043 + 0x20 C++
torqueDemo_DEBUG.exe!CodeBlock::exec(unsigned int ip=8, const char * functionName=0x00000000, Namespace * thisNamespace=0x00000000, unsigned int argc=0, const char * * argv=0x00000000, bool noCalls=false, const char * packageName=0x00000000) Line 969 C++
torqueDemo_DEBUG.exe!CodeBlock::compileExec(const char * fileName=0x00000000, const char * string=0x01aadae0, bool noCalls=false) Line 526 C++
torqueDemo_DEBUG.exe!Con::evaluate(const char * string=0x01aadae0, bool echo=false, const char * fileName=0x00000000) Line 864 C++
torqueDemo_DEBUG.exe!GuiControl::onAction() Line 1206 + 0x13 C++
torqueDemo_DEBUG.exe!GuiButtonBaseCtrl::onAction() Line 299 C++
torqueDemo_DEBUG.exe!GuiButtonBaseCtrl::onMouseUp(const GuiEvent & __formal={...}) Line 207 + 0x10 C++
torqueDemo_DEBUG.exe!GuiCanvas::rootMouseUp(const GuiEvent & event={...}) Line 662 + 0x2e C++
torqueDemo_DEBUG.exe!GuiCanvas::processInputEvent(const InputEvent * event=0x0012f6e4) Line 527 + 0x19 C++
torqueDemo_DEBUG.exe!DemoGame::processInputEvent(InputEvent * event=0x0012f6e4) Line 586 + 0x23 C++
torqueDemo_DEBUG.exe!GameInterface::processEvent(Event * event=0x0012f6e4) Line 66 + 0x11 C++
torqueDemo_DEBUG.exe!GameInterface::postEvent(Event & event={...}) Line 154 + 0x11 C++
torqueDemo_DEBUG.exe!mouseButtonEvent(int action=2, int objInst=256) Line 518 + 0x17 C++
torqueDemo_DEBUG.exe!OurDispatchMessages() Line 765 + 0xc C++
torqueDemo_DEBUG.exe!ProcessMessages() Line 807 C++
torqueDemo_DEBUG.exe!Platform::process() Line 822 + 0x5 C++
torqueDemo_DEBUG.exe!DemoGame::main(int argc=1, const char * * argv=0x0149c280) Line 452 C++
torqueDemo_DEBUG.exe!run(int argc=1, const char * * argv=0x0149c280) Line 1274 + 0x1a C++
torqueDemo_DEBUG.exe!WinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * __formal=0x00000000, char * lpszCmdLine=0x00141f5a, HINSTANCE__ * __formal=0x00000000) Line 1344 + 0x17 C++
torqueDemo_DEBUG.exe!WinMainCRTStartup() Line 251 + 0x30 C
kernel32.dll!7c816d4f()
ntdll.dll!7c915b4f()
kernel32.dll!7c8399f3()
#2
09/11/2005 (7:54 pm)
Yep, OpenGL or D3D, same problem. I also can't change my resolution on the fly and have to go to prefs.cs every time. Oh, the pain! It seems to be starter.fps related. When I run tutorial.base I have no problems. Finding the offending TextureObject would be the best fix, but perhaps a patch could be put in so that it fails gracefully with an error message instead of throwing an access violation? Any idea how I can track this TextureObject down, and is anyone else experiencing this same issue?
#3
09/11/2005 (8:00 pm)
It's related to some new features we've added; I thought I had squashed all the problems but apparently not. I'll review monday.
#4
to the latest head 2days ago. After recompile it won't run in D3D and crashes in the same
area, textureResurrect().
I'm still working on it, which is why I am here now... :)
10/14/2005 (9:58 am)
Yep. Same here. Was in the process of restructuring my own workspace and just updatedto the latest head 2days ago. After recompile it won't run in D3D and crashes in the same
area, textureResurrect().
I'm still working on it, which is why I am here now... :)
#5
10/14/2005 (2:10 pm)
I put a temporary fix in to skip textures where textureName is NULL, but obviously that's not a long term solution. :-)
#6
10/14/2005 (4:23 pm)
Hmm... Mysterious. I'm putting out TDN fires and sleeping off IGC but this at the top of the TGE todo list.
#7
spent a few hours on it last night, no progress. i'm very much looking forward to any updates on this issue.
10/16/2005 (11:53 am)
I'm also experiencing the same, on textureResurrect();spent a few hours on it last night, no progress. i'm very much looking forward to any updates on this issue.
#8
So, that's how I'll be fixing it when I get to that item on the task list. You can fix it yourself if you must by modelling off of the existing texture event callbacks and destroying the offending textures, then recreating them, at the appropriate times. It's most likely a GuiVectorFieldCtrl or something similar that's stuffing textures in an unexpected way.
Incidentally, this is an excellent object example of some design limitations in TGE's texture manager - there's no easy way to extend it to deal with this case. In TSE it would be a matter of making a new texture profile or, worst case, adding a flag and some special cases. In TGE you have to extend an enum and touch many places in the texture manager.
10/16/2005 (1:43 pm)
Basically there are a few places in the engine where it allocates a texture that has no corresponding file on disk, but that should be preserved across device changes. The texture manager currently 'splodes when it encounters these. The fix is to register a texture event CB that will destroy and recreate the texture as needed; basically an implementation detail that somehow got overlooked!So, that's how I'll be fixing it when I get to that item on the task list. You can fix it yourself if you must by modelling off of the existing texture event callbacks and destroying the offending textures, then recreating them, at the appropriate times. It's most likely a GuiVectorFieldCtrl or something similar that's stuffing textures in an unexpected way.
Incidentally, this is an excellent object example of some design limitations in TGE's texture manager - there's no easy way to extend it to deal with this case. In TSE it would be a matter of making a new texture profile or, worst case, adding a flag and some special cases. In TGE you have to extend an enum and touch many places in the texture manager.
Associate Kyle Carter
You should be able to recreate the problem in GL as well by alt-entering... Hopefully. Can you check?