Debugging Bluefish: Difference between revisions

From Bluefish Wiki
Jump to navigation Jump to search
(14 intermediate revisions by 3 users not shown)
Line 1: Line 1:
==== Howto provide Bluefish debugging information====
__TOC__


=== For a specific release===
= Providing information =


* get the source of this release
In general: It is always a good idea to tell us your version of Bluefish and your version of '''GTK/Glib installed''' on your system, both can be found in the '''About''' menu. Also don't forget to mention the platform (Linux, OSX, Windows, FreeBSD, etc.) and it's version. If you have the possibility to test it on multiple computers with different platforms or versions this will really help to track down the problem. If you can reproduce a crash on some specific file, please send us the file too. The smaller the file, the easier for us to debug the issue.


=== For the latest development release===
Crash reports / bugs are collected here: https://bugzilla.gnome.org/page.cgi?id=browse.html&product=bluefish


* get the latest cvs release (info on the development page) if the latest stable release is already some months old
= Specific crash information =


=== Compile with debugging output===
== Debugging symbols  ==


* use ./configure --with-debugging-output
To create a meaningful backtrace you'll need a binary with the debugging symbols attached. Otherwise your backtrace will contain a lot of question marks and won't be useful.
* make clean
* make
''' '''do not run make install* since it strips the debugging symbols from the executable


=== Run Bluefish in the debugger===
=== Compile with debugging symbols from source ===


''' use 'gdb src/bluefish' to run bluefish in the debugger, '''do not* run gdb bluefish or gdb /usr/local/bin/bluefish since these binaries do not have any debugging symbols anymore
[http://bfwiki.tellefsen.net/index.php/Getting_Bluefish#Downloading_the_source Get the source].
* type 'r' to start
* reproduce the crash
* copy & paste the last 50 lines of debugging output to an email
* type 'bt' to get the backstrace info, and copy it also to the mail (if it is over 50 lines, the first lines of the backtrace info are the most interesting)
* send the mail to the general address, the mailinglist or a specific developer


This is what a [[Backtrace Should Look Like]].
The Bluefish makefile strips the debugging symbols during the installation step ('''make install'''). In this case only re-compile the sources, run make install to install required files (in /usr/local/share/bluefish) and then run the resulting binary from the compile directory '''src/bluefish''' in the GNU Debugger.


==== What other information you should provide to the developers====
=== Install debugging symbols on Debian/Ubuntu systems ===


* the platform you are using
For Debian and Ubuntu there might be packages available with debugging symbols. This package is called bluefish-dbg. Just install it the usual way, for example from the commandline with "apt-get install bluefish-dbg". If they are not available for your distribution or version you have to compile from source.
* the gtk version you are using
* the compiler version you are using
* any non-default ./configure options
* the pcre version you are using if you think that is related
* the gnome-vfs version you are using if you think that is related
* the libaspell version you are using if you think that is related


=== debugging a Gtk-Critical error===
You might need some more packages of this type: '''libc6-dbg''', '''libglib2.0-0-dbg''', '''libgtk-3-0-dbg''', '''libpcre3-dbg''', '''libxml2-dbg'''.


If you set the environment var G''DEBUG to fatal''warnings (export G''DEBUG=fatal''warnings with bash), it should assert when there is an error. If you then launch your program with gdb, you can get a backtrace.
== Run Bluefish in the debugger ==
 
=== Create a meaningful backtrace ===
 
To run Bluefish in the GNU Debugger (assuming you have just compiled it, and ran make install), use:
 
gdb src/bluefish
 
Then ('''(gdb)''' represents the gdb shell prompt!):
 
(gdb) set logging on
Copying output to gdb.txt.
(gdb) r
 
This will start bluefish. Now reproduce the crash and then create the backtrace:
 
Program received signal SIGSEGV, Segmentation fault.
...
(gdb) bt full
...
(gdb) quit
 
Now you'll find a file '''gdb.txt''' in the directory. [https://bugzilla.gnome.org/enter_bug.cgi?product=bluefish Open a report in our BTS] and attach this file to the report. This is what a [[Backtrace Should Look Like]].
 
=== Debugging a Gtk-Critical error ===
 
If you set the environment variable '''G_DEBUG''' to ''fatal_warnings'', e.g.
 
export G_DEBUG=fatal_warnings
 
with bash, it should assert when there is an error. Then launch bluefish with gdb as told you above and you can get a backtrace.
 
= debugging on windows =
mypaint has a good tutorial: https://github.com/mypaint/mypaint/wiki/Debugging-crashes-on-Windows
 
 
 
References: <references/>

Revision as of 20:48, 1 May 2017

Providing information

In general: It is always a good idea to tell us your version of Bluefish and your version of GTK/Glib installed on your system, both can be found in the About menu. Also don't forget to mention the platform (Linux, OSX, Windows, FreeBSD, etc.) and it's version. If you have the possibility to test it on multiple computers with different platforms or versions this will really help to track down the problem. If you can reproduce a crash on some specific file, please send us the file too. The smaller the file, the easier for us to debug the issue.

Crash reports / bugs are collected here: https://bugzilla.gnome.org/page.cgi?id=browse.html&product=bluefish

Specific crash information

Debugging symbols

To create a meaningful backtrace you'll need a binary with the debugging symbols attached. Otherwise your backtrace will contain a lot of question marks and won't be useful.

Compile with debugging symbols from source

Get the source.

The Bluefish makefile strips the debugging symbols during the installation step (make install). In this case only re-compile the sources, run make install to install required files (in /usr/local/share/bluefish) and then run the resulting binary from the compile directory src/bluefish in the GNU Debugger.

Install debugging symbols on Debian/Ubuntu systems

For Debian and Ubuntu there might be packages available with debugging symbols. This package is called bluefish-dbg. Just install it the usual way, for example from the commandline with "apt-get install bluefish-dbg". If they are not available for your distribution or version you have to compile from source.

You might need some more packages of this type: libc6-dbg, libglib2.0-0-dbg, libgtk-3-0-dbg, libpcre3-dbg, libxml2-dbg.

Run Bluefish in the debugger

Create a meaningful backtrace

To run Bluefish in the GNU Debugger (assuming you have just compiled it, and ran make install), use:

gdb src/bluefish

Then ((gdb) represents the gdb shell prompt!):

(gdb) set logging on
Copying output to gdb.txt.
(gdb) r

This will start bluefish. Now reproduce the crash and then create the backtrace:

Program received signal SIGSEGV, Segmentation fault.
...
(gdb) bt full
...
(gdb) quit

Now you'll find a file gdb.txt in the directory. Open a report in our BTS and attach this file to the report. This is what a Backtrace Should Look Like.

Debugging a Gtk-Critical error

If you set the environment variable G_DEBUG to fatal_warnings, e.g.

export G_DEBUG=fatal_warnings

with bash, it should assert when there is an error. Then launch bluefish with gdb as told you above and you can get a backtrace.

debugging on windows

mypaint has a good tutorial: https://github.com/mypaint/mypaint/wiki/Debugging-crashes-on-Windows


References: <references/>