]> git.sur5r.net Git - i3/i3/blob - docs/debugging
docs/debugging: cover development version, add debugging-release-version
[i3/i3] / docs / debugging
1 Debugging i3: How To
2 ====================
3 Michael Stapelberg <michael@i3wm.org>
4 February 2012
5
6 This document describes how to debug i3 suitably for sending us useful bug
7 reports, even if you have no clue of C programming.
8
9 First of all: Thank you for being interested in debugging i3. It really means
10 something to us to get your bug fixed. If you have any questions about the
11 debugging and/or need further help, do not hesitate to contact us!
12
13 == Verify you are using the latest (development) version
14
15 Please verify that you are using the latest version of i3:
16
17 ---------------
18 $ i3 --version
19 i3 version 4.1.2-248-g51728ba (2012-02-12, branch "next")
20 ---------------
21
22 Your version can look like this:
23
24 4.1.2::
25 You are using a release version. Please
26 upgrade to a development version first, or read
27 link:debugging-release-version[Debugging i3: How To (release version)].
28
29 4.1.2-248-g51728ba::
30 Your version is 248 commits newer than 4.1.2, and the git revision of your
31 version is +51728ba+. Go to http://code.i3wm.org/i3/commit/?h=next and see if
32 the line "commit" starts with the same revision. If so, you are using the
33 latest version.
34
35 Development versions of i3 have several properties which make debugging easier:
36
37 1. Shared memory debug logging is enabled by default. You do not have to enable
38    logging explicitly.
39 2. Core dumps are enabled by default.
40 3. If you are using a version from the Debian/Ubuntu autobuilder, it is
41    compiled without optimization. Debug symbols are available in the i3-wm-dbg
42    package. When compiling i3 yourself, debug mode is the default.
43
44 == Obtaining the debug logfile
45
46 No matter whether i3 misbehaved in some way without crashing or whether it just
47 crashed, the logfile provides all information necessary to debug the problem.
48
49 To save a compressed version of the logfile (suitable for attaching it to a
50 bugreport), use:
51 --------------------------------------------------------------------
52 i3-dump-log | gzip -9c > /tmp/i3.log.gz
53 --------------------------------------------------------------------
54
55 This command does not depend on i3 (it also works when i3 currently displays
56 the crash dialog), but it requires a working X11 connection. When running it
57 from a virtual console (Ctrl-Alt-F1), use:
58
59 --------------------------------------------------------------------
60 DISPLAY=:0 i3-dump-log | gzip -9c > /tmp/i3.log.gz
61 --------------------------------------------------------------------
62
63 == Obtaining a backtrace
64
65 When i3 displays its crash dialog, do the following:
66
67 1. Switch to a virtual console (Ctrl-Alt-F1) or login from a different computer
68 2. Generate a backtrace (see below)
69 3. Switch back to the crash dialog (Ctrl-Alt-F7)
70 4. Restart i3 in-place (you will keep your session), continue working
71
72 This is how you get a backtrace from a running i3 process:
73
74 -----------------
75 I3PID=$(pidof i3)
76 gdb /proc/$I3PID/exe $I3PID \
77     --batch --quiet \
78     --ex 'backtrace full' > /tmp/i3-backtrace.txt 2>&1
79 -----------------
80
81 == Sending bug reports/debugging on IRC
82
83 When sending bug reports, please attach the *whole* log file. Even if you think
84 you found the section which clearly highlights the problem, additional
85 information might be necessary to completely diagnose the problem.
86
87 When debugging with us in IRC, be prepared to use a so called nopaste service
88 such as http://nopaste.info or http://pastebin.com because pasting large
89 amounts of text in IRC sometimes leads to incomplete lines (servers have line
90 length limitations) or flood kicks.