To create new wiki account, please join us on #znc at Libera.Chat and ask admins to create a wiki account for you. You can say thanks to spambots for this inconvenience.

Debugging: Difference between revisions

From ZNC
Jump to navigation Jump to search
KindOne (talk | contribs)
Added missing Category. Now shows up in Category page for ZNC
>Mkaysi
→‎Tracing crash bugs: Add instructions to log gdb output so copy-pasting isn't required.
Line 19: Line 19:


<pre>
<pre>
set logging /tmp/znc.gdb.log
set logging on
gdb ./znc
gdb ./znc
handle SIGPIPE nostop
handle SIGPIPE nostop
Line 27: Line 29:


<pre>
<pre>
set logging /tmp/znc.gdb.log
set logging on
gdb ./znc
gdb ./znc
attach pid
attach pid
Line 44: Line 48:
bt full
bt full
</pre>
</pre>
If you had logging file set and logging enabled, you can find the bt full and everything else in /tmp/znc.gdb.log. You might want to copy it somewhere safe and remove things before the backtrace.


=== Why use --enable-debug? ===
=== Why use --enable-debug? ===

Revision as of 15:19, 20 April 2014

Reporting bugs

Steps to do when you think you found a bug:

Tracing crash bugs

Configure your ZNC version with --enable-debug.

./configure --enable-debug --enable-other-things-you-may-want
make
make install

Then you can run ZNC under gdb:

set logging /tmp/znc.gdb.log
set logging on
gdb ./znc
handle SIGPIPE nostop
run -D

If znc is already running, you can attach gdb to the already-running instance (where pid is znc's process id):

set logging /tmp/znc.gdb.log
set logging on
gdb ./znc
attach pid
handle SIGPIPE nostop
cont

Now you use ZNC as you would always do and try to make it crash. Once it crashed, gdb will show you something like this:

Program received signal SIGSEGV, Segmentation fault.

Now we can get the useful info. This info, together with an explanation how the bug happened are then very useful to the developers.

bt full

If you had logging file set and logging enabled, you can find the bt full and everything else in /tmp/znc.gdb.log. You might want to copy it somewhere safe and remove things before the backtrace.

Why use --enable-debug?

With this flag bt full shows much more info, which is needed to understand why the crash had happened. If you're interested in details, search the Web for "debug symbols" or just try with and without.