]> git.sur5r.net Git - i3/i3.github.io/blob - _docs/debugging
release i3 v4.4
[i3/i3.github.io] / _docs / debugging
1 Debugging i3: How To
2 ====================
3 Michael Stapelberg <michael@i3wm.org>
4 December 2012
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 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 (release version)::
25 You are using a release version. In many cases, bugs are already
26 fixed in the development version of i3. If they aren’t, we will still ask you
27 to reproduce your error with the most recent development version of i3.
28 Therefore, please upgrade to a development version if you can.
29
30 4.1.2-248-g51728ba (development version)::
31 Your version is 248 commits newer than 4.1.2, and the git revision of your
32 version is +51728ba+. Go to http://code.i3wm.org/i3/commit/?h=next and see if
33 the line "commit" starts with the same revision. If so, you are using the
34 latest version.
35
36 Development versions of i3 have logging enabled by default and are compiled
37 with debug symbols.
38
39 == Enabling logging
40
41 If you are using a development version (see previous section), you don’t need
42 to do anything -- skip to section 3.
43
44 If you are using a release version with a custom +~/.xsession+ (or xinitrc)
45 file, execute i3 with a line like this:
46
47 ----------------------------------
48 # Use 25 MiB of RAM for debug logs
49 exec i3 --shmlog-size=26214400
50 ----------------------------------
51
52 If you are *NOT* using an +~/.xsession+ file but you just chose "i3" from the
53 list of sessions in your desktop manager (gdm, lxdm, …), edit
54 +/usr/share/xsessions/i3.desktop+ and replace the +Exec=i3+ line with:
55
56 ------------------------------
57 Exec=i3 --shmlog-size=26214400
58 ------------------------------
59
60 == Obtaining the debug logfile
61
62 No matter whether i3 misbehaved in some way without crashing or whether it just
63 crashed, the logfile provides all information necessary to debug the problem.
64
65 To save a compressed version of the logfile (suitable for attaching it to a
66 bugreport), use:
67 --------------------------------------------------------------------
68 DISPLAY=:0 i3-dump-log | gzip -9c > /tmp/i3.log.gz
69 --------------------------------------------------------------------
70
71 This command does not depend on i3 (it also works while i3 displays
72 the crash dialog), but it requires a working X11 connection.
73
74 == Compiling with debug symbols
75
76 To actually get useful backtraces, you should make sure that your version of i3
77 is compiled with debug symbols:
78
79 ------------------------------------------------------------------------------
80 $ file `which i3`
81 /usr/bin/i3: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically
82 linked (uses shared libs), for GNU/Linux 2.6.18, not stripped
83 ------------------------------------------------------------------------------
84
85 Notice the +not stripped+, which is the important part. If you have a version
86 which is stripped, please check whether your distribution provides debug
87 symbols (package +i3-wm-dbg+ on Debian for example) or if you can turn off
88 stripping. If nothing helps, please build i3 from source.
89
90 == Obtaining a backtrace
91
92 Once you have made sure that your i3 is compiled with debug symbols and the C
93 debugger +gdb+ is installed on your machine, you can let i3 generate a
94 backtrace in the crash dialog.
95
96 After pressing "b" in the crash dialog, you will get a file called
97 +/tmp/i3-backtrace.%d.%d.txt+ where the first +%d+ is replaced by i3’s process
98 id (PID) and the second one is incremented each time you generate a backtrace,
99 starting at 0.
100
101 == Sending bug reports/debugging on IRC
102
103 When sending bug reports, please attach the *whole* log file. Even if you think
104 you found the section which clearly highlights the problem, additional
105 information might be necessary to completely diagnose the problem.
106
107 When debugging with us in IRC, be prepared to use a so called nopaste service
108 such as http://nopaste.info or http://pastebin.com because pasting large
109 amounts of text in IRC sometimes leads to incomplete lines (servers have line
110 length limitations) or flood kicks.