]> git.sur5r.net Git - i3/i3/blob - docs/debugging
Adapt release.sh to update the latest version in the debugging docs.
[i3/i3] / docs / debugging
1 Debugging i3: How To
2 ====================
3 Michael Stapelberg <michael@i3wm.org>
4 January 2014
5
6 This document describes how to debug i3 to send us useful bug
7 reports, even if you have no knowledge of C programming.
8
9 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 process and/or need further help, do not hesitate to contact us!
12
13 == Verify you are using i3 ≥ 4.10
14
15 Only the latest major version of i3 is supported. To verify which version
16 you are running, use:
17
18 ---------------
19 $ i3 --moreversion 2>&- || i3 --version
20 Binary i3 version:  4.7 (2013-12-22, branch "tags/4.7")
21 Running i3 version: 4.7-84-gac74a63 (2014-01-01, branch "next") (pid 1995)
22 ---------------
23
24 Your version can look like this:
25
26 4.7 (release version)::
27 You are using a release version. In many cases, bugs are already
28 fixed in the development version of i3. Even if the bug is not a known fixed
29 one, we will still ask you to reproduce your error with the most recent
30 development version of i3. Therefore, please upgrade to a development version
31 if you can.
32
33 4.7-85-g9c15b95 (development version)::
34 Your version is 85 commits newer than 4.7, and the git revision of your
35 version is +9c15b95+. Go to http://code.i3wm.org/i3/commit/?h=next and see if
36 the line "commit" starts with the same revision. If so, you are using the
37 latest version.
38
39 Development versions of i3 have logging enabled by default and are compiled
40 with debug symbols.
41
42 == Enabling logging
43
44 If you are using a development version (see previous section), you don’t need
45 to do anything -- skip to section 3.
46
47 If you are using a release version with a custom +~/.xsession+ (or xinitrc)
48 file, execute i3 with a line like this:
49
50 ----------------------------------
51 # Use 25 MiB of RAM for debug logs
52 exec i3 --shmlog-size=26214400
53 ----------------------------------
54
55 If you are *NOT* using an +~/.xsession+ file but you just chose "i3" from the
56 list of sessions in your desktop manager (gdm, lxdm, …), edit
57 +/usr/share/xsessions/i3.desktop+ and replace the +Exec=i3+ line with:
58
59 ------------------------------
60 Exec=i3 --shmlog-size=26214400
61 ------------------------------
62
63 If you cannot restart i3 for some reason, you can enable debug logging on the
64 fly:
65
66 ---------------------------------------
67 i3-msg 'debuglog on; shmlog on; reload'
68 ---------------------------------------
69
70 == Obtaining the debug logfile
71
72 No matter whether i3 misbehaved in some way without crashing or whether it just
73 crashed, the logfile provides all information necessary to debug the problem.
74
75 To upload a compressed version of the logfile (for a bugreport), use:
76 ------------------------------------------------------------------------------
77 DISPLAY=:0 i3-dump-log | bzip2 -c | curl --data-binary @- http://logs.i3wm.org
78 ------------------------------------------------------------------------------
79
80 This command does not depend on i3 (it also works while i3 displays
81 the crash dialog), but it requires a working X11 connection.
82
83 After running it, you will get a URL to the logfile. Please include that URL in
84 your bug report.
85
86 == On crashes: Obtaining a backtrace
87
88 When i3 crashes, it will display a dialog stating “i3 just crashed”, offering
89 you to save a backtrace to a text file.
90
91 To actually get useful backtraces, you should make sure that your version of i3
92 is compiled with debug symbols:
93
94 ------------------------------------------------------------------------------
95 $ file `which i3`
96 /usr/bin/i3: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically
97 linked (uses shared libs), for GNU/Linux 2.6.18, not stripped
98 ------------------------------------------------------------------------------
99
100 Notice the +not stripped+, which is the important part. If you have a version
101 which is stripped, please check whether your distribution provides debug
102 symbols (package +i3-wm-dbg+ on Debian for example) or if you can turn off
103 stripping. If nothing helps, please build i3 from source.
104
105 Once you have made sure that your i3 is compiled with debug symbols and the C
106 debugger +gdb+ is installed on your machine, you can let i3 generate a
107 backtrace in the crash dialog.
108
109 After pressing "b" in the crash dialog, you will get a file called
110 +/tmp/i3-backtrace.%d.%d.txt+ where the first +%d+ is replaced by i3’s process
111 id (PID) and the second one is incremented each time you generate a backtrace,
112 starting at 0.
113
114 == Sending bug reports/debugging on IRC
115
116 When sending bug reports, please attach the *whole* log file. Even if you think
117 you found the section which clearly highlights the problem, additional
118 information might be necessary to completely diagnose the problem.
119
120 When debugging with us in IRC, be prepared to use a so called nopaste service
121 such as http://nopaste.info or http://pastebin.com because pasting large
122 amounts of text in IRC sometimes leads to incomplete lines (servers have line
123 length limitations) or flood kicks.