Difference between revisions of "Debugging"

From Mumble Wiki
Jump to: navigation, search
m
Line 1: Line 1:
==Mumble Debugging==
+
__TOC__
 +
 
 +
=Debugging Mumble & Murmur=
  
 
If you have a problem with Mumble and wish to help the developers in fixing it, it usually
 
If you have a problem with Mumble and wish to help the developers in fixing it, it usually
helps to give Mumble developers a debug log of what Mumble was doing before it crashed/had a
+
helps to give Mumble developers a debug log of exactly what Mumble is doing when it crashes.
bug. For this purpose of debug logging, there is WinDbg.
 
  
==Running WinDbg==
+
Note that the methods presented here only help with debugging crashes or freezes, they do not help for debugging UI glitches, sound artifacts or network problems.
Download [http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx#a WinDbg (32 bit)] or [http://www.microsoft.com/whdc/devtools/debugging/install64bit.mspx# WinDbg (64 bit)].
+
 
 +
== Submitting a debug log ==
 +
 
 +
The fastest way to submit a bug report is to hop on [irc://irc.freenode.org/mumble IRC]. Put your bug report in a pastebin, and put the link to the pastebin along with your Mumble version, OS, OS version, sound card etc in the channel. Then sit back and wait. Sooner or later, a developer will look through the bug, and ask followup questions.
 +
 
 +
If you can't sit around on IRC all day, [https://sourceforge.net/tracker/?func=add&group_id=147372&atid=768005 submit a bug report], including your debug log.
 +
 
 +
==Windows: Running WinDbg==
 +
 
 +
First, make sure that the bug still occurs in the last released snapshot. Doing a debug report is a bit of work, and it would all be wasted if the bug has already been fixed.
 +
 
 +
Download [http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx#a WinDbg (32 bit)]. Even if you may have a 64-bit processor and OS, Mumble is a 32-bit application, so the 32-bit debugger works much better.
  
 
Now install with all the default options but click "Complete" when it comes to the installation type.  
 
Now install with all the default options but click "Complete" when it comes to the installation type.  
Line 16: Line 28:
 
click it, then click "Open".  
 
click it, then click "Open".  
  
Mumble should now start to load. Whenever you see a line containing "int     3" just keep pressing F5  
+
Mumble should now start to load. Whenever you see a line containing "int 3" just keep pressing F5  
 
until Mumble completely starts and is functional (providing that it actually starts without crashing).  
 
until Mumble completely starts and is functional (providing that it actually starts without crashing).  
  
When you come to the bug or error that you saw in Mumble and the log stops displaying any more data, press Ctrl+N and in the input box put "~* kp" and press enter. If Mumble ''does'' crash then you can just run "~* kp" from the same window that the first log is in; where you see "0 : 000>" at the bottom left of the window put in the command and press enter.
+
At this point, wait for Mumble to hang or crash. If it's a hang, use "Break" from the "Debug" menu of Windbg. Note that breaking Mumble will probably freeze your mouse and keyboard for a few seconds, as this also pauses Mumble's hotkey handling.
Copy and paste the logs from the executable window and the window that says "Command:" next to the input box (if this step was needed) into two separate pastebins (http://pastebin.com/) and give the links to a developer. The developer can hopefully look over these logs and get clues to what the bug or error might be.
+
 
 +
In the log window, write
 +
~* kp
 +
Then, from the "Edit" menu, choose "Copy Window Text to Clipboard". You now have the debug log on the clipboard, proceed to submit your debug log.
 +
 
 +
== Linux: Using gdb ==
 +
 
 +
If you compiled Mumble and Murmur yourself, recompile with symbols enabled. To do this:
 +
qmake CONFIG+=symbols -recursive
 +
make clean
 +
make release
 +
 
 +
Alternately, if you are on Ubuntu or Debian, just install the ''mumble-dbg'' package.
 +
 
 +
This will give you a release build with debugging symbols. Note that unlike ''make debug'', which makes a debug build, this is still a fully optimized binary, it's just a lot larger.
 +
 
 +
Start gdb with logged output
 +
script -c "gdb /path/to/mumble" mumble_debug.txt
 +
This starts gdb, but also copies all output to mumble_debug.txt
 +
 
 +
When the prompt comes up
 +
gdb> run
 +
 
 +
Mumble will now proceed running as usual. If Mumble crashes, control will return to gdb. If Mumble hangs, type "Ctrl-C" in the gdb window to break it.
 +
gdb> thread apply all bt full
 +
 
 +
At this point, simply quit gdb
 +
gdb> quit
 +
 
 +
One you exit gdb, the file ''mumble_debug.txt'' will contain your debug data.

Revision as of 10:52, 16 February 2009

Debugging Mumble & Murmur

If you have a problem with Mumble and wish to help the developers in fixing it, it usually helps to give Mumble developers a debug log of exactly what Mumble is doing when it crashes.

Note that the methods presented here only help with debugging crashes or freezes, they do not help for debugging UI glitches, sound artifacts or network problems.

Submitting a debug log

The fastest way to submit a bug report is to hop on IRC. Put your bug report in a pastebin, and put the link to the pastebin along with your Mumble version, OS, OS version, sound card etc in the channel. Then sit back and wait. Sooner or later, a developer will look through the bug, and ask followup questions.

If you can't sit around on IRC all day, submit a bug report, including your debug log.

Windows: Running WinDbg

First, make sure that the bug still occurs in the last released snapshot. Doing a debug report is a bit of work, and it would all be wasted if the bug has already been fixed.

Download WinDbg (32 bit). Even if you may have a 64-bit processor and OS, Mumble is a 32-bit application, so the 32-bit debugger works much better.

Now install with all the default options but click "Complete" when it comes to the installation type.

If you are on Windows Vista type "windbg" into the start menu search box and press enter. If you are on Windows XP click Start -> All Programs -> Debugging Tools for Windows (x86) -> WinDbg.

Now WinDbg should be running. Press Ctrl+E and in the window that pops up navigate to "mumble.exe", click it, then click "Open".

Mumble should now start to load. Whenever you see a line containing "int 3" just keep pressing F5 until Mumble completely starts and is functional (providing that it actually starts without crashing).

At this point, wait for Mumble to hang or crash. If it's a hang, use "Break" from the "Debug" menu of Windbg. Note that breaking Mumble will probably freeze your mouse and keyboard for a few seconds, as this also pauses Mumble's hotkey handling.

In the log window, write

~* kp

Then, from the "Edit" menu, choose "Copy Window Text to Clipboard". You now have the debug log on the clipboard, proceed to submit your debug log.

Linux: Using gdb

If you compiled Mumble and Murmur yourself, recompile with symbols enabled. To do this:

qmake CONFIG+=symbols -recursive
make clean
make release

Alternately, if you are on Ubuntu or Debian, just install the mumble-dbg package.

This will give you a release build with debugging symbols. Note that unlike make debug, which makes a debug build, this is still a fully optimized binary, it's just a lot larger.

Start gdb with logged output

script -c "gdb /path/to/mumble" mumble_debug.txt

This starts gdb, but also copies all output to mumble_debug.txt

When the prompt comes up

gdb> run

Mumble will now proceed running as usual. If Mumble crashes, control will return to gdb. If Mumble hangs, type "Ctrl-C" in the gdb window to break it.

gdb> thread apply all bt full

At this point, simply quit gdb

gdb> quit

One you exit gdb, the file mumble_debug.txt will contain your debug data.