2009-04-28 15:10:20 -04:00
|
|
|
|
Debugging i3: How To
|
2010-03-20 20:50:10 -04:00
|
|
|
|
====================
|
2012-02-12 06:17:03 -05:00
|
|
|
|
Michael Stapelberg <michael@i3wm.org>
|
2012-12-09 06:07:25 -05:00
|
|
|
|
December 2012
|
2009-04-28 15:10:20 -04:00
|
|
|
|
|
2012-12-09 11:56:55 -05:00
|
|
|
|
This document describes how to debug i3 to send us useful bug
|
|
|
|
|
reports, even if you have no knowledge of C programming.
|
2009-04-28 15:10:20 -04:00
|
|
|
|
|
2012-12-09 11:56:55 -05:00
|
|
|
|
Thank you for being interested in debugging i3. It really means
|
2010-03-10 07:01:27 -05:00
|
|
|
|
something to us to get your bug fixed. If you have any questions about the
|
2012-12-09 11:56:55 -05:00
|
|
|
|
process and/or need further help, do not hesitate to contact us!
|
2009-04-28 15:10:20 -04:00
|
|
|
|
|
2012-02-12 06:17:03 -05:00
|
|
|
|
== Verify you are using the latest (development) version
|
2009-04-28 15:10:20 -04:00
|
|
|
|
|
2012-02-12 06:17:03 -05:00
|
|
|
|
Please verify that you are using the latest version of i3:
|
2009-04-28 15:10:20 -04:00
|
|
|
|
|
2012-02-12 06:17:03 -05:00
|
|
|
|
---------------
|
|
|
|
|
$ i3 --version
|
|
|
|
|
i3 version 4.1.2-248-g51728ba (2012-02-12, branch "next")
|
|
|
|
|
---------------
|
2009-04-28 15:10:20 -04:00
|
|
|
|
|
2012-02-12 06:17:03 -05:00
|
|
|
|
Your version can look like this:
|
2009-04-28 15:10:20 -04:00
|
|
|
|
|
2012-12-09 06:07:25 -05:00
|
|
|
|
4.1.2 (release version)::
|
|
|
|
|
You are using a release version. In many cases, bugs are already
|
|
|
|
|
fixed in the development version of i3. If they aren’t, we will still ask you
|
|
|
|
|
to reproduce your error with the most recent development version of i3.
|
|
|
|
|
Therefore, please upgrade to a development version if you can.
|
2009-04-28 15:10:20 -04:00
|
|
|
|
|
2012-12-09 06:07:25 -05:00
|
|
|
|
4.1.2-248-g51728ba (development version)::
|
2012-02-12 06:17:03 -05:00
|
|
|
|
Your version is 248 commits newer than 4.1.2, and the git revision of your
|
|
|
|
|
version is +51728ba+. Go to http://code.i3wm.org/i3/commit/?h=next and see if
|
|
|
|
|
the line "commit" starts with the same revision. If so, you are using the
|
|
|
|
|
latest version.
|
2009-04-28 15:10:20 -04:00
|
|
|
|
|
2012-12-09 06:07:25 -05:00
|
|
|
|
Development versions of i3 have logging enabled by default and are compiled
|
|
|
|
|
with debug symbols.
|
2009-04-28 15:10:20 -04:00
|
|
|
|
|
2012-12-09 06:07:25 -05:00
|
|
|
|
== Enabling logging
|
|
|
|
|
|
|
|
|
|
If you are using a development version (see previous section), you don’t need
|
|
|
|
|
to do anything -- skip to section 3.
|
|
|
|
|
|
|
|
|
|
If you are using a release version with a custom +~/.xsession+ (or xinitrc)
|
|
|
|
|
file, execute i3 with a line like this:
|
|
|
|
|
|
|
|
|
|
----------------------------------
|
|
|
|
|
# Use 25 MiB of RAM for debug logs
|
|
|
|
|
exec i3 --shmlog-size=26214400
|
|
|
|
|
----------------------------------
|
|
|
|
|
|
|
|
|
|
If you are *NOT* using an +~/.xsession+ file but you just chose "i3" from the
|
|
|
|
|
list of sessions in your desktop manager (gdm, lxdm, …), edit
|
|
|
|
|
+/usr/share/xsessions/i3.desktop+ and replace the +Exec=i3+ line with:
|
|
|
|
|
|
|
|
|
|
------------------------------
|
|
|
|
|
Exec=i3 --shmlog-size=26214400
|
|
|
|
|
------------------------------
|
2009-04-28 15:10:20 -04:00
|
|
|
|
|
2012-02-12 06:17:03 -05:00
|
|
|
|
== Obtaining the debug logfile
|
2009-04-28 15:10:20 -04:00
|
|
|
|
|
2012-02-12 06:17:03 -05:00
|
|
|
|
No matter whether i3 misbehaved in some way without crashing or whether it just
|
|
|
|
|
crashed, the logfile provides all information necessary to debug the problem.
|
2009-04-28 15:10:20 -04:00
|
|
|
|
|
2012-02-12 06:17:03 -05:00
|
|
|
|
To save a compressed version of the logfile (suitable for attaching it to a
|
|
|
|
|
bugreport), use:
|
|
|
|
|
--------------------------------------------------------------------
|
2014-01-04 05:35:06 -05:00
|
|
|
|
DISPLAY=:0 i3-dump-log | bzip2 -c > /tmp/i3.log.bz2
|
2012-02-12 06:17:03 -05:00
|
|
|
|
--------------------------------------------------------------------
|
2009-04-28 15:10:20 -04:00
|
|
|
|
|
2012-12-09 06:07:25 -05:00
|
|
|
|
This command does not depend on i3 (it also works while i3 displays
|
|
|
|
|
the crash dialog), but it requires a working X11 connection.
|
2009-04-28 15:10:20 -04:00
|
|
|
|
|
2012-12-09 06:07:25 -05:00
|
|
|
|
== Compiling with debug symbols
|
2009-04-28 15:10:20 -04:00
|
|
|
|
|
2012-12-09 06:07:25 -05:00
|
|
|
|
To actually get useful backtraces, you should make sure that your version of i3
|
|
|
|
|
is compiled with debug symbols:
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------
|
|
|
|
|
$ file `which i3`
|
|
|
|
|
/usr/bin/i3: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically
|
|
|
|
|
linked (uses shared libs), for GNU/Linux 2.6.18, not stripped
|
|
|
|
|
------------------------------------------------------------------------------
|
2009-04-28 15:10:20 -04:00
|
|
|
|
|
2012-12-09 06:07:25 -05:00
|
|
|
|
Notice the +not stripped+, which is the important part. If you have a version
|
2012-12-09 11:56:55 -05:00
|
|
|
|
which is stripped, please check whether your distribution provides debug
|
2012-12-09 06:07:25 -05:00
|
|
|
|
symbols (package +i3-wm-dbg+ on Debian for example) or if you can turn off
|
|
|
|
|
stripping. If nothing helps, please build i3 from source.
|
2009-04-28 15:10:20 -04:00
|
|
|
|
|
2012-12-09 06:07:25 -05:00
|
|
|
|
== Obtaining a backtrace
|
2009-04-28 15:10:20 -04:00
|
|
|
|
|
2012-12-09 06:07:25 -05:00
|
|
|
|
Once you have made sure that your i3 is compiled with debug symbols and the C
|
|
|
|
|
debugger +gdb+ is installed on your machine, you can let i3 generate a
|
|
|
|
|
backtrace in the crash dialog.
|
2009-04-28 15:10:20 -04:00
|
|
|
|
|
2012-12-09 06:07:25 -05:00
|
|
|
|
After pressing "b" in the crash dialog, you will get a file called
|
|
|
|
|
+/tmp/i3-backtrace.%d.%d.txt+ where the first +%d+ is replaced by i3’s process
|
|
|
|
|
id (PID) and the second one is incremented each time you generate a backtrace,
|
|
|
|
|
starting at 0.
|
2009-04-28 15:10:20 -04:00
|
|
|
|
|
2010-03-20 20:50:10 -04:00
|
|
|
|
== Sending bug reports/debugging on IRC
|
2009-04-28 15:10:20 -04:00
|
|
|
|
|
2012-02-12 06:17:03 -05:00
|
|
|
|
When sending bug reports, please attach the *whole* log file. Even if you think
|
|
|
|
|
you found the section which clearly highlights the problem, additional
|
|
|
|
|
information might be necessary to completely diagnose the problem.
|
2009-04-28 15:10:20 -04:00
|
|
|
|
|
2010-03-10 07:01:27 -05:00
|
|
|
|
When debugging with us in IRC, be prepared to use a so called nopaste service
|
2010-03-20 20:50:10 -04:00
|
|
|
|
such as http://nopaste.info or http://pastebin.com because pasting large
|
|
|
|
|
amounts of text in IRC sometimes leads to incomplete lines (servers have line
|
|
|
|
|
length limitations) or flood kicks.
|