]> git.sur5r.net Git - i3/i3.github.io/blob - docs/4.5.1/debugging.html
release v4.6
[i3/i3.github.io] / docs / 4.5.1 / debugging.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\r
2     "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\r
4 <head>\r
5 <link rel="icon" type="image/png" href="/favicon.png">\r
6 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />\r
7 <meta name="generator" content="AsciiDoc 8.6.7" />\r
8 <title>i3: Debugging i3: How To</title>\r
9 <link rel="stylesheet" href="/css/style.css" type="text/css" />\r
10 <link rel="stylesheet" href="/css/xhtml11.css" type="text/css" />\r
11 <script type="text/javascript">\r
12 /*<![CDATA[*/\r
13 window.onload = function(){asciidoc.footnotes();}\r
14 /*]]>*/\r
15 </script>\r
16 <script type="text/javascript" src="/js/asciidoc-xhtml11.js"></script>\r
17 </head>\r
18 <body class="article">\r
19 \r
20         <div id="main">\r
21             <a href="/"><h1 id="title">i3 - improved tiling WM</h1></a>\r
22                         <ul id="nav">\r
23                                 <li><a style="border-bottom: 2px solid #fff" href="/docs">Docs</a></li>\r
24                                 <li><a href="/screenshots">Screens</a></li>\r
25                                 <li><a href="/contact">Contact</a></li>\r
26                                 <li><a href="http://bugs.i3wm.org/">Bugs</a></li>\r
27                         </ul>\r
28         <br style="clear: both">\r
29 <div id="content">\r
30 <div id="header">\r
31 <h1>Debugging i3: How To</h1>\r
32 <span id="author">Michael Stapelberg</span><br />\r
33 <span id="email"><tt>&lt;<a href="mailto:michael@i3wm.org">michael@i3wm.org</a>&gt;</tt></span><br />\r
34 <span id="revdate">December 2012</span>\r
35 </div>\r
36 <div id="preamble">\r
37 <div class="sectionbody">\r
38 <div class="paragraph"><p>This document describes how to debug i3 to send us useful bug\r
39 reports, even if you have no knowledge of C programming.</p></div>\r
40 <div class="paragraph"><p>Thank you for being interested in debugging i3. It really means\r
41 something to us to get your bug fixed. If you have any questions about the\r
42 process and/or need further help, do not hesitate to contact us!</p></div>\r
43 </div>\r
44 </div>\r
45 <div class="sect1">\r
46 <h2 id="_verify_you_are_using_the_latest_development_version">1. Verify you are using the latest (development) version</h2>\r
47 <div class="sectionbody">\r
48 <div class="paragraph"><p>Please verify that you are using the latest version of i3:</p></div>\r
49 <div class="listingblock">\r
50 <div class="content">\r
51 <pre><tt>$ i3 --version\r
52 i3 version 4.1.2-248-g51728ba (2012-02-12, branch "next")</tt></pre>\r
53 </div></div>\r
54 <div class="paragraph"><p>Your version can look like this:</p></div>\r
55 <div class="dlist"><dl>\r
56 <dt class="hdlist1">\r
57 4.1.2 (release version)\r
58 </dt>\r
59 <dd>\r
60 <p>\r
61 You are using a release version. In many cases, bugs are already\r
62 fixed in the development version of i3. If they aren’t, we will still ask you\r
63 to reproduce your error with the most recent development version of i3.\r
64 Therefore, please upgrade to a development version if you can.\r
65 </p>\r
66 </dd>\r
67 <dt class="hdlist1">\r
68 4.1.2-248-g51728ba (development version)\r
69 </dt>\r
70 <dd>\r
71 <p>\r
72 Your version is 248 commits newer than 4.1.2, and the git revision of your\r
73 version is <tt>51728ba</tt>. Go to <a href="http://code.i3wm.org/i3/commit/?h=next">http://code.i3wm.org/i3/commit/?h=next</a> and see if\r
74 the line "commit" starts with the same revision. If so, you are using the\r
75 latest version.\r
76 </p>\r
77 </dd>\r
78 </dl></div>\r
79 <div class="paragraph"><p>Development versions of i3 have logging enabled by default and are compiled\r
80 with debug symbols.</p></div>\r
81 </div>\r
82 </div>\r
83 <div class="sect1">\r
84 <h2 id="_enabling_logging">2. Enabling logging</h2>\r
85 <div class="sectionbody">\r
86 <div class="paragraph"><p>If you are using a development version (see previous section), you don’t need\r
87 to do anything&#8201;&#8212;&#8201;skip to section 3.</p></div>\r
88 <div class="paragraph"><p>If you are using a release version with a custom <tt>~/.xsession</tt> (or xinitrc)\r
89 file, execute i3 with a line like this:</p></div>\r
90 <div class="listingblock">\r
91 <div class="content">\r
92 <pre><tt># Use 25 MiB of RAM for debug logs\r
93 exec i3 --shmlog-size=26214400</tt></pre>\r
94 </div></div>\r
95 <div class="paragraph"><p>If you are <strong>NOT</strong> using an <tt>~/.xsession</tt> file but you just chose "i3" from the\r
96 list of sessions in your desktop manager (gdm, lxdm, …), edit\r
97 <tt>/usr/share/xsessions/i3.desktop</tt> and replace the <tt>Exec=i3</tt> line with:</p></div>\r
98 <div class="listingblock">\r
99 <div class="content">\r
100 <pre><tt>Exec=i3 --shmlog-size=26214400</tt></pre>\r
101 </div></div>\r
102 </div>\r
103 </div>\r
104 <div class="sect1">\r
105 <h2 id="_obtaining_the_debug_logfile">3. Obtaining the debug logfile</h2>\r
106 <div class="sectionbody">\r
107 <div class="paragraph"><p>No matter whether i3 misbehaved in some way without crashing or whether it just\r
108 crashed, the logfile provides all information necessary to debug the problem.</p></div>\r
109 <div class="paragraph"><p>To save a compressed version of the logfile (suitable for attaching it to a\r
110 bugreport), use:</p></div>\r
111 <div class="listingblock">\r
112 <div class="content">\r
113 <pre><tt>DISPLAY=:0 i3-dump-log | gzip -9c &gt; /tmp/i3.log.gz</tt></pre>\r
114 </div></div>\r
115 <div class="paragraph"><p>This command does not depend on i3 (it also works while i3 displays\r
116 the crash dialog), but it requires a working X11 connection.</p></div>\r
117 </div>\r
118 </div>\r
119 <div class="sect1">\r
120 <h2 id="_compiling_with_debug_symbols">4. Compiling with debug symbols</h2>\r
121 <div class="sectionbody">\r
122 <div class="paragraph"><p>To actually get useful backtraces, you should make sure that your version of i3\r
123 is compiled with debug symbols:</p></div>\r
124 <div class="listingblock">\r
125 <div class="content">\r
126 <pre><tt>$ file `which i3`\r
127 /usr/bin/i3: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically\r
128 linked (uses shared libs), for GNU/Linux 2.6.18, not stripped</tt></pre>\r
129 </div></div>\r
130 <div class="paragraph"><p>Notice the <tt>not stripped</tt>, which is the important part. If you have a version\r
131 which is stripped, please check whether your distribution provides debug\r
132 symbols (package <tt>i3-wm-dbg</tt> on Debian for example) or if you can turn off\r
133 stripping. If nothing helps, please build i3 from source.</p></div>\r
134 </div>\r
135 </div>\r
136 <div class="sect1">\r
137 <h2 id="_obtaining_a_backtrace">5. Obtaining a backtrace</h2>\r
138 <div class="sectionbody">\r
139 <div class="paragraph"><p>Once you have made sure that your i3 is compiled with debug symbols and the C\r
140 debugger <tt>gdb</tt> is installed on your machine, you can let i3 generate a\r
141 backtrace in the crash dialog.</p></div>\r
142 <div class="paragraph"><p>After pressing "b" in the crash dialog, you will get a file called\r
143 <tt>/tmp/i3-backtrace.%d.%d.txt</tt> where the first <tt>%d</tt> is replaced by i3’s process\r
144 id (PID) and the second one is incremented each time you generate a backtrace,\r
145 starting at 0.</p></div>\r
146 </div>\r
147 </div>\r
148 <div class="sect1">\r
149 <h2 id="_sending_bug_reports_debugging_on_irc">6. Sending bug reports/debugging on IRC</h2>\r
150 <div class="sectionbody">\r
151 <div class="paragraph"><p>When sending bug reports, please attach the <strong>whole</strong> log file. Even if you think\r
152 you found the section which clearly highlights the problem, additional\r
153 information might be necessary to completely diagnose the problem.</p></div>\r
154 <div class="paragraph"><p>When debugging with us in IRC, be prepared to use a so called nopaste service\r
155 such as <a href="http://nopaste.info">http://nopaste.info</a> or <a href="http://pastebin.com">http://pastebin.com</a> because pasting large\r
156 amounts of text in IRC sometimes leads to incomplete lines (servers have line\r
157 length limitations) or flood kicks.</p></div>\r
158 </div>\r
159 </div>\r
160 </div>\r
161 <div id="footnotes"><hr /></div>\r
162 <div id="footer" lang="de">\r
163 © 2009-2011 Michael Stapelberg, <a href="/impress.html">Impressum</a>\r
164 </div>\r
165 </body>\r
166 </html>\r