How can I create a proper crash report?

Created by eMTee
Keywords:
crash bug report exception exchndl drmingw jit debug
Last updated by:
eMTee

If you experience crashes with DC++ and want to make a bug report please consider the following steps to make your report useful.

( Please note that there is a different FAQ about the case when your DC++ become unresponsive (freezes) here: https://answers.launchpad.net/dcplusplus/+faq/1865 )

In most cases, when DC++ crashes, Windows will display a standard Runtime Error crash message. Unfortunately, that message in itself doesn't contain any useful information about the cause of the crash.

To be able to analyze and solve a crash problem the developers need more information in a bug report:

- Click 'Bugs' in the upper menu, then click 'Report a bug'
- Supply as many details as you can about your system including the version of DC++ used, OS version, security software installed, etc.
- If you know how to reproduce the bug, specify a procedure that developers can follow to re-create the same bug.
- Provide a crash or backtrace log and attach it to your bug report. You have two options to get the crash log :

Method 1. (easiest way, try this first)
------------------------------------------

From version 0.785 DC++ tries to generate crash logs automatically. When you restart DC++ after the crash, you can open the last written crashlog from the program's interface by choosing the 'Open crash log' item from the File menu.
If you cannot start DC++ (e.g. because of it crashes at start) you can locate the crashlog file manually. Depending on the Windows version and DC++ configuration you use, the file is either in the program folder where DC++ is installed or (in case of Vista or later with UAC enabled) it may rather located at the Local Appdata folder (typically C:\Users\Your_username\AppData\Local\DC++). The crashlog file is called CrashLog.txt.

It's possible that in case of some kind of crashes, DC++ is unable to produce a log at all or the resulting a log that does not contain any usable backtrace. Please ensure that the crash log is from the most recent crash experience (the log contains the date/time of the crash in its header).

You're asked to *attach* all the contents of the crashlog text file to your bug report. (Please, if possible, do not direct paste of the log contents to the bug report; attach it as a file or use pastebin.com or similar site and add the link to your bug report. Thanks!)

Method 2. (advanced way, requires debugging software)
---------------------------------------------------------------

Choose this method for getting the backtrace only if the CrashLog.txt file is not available for some reason or its contents aren't useful. For this method you need to use a debugger software called GDB (GNU Debugger). You have to use the GDB debugger corresponding to the architecture of DC++ you're running! Precompiled GDB binaries for Windows are downloadable directly from

<ftp://ftp.equation.com/gdb/32/gdb.exe> (for 32-bit DC++)

<ftp://ftp.equation.com/gdb/64/gdb.exe> (for 64-bit DC++)

- Copy the debugger program (GDB.exe) to your DC++ program folder
- Open a Windows Command prompt in the DC++ program folder (Start Menu, Run..., type 'cmd' and navigate to the program folder). You will get the debugging output to this command window.
- In the Command prompt type :

 gdb --symbols=DCPlusPlus.pdb --exec=DCPlusPlus.exe

then press <enter>.
- When you get the debugger prompt type : r (then press <enter>).
- This will start DC++, now wait for the crash (or force DC++ to crash if you know the steps how to do so)
- When it crashes then get the backtrace information by typing to the debugger prompt :

 bt full

then press <enter>.
- Mark and copy the output from the command window (easiest way : right-click to the window header, from the menu choose Edit, Select All).
- Paste the output to a new text file.
- Then type : q (and press <Entert>) to exit the debugger, this will close DC++ as well.

- Its the actual backtrace itself what contains the most useful information for the developers so you can remove the best part of the debug messages from the beginning of the text output. The important parts are in the end, starting 10-15 lines >before< the place where you issued the 'bt full' command and onwards. Also, please check that the text you're about to attach doesn't contain any information that breaks yours or other's privacy (IP addresses, file names, etc...)!

- *Attach* (do NOT paste please) the backtrace to your bug report.

Getting crashlog using a development snapshot (nightly) builds of DC++
---------------------------------------------------------------------------------

You can find downloadable nightly test builds of the latest development snapshots of DC++ at <http://builds.dcbase.org>

If the site is not available you can either compile DC++ yourself or ask someone who already has a compiling system set up to send you a build. The easiest way to do the latter is to connect to the Public DC Development hub on <adcs://hub.dcbase.org:16591> and ask there.

DC++ can be compiled using two compiler software : by MinGW tools (free) or by Microsoft Visual C++ 2012. Two different build modes exist : debug mode and release mode.
The difference between these build modes is that the debug build shows a text based debug console during the program execution providing extra information. Debug build also compiled with extended error detection code (assertions).

The downloadable nightly builds are named in the following way :

dcpp_rev_<revno>_<build_tool>_<build_type>_<arhcitecture>.zip

where
- <revno> is the revision number in the official DC++ Bazaar repository the build compiled from
- <build_tool> is the compiler used, can be 'mingw' or 'msvc'
- <build_type> can be 'debug' or 'release'
- <architecture> can be 'x86' for 32 bit builds, 'x64' for 64 bit builds

For debugging purposes you always need a build corresponding the debugging tool you want to use. Most time it's best to choose the latest (highest revno number) build for testing.

You must download, unpack and copy the snapshot executables (.exe and .pdb files) to your existing DC++ program folder. You may want to make a backup of the existing release executables first (DCPlusPlus.exe and .pdb) to be able to easily revert to the original release after testing.

You can get the crash log from MinGW nightly builds the same way as from releases: you can use any of the methods described above.

Important :
you may encounter builds that doesn't have the separate symbol file (.pdb) included, instead, the debug symbols are linked into the .exe file resulting a large (100MiB>) standalone executable file. In this case if you choose to use GDB (Method 2.) to get a backtrace then you have to omit the parameters for GDB, so you should start the debugger in the following simple way :

 gdb DCPlusPlus.exe

This will force GDB to use the debug symbols linked into the .exe file.

Alternative way: using "just-in-time" (JIT) debuggers
--------------------------------------------------------------------------------

Alternatively, you can use a "just-in-time" (JIT) debugger software. When a crash occurs, just click "debug" on the standard crash dialog and your debugger will handle unwinding the stack, opening the correct file and showing the offending line and instructions.

- For debug versions of DC++ compiled with MinGW, you need drmingw.exe which should be in the "mingw-utils" package downloadabe from <https://sourceforge.net/project/showfiles.php?group_id=2435&package_id=61599>. Instructions to register it are on <http://code.google.com/p/jrfonseca/wiki/DrMingw>.

- If you have Microsoft Visual C++, you have to use a debug build of DC++ compiled with MSVC. MSVC should already be registered as a JIT debugger on your system.

Good luck!