]> git.sur5r.net Git - i3/i3/blob - docs/debugging
Merge pull request #1657 from Georgiy-Tugai/fix-flickering-shortened
[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 Please note that log files may contain sensitive data such as window titles.
73 The best way to avoid submitting such information is to only run the necessary
74 applications to reproduce the behavior when saving the log file. This will also
75 make analyzing the log file easier.
76
77 No matter whether i3 misbehaved in some way without crashing or whether it just
78 crashed, the logfile provides all information necessary to debug the problem.
79
80 To upload a compressed version of the logfile (for a bugreport), use:
81 ------------------------------------------------------------------------------
82 DISPLAY=:0 i3-dump-log | bzip2 -c | curl --data-binary @- http://logs.i3wm.org
83 ------------------------------------------------------------------------------
84
85 This command does not depend on i3 (it also works while i3 displays
86 the crash dialog), but it requires a working X11 connection.
87
88 After running it, you will get a URL to the logfile. Please include that URL in
89 your bug report.
90
91 == On crashes: Obtaining a backtrace
92
93 When i3 crashes, it will display a dialog stating “i3 just crashed”, offering
94 you to save a backtrace to a text file.
95
96 To actually get useful backtraces, you should make sure that your version of i3
97 is compiled with debug symbols:
98
99 ------------------------------------------------------------------------------
100 $ file `which i3`
101 /usr/bin/i3: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically
102 linked (uses shared libs), for GNU/Linux 2.6.18, not stripped
103 ------------------------------------------------------------------------------
104
105 Notice the +not stripped+, which is the important part. If you have a version
106 which is stripped, please check whether your distribution provides debug
107 symbols (package +i3-wm-dbg+ on Debian for example) or if you can turn off
108 stripping. If nothing helps, please build i3 from source.
109
110 Once you have made sure that your i3 is compiled with debug symbols and the C
111 debugger +gdb+ is installed on your machine, you can let i3 generate a
112 backtrace in the crash dialog.
113
114 After pressing "b" in the crash dialog, you will get a file called
115 +/tmp/i3-backtrace.%d.%d.txt+ where the first +%d+ is replaced by i3’s process
116 id (PID) and the second one is incremented each time you generate a backtrace,
117 starting at 0.
118
119 == Sending bug reports/debugging on IRC
120
121 When sending bug reports, please attach the *whole* log file. Even if you think
122 you found the section which clearly highlights the problem, additional
123 information might be necessary to completely diagnose the problem.
124
125 When debugging with us in IRC, be prepared to use a so called nopaste service
126 such as http://nopaste.info or http://pastebin.com because pasting large
127 amounts of text in IRC sometimes leads to incomplete lines (servers have line
128 length limitations) or flood kicks.
129
130 == Debugging i3bar
131
132 To debug i3bar problems, add +verbose yes+ to all +bar {}+ blocks in your i3 config
133 and then restart all i3bar instances like this:
134
135 ---------------------------------------------------------------------
136 $ killall i3bar
137 $ for c in $(i3-msg -t get_bar_config | python -c \
138       'import json,sys;print("\n".join(json.load(sys.stdin)))'); do \
139     (i3bar --bar_id=$c >i3bar.$c.log 2>&1) & \
140   done;
141 ---------------------------------------------------------------------
142
143 There will now be +i3bar.*.log+ files in your current directory that you can provide
144 in your bug report.