View Issue Details

IDProjectCategoryView StatusLast Update
0004508The Dark ModCodingpublic07.05.2017 05:40
Reporterstgatilov Assigned Tostgatilov  
Status resolvedResolutionfixed 
Product VersionSVN 
Fixed in VersionTDM 2.06 
Summary0004508: Crash during engine reload after new mission was downloaded
DescriptionTDM crashes during reload, when you install a new mission that has been downloaded just before that.

Note: the issue appeared in x64 branch, which is now merged into trunk.
Steps To ReproduceUse Release x32 build, preferably start from MSVC debugger.

1. Start fresh TDM.
2. Download a new mission (e.g. "Swing").
3. Install the downloaded mission immediately.

As a result, TDM crashes somewhere during reload.
Additional InformationDebugger says it cannot read data from some corrupted idStr object. Watching this string reveals: "0x19dc3f30 <Error reading characters of string.>".

Full call stack:
gamex86.dll!idStr::Icmp(const char * s1, const char * s2) Line 1350 C++
gamex86.dll!CGlobal::GetImage(const idStr & Name, int & Index) Line 482 C++
gamex86.dll!CGlobal::AddImage(const idStr & Name, bool & Added) Line 452 C++
gamex86.dll!CLightMaterial::CLightMaterial(const idStr & MaterialName, const idStr & TextureName, const idStr & MapName) Line 504 C++
gamex86.dll!idGameLocal::LoadLightMaterial(const char * pFN, idList<CLightMaterial *> * ml) Line 7048 C++
gamex86.dll!idGameLocal::Init() Line 581 C++
TheDarkMod.exe!idCommonLocal::LoadGameDLL() Line 2675 C++
TheDarkMod.exe!idCommonLocal::InitGame() Line 3024 C++
TheDarkMod.exe!Com_ReloadEngine_f(const idCmdArgs & args) Line 1606 C++
TheDarkMod.exe!idCmdSystemLocal::ExecuteTokenizedString(const idCmdArgs & args) Line 486 C++
TheDarkMod.exe!idCmdSystemLocal::ExecuteCommandBuffer() Line 667 C++
TheDarkMod.exe!idEventLoop::RunEventLoop(bool commandExecution) Line 174 C++
TheDarkMod.exe!idCommonLocal::Frame() Line 2435 C++
TheDarkMod.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Line 1360 C++




07.05.2017 05:39

administrator   ~0008844

Fixed in revision 6871.

The TDM globals were not cleared on game shutdown.
The "CGlobal g_Global" singleton contains array of image pointers, each image has its name stored in idStr object. During shutdown idLib is finalized too (as the very last step), so these idStr objects may become corrupted: string buffers are sometimes stored in string pools, which are destroyed during idLib shutdown.
The resolution is simple: shutdown g_Global stuff during game shutdown too. Simply clearing everything is enough.

Issue History

Date Modified Username Field Change
15.04.2017 08:44 stgatilov New Issue
15.04.2017 08:44 stgatilov Tag Attached: x64
06.05.2017 11:03 stgatilov Assigned To => stgatilov
06.05.2017 11:03 stgatilov Status new => assigned
07.05.2017 05:39 stgatilov Note Added: 0008844
07.05.2017 05:40 stgatilov Status assigned => resolved
07.05.2017 05:40 stgatilov Fixed in Version => TDM 2.06
07.05.2017 05:40 stgatilov Resolution open => fixed