Making crash dump files useful

AW Arcaeca

Deus Vult
Joined
Mar 10, 2013
Messages
2,984
Location
Operation Padlock ground zero
Trying to figure out why my mods are crashing, I tried using modbuddy to open the crash dump files created. And it worked - modbuddy was successfully able to open the file and create a stack showing where the error occurred.
It happened to be something that went awry in CvGameCore_Expansion1.dll.

And the error seems to indicate that a null pointer - not picked up by the lua.log, I might add - was being passed. (The next object in the stack is lua51_Win32.dll)

And... that's it. What?!? That wasn't helpful at all. So now I know that somewhere a bad pointer was passed. Am I supposed to comb through all my functions and find where?
It further went on to say that the PDG file for the dll couldn't be found, and sure enough, a file search for ".pdg" returned nothing.

So do the crash dump files have any use? Do the PDGs exist anywhere that we can access? Is there no other way to find out which function was being called and where when the game crashed? Or am I just up a creek without a paddle?

TIA,
AW
 
The crash dump files are basically Elder Scrolls. We untrained modders try and read them, we may go insane. We need a DLL Monk to read them for us.

"null pointer" - isn't that passing an id that doesn't exist, or calling a UI element that doesn't exist...
 
Something like that. Which one I have no idea... owing to the apparent nonexistence of a corresponding PDG for the DLL.
What kind of null pointer can sneak by the lua.log is so beyond me that...
...I don't have a clever way to end that sentence. Oh well.

See the stack for yourself:
civilizationv_dx11_403694_crash_2015_4_23T22_33_31C0.mdmp
 
Crash dump (.mdmp) files are only useful if you have the source and associated pdg file (which is basically a database of symbols and line numbers that correspond to codes in the .mdmp file) for the code where the problem occurred. And only the Firaxis devs have those ... unless you are using a modded DLL, in which case you need to look for a CvMiniDump.dmp file, and then that is only useful to the modder that created the modded DLL as they will have the pdg file for it.

The lua.log file will only catch problems with the Lua code. If your mod has done something that has confused the C++ code (eg having a building with a missing building class), the rule of GIGO (garbage in, garbage out) applies, and it's not until something tries to use that non-existent building class (ie the null pointer) that an error will occur.
 
I'm assuming this started happening right after you got your UnitPanel.lua issue resolved so that a pushbutton and action for that pushbutton started appearing?

Also assuming it isn't happening on Start-New-Game or Attack-With-Added-Unit ?
 
The PDB is created by Visual Studio when you compile a DLL. So if you are using a modded DLL the person who made the DLL has the symbols needed to read the dump and determine what went wrong.
 
Just a thought here... what if someone compiled an exact replica of the default DLL? Could the created PDG, which references an identical DLL, be used in the debug process? Or does each PDG only respond to its twin-created DLL?

At any rate, I'm going to add about a bajillion print statements until I find which function starts and doesn't finish, since that would theoretically be the function causing the crash.

@LeeS Yes, I essentially swapped out a faulty UI for a persisting CTD. :/ The crash basically occurs once any unit does anything - moves and builds a city are the two things I've observed causing a crash.
 
@LeeS Yes, I essentially swapped out a faulty UI for a persisting CTD. :/ The crash basically occurs once any unit does anything - moves and builds a city are the two things I've observed causing a crash.
Given that A occured then B began occuring I would work from the assumption that the trouble is in A.

A being your UnitPanel system (lua + xml files)
B being the resultant CTD you are getting.

It would help a lot though if you would just please do what we ask every other person who is having 'broken mod' to do. I know you have a secrecy bug, but it's killing you by making it much much harder for anyone to help you out.
 
Just a thought here... what if someone compiled an exact replica of the default DLL? Could the created PDG, which references an identical DLL, be used in the debug process? Or does each PDG only respond to its twin-created DLL?

If you recompile the DLL without any changes, you'll get the associated pdb file (or whatever the extension is). Just add that compiled dll to your mod, then when you CTD you'll be able to use the mdmp file with the dll source and the pdb file to debug ... have fun ;)
 
If you recompile the DLL without any changes, you'll get the associated pdb file (or whatever the extension is). Just add that compiled dll to your mod, then when you CTD you'll be able to use the mdmp file with the dll source and the pdb file to debug ... have fun ;)
I suppose that's good!... in a way.
(I mean, I have to learn how to compile the DLL, but at least we don't need any PDB from Firaxis. (Why do I keep calling it a PDG? :crazyeye:))

At any rate, the crash has magically disappeared. It seems suspicious so I'll playtest a couple more times to make sure it wasn't an isolated occurrence, but I'll keep this trick in mind. Could probably make a "Debug Mod" that replaces the DLL to be exactly the same and run it whenever one of my mods is crashing.
EDIT: Yep, it was isolated. :/
 
Top Bottom