]> git.sur5r.net Git - i3/i3.github.io/blob - docs/4.13/debugging-release-version.html
save docs for 4.13
[i3/i3.github.io] / docs / 4.13 / debugging-release-version.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/x-icon" href="/favicon.ico">\r
6 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />\r
7 <meta name="generator" content="AsciiDoc 8.6.9" />\r
8 <title>i3: Debugging i3: How To (release version)</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 document.addEventListener("DOMContentLoaded", function(){asciidoc.footnotes();}, false);\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="https://www.reddit.com/r/i3wm/">FAQ</a></li>\r
26                                 <li><a href="/contact">Contact</a></li>\r
27                                 <li><a href="https://github.com/i3/i3/issues">Bugs</a></li>\r
28                         </ul>\r
29         <br style="clear: both">\r
30 <div id="content">\r
31 <div id="header">\r
32 <h1>Debugging i3: How To (release version)</h1>\r
33 <span id="author">Michael Stapelberg</span><br />\r
34 <span id="email"><tt>&lt;<a href="mailto:michael@i3wm.org">michael@i3wm.org</a>&gt;</tt></span><br />\r
35 <span id="revdate">February 2012</span>\r
36 </div>\r
37 <div id="preamble">\r
38 <div class="sectionbody">\r
39 <div class="paragraph"><p>This document describes how to debug i3 suitably for sending us useful bug\r
40 reports, even if you have no clue of C programming.</p></div>\r
41 <div class="paragraph"><p>First of all: Thank you for being interested in debugging i3. It really means\r
42 something to us to get your bug fixed. If you have any questions about the\r
43 debugging and/or need further help, do not hesitate to contact us!</p></div>\r
44 <div class="admonitionblock">\r
45 <table><tr>\r
46 <td class="icon">\r
47 <div class="title">Note</div>\r
48 </td>\r
49 <td class="content">This document is for the release version of i3. If you are using a\r
50 development version, please see <a href="debugging.html">Debugging i3: How To</a>\r
51 instead.</td>\r
52 </tr></table>\r
53 </div>\r
54 </div>\r
55 </div>\r
56 <div class="sect1">\r
57 <h2 id="_consider_using_the_development_version">1. Consider using the development version</h2>\r
58 <div class="sectionbody">\r
59 <div class="paragraph"><p>This document is for the release version of i3. In many cases, bugs are already\r
60 fixed in the development version of i3. If they aren’t, we will still ask you\r
61 to reproduce your error with the most recent development version of i3.\r
62 Therefore, please upgrade to a development version and continue reading at\r
63 <a href="debugging.html">Debugging i3: How To</a>.</p></div>\r
64 <div class="paragraph"><p>If you absolutely cannot upgrade to a development version of i3, you may\r
65 continue reading this document.</p></div>\r
66 </div>\r
67 </div>\r
68 <div class="sect1">\r
69 <h2 id="_enabling_logging">2. Enabling logging</h2>\r
70 <div class="sectionbody">\r
71 <div class="paragraph"><p>i3 logs useful information to stdout. To have a clearly defined place where log\r
72 files will be saved, you should redirect stdout and stderr in your\r
73 <tt>~/.xsession</tt>. While you’re at it, putting each run of i3 in a separate log\r
74 file with date/time in its filename is a good idea to not get confused about\r
75 the different log files later on.</p></div>\r
76 <div class="listingblock">\r
77 <div class="content">\r
78 <pre><tt>exec /usr/bin/i3 &gt;~/i3log-$(date +'%F-%k-%M-%S') 2&gt;&amp;1</tt></pre>\r
79 </div></div>\r
80 <div class="paragraph"><p>To enable verbose output and all levels of debug output (required when\r
81 attaching logfiles to bugreports), add the parameters <tt>-V -d all</tt>, like this:</p></div>\r
82 <div class="listingblock">\r
83 <div class="content">\r
84 <pre><tt>exec /usr/bin/i3 -V -d all &gt;~/i3log-$(date +'%F-%k-%M-%S') 2&gt;&amp;1</tt></pre>\r
85 </div></div>\r
86 </div>\r
87 </div>\r
88 <div class="sect1">\r
89 <h2 id="_enabling_core_dumps">3. Enabling core dumps</h2>\r
90 <div class="sectionbody">\r
91 <div class="paragraph"><p>When i3 crashes, often you have the chance of getting a <em>core dump</em> (an image\r
92 of the memory of the i3 process which can be loaded into a debugger). To get a\r
93 core dump, you have to make sure that the user limit for core dump files is set\r
94 high enough. Many systems ship with a default value which even forbids core\r
95 dumps completely. To disable the limit completely and thus enable core dumps,\r
96 use the following command (in your <tt>~/.xsession</tt>, before starting i3):</p></div>\r
97 <div class="listingblock">\r
98 <div class="content">\r
99 <pre><tt>ulimit -c unlimited</tt></pre>\r
100 </div></div>\r
101 <div class="paragraph"><p>Furthermore, to easily recognize core dumps and allow multiple of them, you\r
102 should set a custom core dump filename pattern, using a command like the\r
103 following:</p></div>\r
104 <div class="listingblock">\r
105 <div class="content">\r
106 <pre><tt>sudo sysctl -w kernel.core_pattern=core.%e.%p</tt></pre>\r
107 </div></div>\r
108 <div class="paragraph"><p>This will generate files which have the executable’s file name (%e) and the\r
109 process id (%p) in it. You can save this setting across reboots using\r
110 <tt>/etc/sysctl.conf</tt>.</p></div>\r
111 </div>\r
112 </div>\r
113 <div class="sect1">\r
114 <h2 id="_compiling_with_debug_symbols">4. Compiling with debug symbols</h2>\r
115 <div class="sectionbody">\r
116 <div class="paragraph"><p>To actually get useful core dumps, you should make sure that your version of i3\r
117 is compiled with debug symbols, that is, that the symbols are not stripped\r
118 during the build process. You can check whether your executable contains\r
119 symbols by issuing the following command:</p></div>\r
120 <div class="listingblock">\r
121 <div class="content">\r
122 <pre><tt>file $(which i3)</tt></pre>\r
123 </div></div>\r
124 <div class="paragraph"><p>You should get an output like this:</p></div>\r
125 <div class="listingblock">\r
126 <div class="content">\r
127 <pre><tt>/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 have a look if 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="_generating_a_backtrace">5. Generating 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 that\r
140 core dumps are enabled, you can start making sense out of the core dumps.</p></div>\r
141 <div class="paragraph"><p>Because the core dump depends on the original executable (and its debug\r
142 symbols), please do this as soon as you encounter the problem. If you\r
143 re-compile i3, your core dump might be useless afterwards.</p></div>\r
144 <div class="paragraph"><p>Please install <tt>gdb</tt>, a debugger for C. No worries, you don’t need to learn it\r
145 now.  Start gdb using the following command (replacing the actual name of the\r
146 core dump of course):</p></div>\r
147 <div class="listingblock">\r
148 <div class="content">\r
149 <pre><tt>gdb $(which i3) core.i3.3849</tt></pre>\r
150 </div></div>\r
151 <div class="paragraph"><p>Then, generate a backtrace using:</p></div>\r
152 <div class="listingblock">\r
153 <div class="content">\r
154 <pre><tt>backtrace full</tt></pre>\r
155 </div></div>\r
156 </div>\r
157 </div>\r
158 <div class="sect1">\r
159 <h2 id="_sending_bug_reports_debugging_on_irc">6. Sending bug reports/debugging on IRC</h2>\r
160 <div class="sectionbody">\r
161 <div class="paragraph"><p>When sending bug reports, please paste the relevant part of the log (if in\r
162 doubt, please send us rather too much information than too less) and the whole\r
163 backtrace (if there was a core dump).</p></div>\r
164 <div class="paragraph"><p>When debugging with us in IRC, be prepared to use a so called nopaste service\r
165 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
166 amounts of text in IRC sometimes leads to incomplete lines (servers have line\r
167 length limitations) or flood kicks.</p></div>\r
168 </div>\r
169 </div>\r
170 </div>\r
171 <div id="footnotes"><hr /></div>\r
172 <div id="footer" lang="de">\r
173 © 2009-2011 Michael Stapelberg, <a href="/impress.html">Impressum</a>\r
174 </div>\r
175 </body>\r
176 </html>\r