Save a Memory Dump for debugging Crashes: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
Made it more universal (applies to TDM too), added CtrlShiftEsc, note about alive processes.
Line 1: Line 1:
Your DarkRadiant application crashed? If you don't want that to happen again, you need to help the team to debug this malfunction - you can do this by dumping DarkRadiant's memory to a file, which can then be used by developers to debug and inspect the application's state at the point in time it crashed. (Note: At the moment this only applies to the Windows version of DarkRadiant, I don't know if there's something similar available for Linux environments.)
DarkRadiant or TheDarkMod crashed? If you don't want that to happen again, you need to help the team to debug this malfunction --- you can do this by dumping process memory to a file, which can then be used by developers to debug and inspect the application's state at the point in time it crashed.


If a crash is reproducible, it might be enough to describe the exact steps that lead up to the fault and file a bug report on the [http://bugs.thedarkmod.com bugtracker]. But more often than sometimes crashes occur out of seemingly nothing and are barely reproducible, and in this case a saved memory dump is even more valuable for debugging purposes.
If a crash is reproducible, it might be enough to describe the exact steps that lead up to the fault and file a bug report on the [http://bugs.thedarkmod.com bugtracker]. But more often than sometimes crashes occur out of seemingly nothing and are barely reproducible, and in this case a saved memory dump is even more valuable for debugging purposes.


== How to record the Dump ==
In principle, recording memory dumps is not limited to crashed applications. It is possible to record memory dump of alive process, although in most cases such dump would be useless.


When DarkRadiant crashes, it usually shows a dialog like this:
Note: At the moment this only applies to the Windows OS, we don't know if there's something similar available for Linux environments.
 
== Record the Dump ==
 
When application crashes, it usually shows a dialog like this:


[[File:Dr has stopped working.png]]
[[File:Dr has stopped working.png]]


Keep that window open, '''don't close that dialog''', instead open your Task Manager. To open the Task Manager, hit Windows-R and type "taskmgr" and click OK. In the Task Manager, switch to the Processes tab and locate the DarkRadiant.exe, it should be in that list since you still have the "DarkRadiant has stopped working" dialog open in the background.
Keep that window open, '''don't close that dialog''', instead open your Task Manager. To open the Task Manager, press Ctrl + Shift + Escape. Another way is to hit Windows + R and type "taskmgr" and click OK.
In the Task Manager, switch to the Processes tab and locate the program which crashed (DarkRadiant.exe, TheDarkModx64.exe or tdm_update.exe). It should be in that list since you still have the "XXX has stopped working" dialog open in the background.


[[File:Dr process in task manager.png]]
[[File:Dr process in task manager.png]]


Now right-click the DarkRadiant.exe line and select "Create dump file..."
Now right-click the DarkRadiant.exe line and select "Create dump file":


[[File:Dr process create dump.png]]
[[File:Dr process create dump.png]]


it will work a bit and then show you something like this:
It will work a bit and then show you something like this:


[[File:Dr dump created.png]]
[[File:Dr dump created.png]]
Line 25: Line 30:
== Compress and Upload the Dump ==
== Compress and Upload the Dump ==


Depending on what you had opened in DarkRadiant, the .dmp file might end up very large, so it's best to compress it now using 7-zip or by right-clicking it and selecting "Send to..." > "Compressed (zip) folder".
Depending on what you had opened in DarkRadiant or what FM you loaded in the game itself, the .dmp file might end up very large, so it's best to compress it now using 7-zip or by right-clicking it and selecting "Send to..." > "Compressed (zip) folder".


Upload that folder to some place in the web, and please go to the forums to tell the devs about your crash dump. Be thanked for your time, I know that recording and uploading crash dumps might be tedious, but without I really can't do much about the crash, so your help is appreciated!
Upload that folder to some place in the web, and please go to the forums to tell the devs about your crash dump. Be thanked for your time, we know that recording and uploading crash dumps might be tedious, but without we really can't do much about the crash, so your help is appreciated!


[[Category:DarkRadiant]]
[[Category:DarkRadiant]]
[[Category:Coding]]

Revision as of 14:49, 9 February 2019

DarkRadiant or TheDarkMod crashed? If you don't want that to happen again, you need to help the team to debug this malfunction --- you can do this by dumping process memory to a file, which can then be used by developers to debug and inspect the application's state at the point in time it crashed.

If a crash is reproducible, it might be enough to describe the exact steps that lead up to the fault and file a bug report on the bugtracker. But more often than sometimes crashes occur out of seemingly nothing and are barely reproducible, and in this case a saved memory dump is even more valuable for debugging purposes.

In principle, recording memory dumps is not limited to crashed applications. It is possible to record memory dump of alive process, although in most cases such dump would be useless.

Note: At the moment this only applies to the Windows OS, we don't know if there's something similar available for Linux environments.

Record the Dump

When application crashes, it usually shows a dialog like this:

Keep that window open, don't close that dialog, instead open your Task Manager. To open the Task Manager, press Ctrl + Shift + Escape. Another way is to hit Windows + R and type "taskmgr" and click OK. In the Task Manager, switch to the Processes tab and locate the program which crashed (DarkRadiant.exe, TheDarkModx64.exe or tdm_update.exe). It should be in that list since you still have the "XXX has stopped working" dialog open in the background.

Now right-click the DarkRadiant.exe line and select "Create dump file":

It will work a bit and then show you something like this:

Open Windows Explorer and head to the location indicated in the dialog. Note that you can mark and copy the location from that dialog using your mouse, so you don't have to type it in entirely.

Compress and Upload the Dump

Depending on what you had opened in DarkRadiant or what FM you loaded in the game itself, the .dmp file might end up very large, so it's best to compress it now using 7-zip or by right-clicking it and selecting "Send to..." > "Compressed (zip) folder".

Upload that folder to some place in the web, and please go to the forums to tell the devs about your crash dump. Be thanked for your time, we know that recording and uploading crash dumps might be tedious, but without we really can't do much about the crash, so your help is appreciated!