From 95613f50fd4b86c3a8e50c01d58bac8de87811a4 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 4 Jan 2014 11:35:06 +0100 Subject: [PATCH 1/7] docs/debugging: use bzip2 for consistency with the new ticket form (Thanks x33a) --- docs/debugging | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/debugging b/docs/debugging index b258789d..e5d225e3 100644 --- a/docs/debugging +++ b/docs/debugging @@ -65,7 +65,7 @@ crashed, the logfile provides all information necessary to debug the problem. To save a compressed version of the logfile (suitable for attaching it to a bugreport), use: -------------------------------------------------------------------- -DISPLAY=:0 i3-dump-log | gzip -9c > /tmp/i3.log.gz +DISPLAY=:0 i3-dump-log | bzip2 -c > /tmp/i3.log.bz2 -------------------------------------------------------------------- This command does not depend on i3 (it also works while i3 displays From 0fdbc1ab971294c6baa6919ca3c7257dabe1b493 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 4 Jan 2014 11:46:12 +0100 Subject: [PATCH 2/7] docs/debugging: update version numbers --- docs/debugging | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/debugging b/docs/debugging index e5d225e3..b97d7d56 100644 --- a/docs/debugging +++ b/docs/debugging @@ -16,20 +16,20 @@ Please verify that you are using the latest version of i3: --------------- $ i3 --version -i3 version 4.1.2-248-g51728ba (2012-02-12, branch "next") +i3 version 4.7-85-g9c15b95 (2014-01-02, branch "next") --------------- Your version can look like this: -4.1.2 (release version):: +4.7 (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. -4.1.2-248-g51728ba (development version):: -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 +4.7-85-g9c15b95 (development version):: +Your version is 85 commits newer than 4.7, and the git revision of your +version is +9c15b95+. 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. From d91e632959067aad8d35f6dff7989a3e0c42f95b Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 4 Jan 2014 11:46:26 +0100 Subject: [PATCH 3/7] docs/debugging: explain how to enable logging on the fly --- docs/debugging | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/debugging b/docs/debugging index b97d7d56..19812f78 100644 --- a/docs/debugging +++ b/docs/debugging @@ -57,6 +57,13 @@ list of sessions in your desktop manager (gdm, lxdm, …), edit Exec=i3 --shmlog-size=26214400 ------------------------------ +If you cannot restart i3 for some reason, you can enable debug logging on the +fly: + +--------------------------------------- +i3-msg 'debuglog on; shmlog on; reload' +--------------------------------------- + == Obtaining the debug logfile No matter whether i3 misbehaved in some way without crashing or whether it just From 2c06dc0a1f820a572e8dbcc3fffb3fcd8e0e9b71 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 4 Jan 2014 11:54:23 +0100 Subject: [PATCH 4/7] docs/debugging: include supported version, recommend --moreversion --- docs/debugging | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/docs/debugging b/docs/debugging index 19812f78..4b7bd371 100644 --- a/docs/debugging +++ b/docs/debugging @@ -1,7 +1,7 @@ Debugging i3: How To ==================== Michael Stapelberg -December 2012 +January 2014 This document describes how to debug i3 to send us useful bug reports, even if you have no knowledge of C programming. @@ -10,22 +10,25 @@ Thank you for being interested in debugging i3. It really means something to us to get your bug fixed. If you have any questions about the process and/or need further help, do not hesitate to contact us! -== Verify you are using the latest (development) version +== Verify you are using i3 ≥ 4.7 -Please verify that you are using the latest version of i3: +Only the latest major version of i3 is supported, i.e. version 4.7 currently. +To verify which version you are running, use: --------------- -$ i3 --version -i3 version 4.7-85-g9c15b95 (2014-01-02, branch "next") +$ i3 --moreversion +Binary i3 version: 4.7 (2013-12-22, branch "tags/4.7") +Running i3 version: 4.7-84-gac74a63 (2014-01-01, branch "next") (pid 1995) --------------- Your version can look like this: 4.7 (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. +fixed in the development version of i3. Even if the bug is not a known fixed +one, 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. 4.7-85-g9c15b95 (development version):: Your version is 85 commits newer than 4.7, and the git revision of your From 92a50db29e9a842113502067f0eb7746281952cb Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 4 Jan 2014 12:04:43 +0100 Subject: [PATCH 5/7] docs/debugging: merge the debug symbols/backtrace section We rarely have crashes, almost always we just need logs. --- docs/debugging | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/debugging b/docs/debugging index 4b7bd371..88948c50 100644 --- a/docs/debugging +++ b/docs/debugging @@ -81,7 +81,10 @@ DISPLAY=:0 i3-dump-log | bzip2 -c > /tmp/i3.log.bz2 This command does not depend on i3 (it also works while i3 displays the crash dialog), but it requires a working X11 connection. -== Compiling with debug symbols +== On crashes: Obtaining a backtrace + +When i3 crashes, it will display a dialog stating “i3 just crashed”, offering +you to save a backtrace to a text file. To actually get useful backtraces, you should make sure that your version of i3 is compiled with debug symbols: @@ -97,8 +100,6 @@ which is stripped, please check whether your distribution provides debug symbols (package +i3-wm-dbg+ on Debian for example) or if you can turn off stripping. If nothing helps, please build i3 from source. -== Obtaining a backtrace - 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. From a37f784945056f51a5f8829e64c3d8e26eebdb44 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 4 Jan 2014 12:06:21 +0100 Subject: [PATCH 6/7] docs/debugging: use a version command that will work with i3 < 4.3 --- docs/debugging | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/debugging b/docs/debugging index 88948c50..9dec3056 100644 --- a/docs/debugging +++ b/docs/debugging @@ -16,7 +16,7 @@ Only the latest major version of i3 is supported, i.e. version 4.7 currently. To verify which version you are running, use: --------------- -$ i3 --moreversion +$ i3 --moreversion 2>&- || i3 --version Binary i3 version: 4.7 (2013-12-22, branch "tags/4.7") Running i3 version: 4.7-84-gac74a63 (2014-01-01, branch "next") (pid 1995) --------------- From 2326ebfd63820b7c16d219819965c78e3836771a Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 4 Jan 2014 12:15:50 +0100 Subject: [PATCH 7/7] enable shmlog when invoked as i3-with-shmlog, install symlink + .desktop file --- Makefile | 2 +- common.mk | 1 + i3-with-shmlog.xsession.desktop | 5 +++++ src/i3.mk | 1 + src/main.c | 2 +- 5 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 i3-with-shmlog.xsession.desktop diff --git a/Makefile b/Makefile index b0f49e34..ff10dcb5 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ dist: distclean [ ! -d i3-${VERSION} ] || rm -rf i3-${VERSION} [ ! -e i3-${VERSION}.tar.bz2 ] || rm i3-${VERSION}.tar.bz2 mkdir i3-${VERSION} - cp i3-migrate-config-to-v4 generate-command-parser.pl i3-sensible-* i3-dmenu-desktop i3.config.keycodes DEPENDS LICENSE PACKAGE-MAINTAINER RELEASE-NOTES-${VERSION} i3.config i3.xsession.desktop i3.applications.desktop pseudo-doc.doxygen common.mk Makefile i3-${VERSION} + cp i3-migrate-config-to-v4 generate-command-parser.pl i3-sensible-* i3-dmenu-desktop i3.config.keycodes DEPENDS LICENSE PACKAGE-MAINTAINER RELEASE-NOTES-${VERSION} i3.config i3.xsession.desktop i3-with-shmlog.xsession.desktop i3.applications.desktop pseudo-doc.doxygen common.mk Makefile i3-${VERSION} cp -r src libi3 i3-msg i3-nagbar i3-config-wizard i3bar i3-dump-log yajl-fallback include man parser-specs testcases i3-${VERSION} # Only copy toplevel documentation (important stuff) mkdir i3-${VERSION}/docs diff --git a/common.mk b/common.mk index 23ac8e34..b946206d 100644 --- a/common.mk +++ b/common.mk @@ -2,6 +2,7 @@ UNAME=$(shell uname) DEBUG=1 COVERAGE=0 INSTALL=install +LN=ln ifndef PREFIX PREFIX=/usr endif diff --git a/i3-with-shmlog.xsession.desktop b/i3-with-shmlog.xsession.desktop new file mode 100644 index 00000000..8cd9431b --- /dev/null +++ b/i3-with-shmlog.xsession.desktop @@ -0,0 +1,5 @@ +[Desktop Entry] +Name=i3 (with debug log) +Comment=improved dynamic tiling window manager +Exec=i3-with-shmlog +Type=Application diff --git a/src/i3.mk b/src/i3.mk index 395b4cfa..523959df 100644 --- a/src/i3.mk +++ b/src/i3.mk @@ -74,6 +74,7 @@ install-i3: i3 $(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/share/xsessions $(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/share/applications $(INSTALL) -m 0755 i3 $(DESTDIR)$(PREFIX)/bin/ + $(LN) -s i3 $(DESTDIR)$(PREFIX)/bin/i3-with-shmlog $(INSTALL) -m 0755 i3-migrate-config-to-v4 $(DESTDIR)$(PREFIX)/bin/ $(INSTALL) -m 0755 i3-sensible-editor $(DESTDIR)$(PREFIX)/bin/ $(INSTALL) -m 0755 i3-sensible-pager $(DESTDIR)$(PREFIX)/bin/ diff --git a/src/main.c b/src/main.c index 6028e1dd..9f92207b 100644 --- a/src/main.c +++ b/src/main.c @@ -295,7 +295,7 @@ int main(int argc, char *argv[]) { init_logging(); /* On release builds, disable SHM logging by default. */ - shmlog_size = (is_debug_build() ? default_shmlog_size : 0); + shmlog_size = (is_debug_build() || strstr(argv[0], "i3-with-shmlog") != NULL ? default_shmlog_size : 0); start_argv = argv;