i3/docs/debugging

91 lines
3.4 KiB
Plaintext
Raw Normal View History

2009-04-28 15:10:20 -04:00
Debugging i3: How To
====================
Michael Stapelberg <michael@i3wm.org>
February 2012
2009-04-28 15:10:20 -04:00
2010-03-10 07:01:27 -05:00
This document describes how to debug i3 suitably for sending us useful bug
reports, even if you have no clue of C programming.
2009-04-28 15:10:20 -04:00
2010-03-10 07:01:27 -05:00
First of all: Thank you for being interested in debugging i3. It really means
something to us to get your bug fixed. If you have any questions about the
debugging and/or need further help, do not hesitate to contact us!
2009-04-28 15:10:20 -04:00
== Verify you are using the latest (development) version
2009-04-28 15:10:20 -04:00
Please verify that you are using the latest version of i3:
2009-04-28 15:10:20 -04:00
---------------
$ i3 --version
i3 version 4.1.2-248-g51728ba (2012-02-12, branch "next")
---------------
2009-04-28 15:10:20 -04:00
Your version can look like this:
2009-04-28 15:10:20 -04:00
4.1.2::
You are using a release version. Please
upgrade to a development version first, or read
link:debugging-release-version[Debugging i3: How To (release version)].
2009-04-28 15:10:20 -04:00
4.1.2-248-g51728ba::
Your version is 248 commits newer than 4.1.2, and the git revision of your
version is +51728ba+. Go to http://code.i3wm.org/i3/commit/?h=next and see if
the line "commit" starts with the same revision. If so, you are using the
latest version.
2009-04-28 15:10:20 -04:00
Development versions of i3 have several properties which make debugging easier:
2009-04-28 15:10:20 -04:00
1. Shared memory debug logging is enabled by default. You do not have to enable
logging explicitly.
2. Core dumps are enabled by default.
3. If you are using a version from the Debian/Ubuntu autobuilder, it is
compiled without optimization. Debug symbols are available in the i3-wm-dbg
package. When compiling i3 yourself, debug mode is the default.
2009-04-28 15:10:20 -04:00
== Obtaining the debug logfile
2009-04-28 15:10:20 -04:00
No matter whether i3 misbehaved in some way without crashing or whether it just
crashed, the logfile provides all information necessary to debug the problem.
2009-04-28 15:10:20 -04:00
To save a compressed version of the logfile (suitable for attaching it to a
bugreport), use:
--------------------------------------------------------------------
i3-dump-log | gzip -9c > /tmp/i3.log.gz
--------------------------------------------------------------------
2009-04-28 15:10:20 -04:00
This command does not depend on i3 (it also works when i3 currently displays
the crash dialog), but it requires a working X11 connection. When running it
from a virtual console (Ctrl-Alt-F1), use:
2009-04-28 15:10:20 -04:00
--------------------------------------------------------------------
DISPLAY=:0 i3-dump-log | gzip -9c > /tmp/i3.log.gz
--------------------------------------------------------------------
2009-04-28 15:10:20 -04:00
== Obtaining a backtrace
2009-04-28 15:10:20 -04:00
When i3 displays its crash dialog, do the following:
2009-04-28 15:10:20 -04:00
1. Switch to a virtual console (Ctrl-Alt-F1) or login from a different computer
2. Generate a backtrace (see below)
3. Switch back to the crash dialog (Ctrl-Alt-F7)
4. Restart i3 in-place (you will keep your session), continue working
2009-04-28 15:10:20 -04:00
This is how you get a backtrace from a running i3 process:
2009-04-28 15:10:20 -04:00
-----------------
I3PID=$(pidof i3)
gdb /proc/$I3PID/exe $I3PID \
--batch --quiet \
--ex 'backtrace full' > /tmp/i3-backtrace.txt 2>&1
-----------------
2009-04-28 15:10:20 -04:00
== Sending bug reports/debugging on IRC
2009-04-28 15:10:20 -04:00
When sending bug reports, please attach the *whole* log file. Even if you think
you found the section which clearly highlights the problem, additional
information might be necessary to completely diagnose the problem.
2009-04-28 15:10:20 -04:00
2010-03-10 07:01:27 -05:00
When debugging with us in IRC, be prepared to use a so called nopaste service
such as http://nopaste.info or http://pastebin.com because pasting large
amounts of text in IRC sometimes leads to incomplete lines (servers have line
length limitations) or flood kicks.