From 9262720a65e754942f1a51bde4871575c3a5457c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 1 Aug 2020 09:53:47 +0200 Subject: doc: add instructions to build WeeChat with address sanitizer (user's guide) --- doc/en/weechat_user.en.adoc | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'doc/en') diff --git a/doc/en/weechat_user.en.adoc b/doc/en/weechat_user.en.adoc index 0c5f908ce..5e70968e9 100644 --- a/doc/en/weechat_user.en.adoc +++ b/doc/en/weechat_user.en.adoc @@ -375,12 +375,14 @@ Then follow instructions for source package (see If you experienced crashes, or if you want to report any future WeeChat crash, you have to: -* Compile it with debug info (or install binary package with debug info). +* Compile with: +** debug info (or install binary package with debug info), +** address sanitizer (optional). * Enable _core_ files on your system. * Install gdb. -[[debug_info]] -==== Debug info +[[build_debug]] +==== Build with debug options If you're compiling with CMake: @@ -388,6 +390,17 @@ If you're compiling with CMake: $ cmake .. -DCMAKE_BUILD_TYPE=Debug ---- +You can additionally enable the address sanitizer, which causes WeeChat to +crash immediately in case of problem: + +---- +$ cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS=-fsanitize=address -DCMAKE_CXX_FLAGS=-fsanitize=address -DCMAKE_EXE_LINKER_FLAGS=-fsanitize=address +---- + +[WARNING] +You should enable address sanitizer only if you're trying to cause a crash, +this is not recommended in production. + If you installed a binary package, then install package _weechat-dbg_. [[core_files]] -- cgit v1.2.3