Difference between revisions of "Backtraces"

From AMule Project FAQ
Jump to: navigation, search
Line 3: Line 3:
 
Usually, it should not be necessary for the normal user to do this. However, we might have a bad day and release a somewhat buggy version or you are running [http://www.gnu.org/software/cvs CVS] which can also be unstable sometimes.
 
Usually, it should not be necessary for the normal user to do this. However, we might have a bad day and release a somewhat buggy version or you are running [http://www.gnu.org/software/cvs CVS] which can also be unstable sometimes.
 
This is where the backtraces come in: if [[aMule]] crashes, and you get an "OOPS - aMule crashed" and so on, we'd like to know. The backtrace [[aMule]] provides is not always very usefull as it contains little information, but, as usual, there's a better way: A *real* backtrace.
 
This is where the backtraces come in: if [[aMule]] crashes, and you get an "OOPS - aMule crashed" and so on, we'd like to know. The backtrace [[aMule]] provides is not always very usefull as it contains little information, but, as usual, there's a better way: A *real* backtrace.
 
  
 
First of all, you need the [http://www.gnu.org/software/gdb/gdb.html GNU Debugger] installed. It's called ''gdb'' and you could check for that by typing ''which gdb'' in a console window. You should see something like this:
 
First of all, you need the [http://www.gnu.org/software/gdb/gdb.html GNU Debugger] installed. It's called ''gdb'' and you could check for that by typing ''which gdb'' in a console window. You should see something like this:
Line 20: Line 19:
  
 
If that is the case, the [http://www.gnu.org/software/gdb/gdb.html GNU Debugger] is most likely not installed on your system and you should install it before you proceed.
 
If that is the case, the [http://www.gnu.org/software/gdb/gdb.html GNU Debugger] is most likely not installed on your system and you should install it before you proceed.
 +
 +
If your OS is Gentoo Linux you have just to type that:
 +
''<pre>
 +
# emerge gdb
 +
</pre>''
  
 
Then, compile [[aMule]] with debugging information:
 
Then, compile [[aMule]] with debugging information:
Line 40: Line 44:
 
If you are unable or unwilling to recompile, or are running a RPM version, proceed anyway, but be aware that backtraces from debugging enabled builds are much more useful to us.
 
If you are unable or unwilling to recompile, or are running a RPM version, proceed anyway, but be aware that backtraces from debugging enabled builds are much more useful to us.
  
Now create in your home directory the file .gdbinit and put these lines into it:
+
Now create in your home directory the file ''.gdbinit'' and put these lines into it:
 
''<pre>
 
''<pre>
 
ha SIGPIPE nostop noprint pass
 
ha SIGPIPE nostop noprint pass
Line 47: Line 51:
  
 
For those who want to know the meaning of the previous lines:
 
For those who want to know the meaning of the previous lines:
<pre>
+
the first one avoid [http://www.gnu.org/software/gdb/gdb.html GDB] stopping at broken pipes;
the first one avoid [http://www.gnu.org/software/gdb/gdb.html gdb] stopping at broken pipes;
+
the second one avoid [http://www.gnu.org/software/gdb/gdb.html GDB] stopping at new thread.
the second one avoid [http://www.gnu.org/software/gdb/gdb.html gdb] stopping at new thread.
+
 
</pre>
+
To create a backtrace, open a console and do the following:
 +
 
 +
''<pre>
 +
$ gdb /where/to/install/aMule/bin/amule
 +
(gdb) run
 +
</pre>''
 +
 
 +
Now use [[aMule]] normally until it crashes. If it crashes do the following:
 +
 
 +
''<pre>
 +
(gdb) bt
 +
(gdb) bt full
 +
</pre>''
  
To create a backtrace, do the following:
+
Post the output of the last two commands in the [http://www.amule.org/amule/board.php?boardid=33 backtraces forum] with some additional comment about the circumstances the segfault happened and what [[aMule]] version you used (or checkout time for [http://www.gnu.org/software/cvs CVS]).
<ol>
+
<li>Run ''gdb /where/to/install/aMule/bin/amule''
+
<li>Enter ''run''.
+
<li>Use [[aMule]] normally until it crashes.
+
<li>Enter ''bt''
+
<li>Enter ''bt full''
+
<li>Post the output of the last two steps in the [http://www.amule.org/amule/board.php?boardid=33 backtraces forum] with some additional comment about the circumstances the segfault happened and what [[aMule]] version you used (or checkout time for [http://www.gnu.org/software/cvs CVS]).
+
</ol>
+
  
 
So, that's it, have fun with [[aMule]]
 
So, that's it, have fun with [[aMule]]

Revision as of 17:00, 2 August 2004

Well, not hard to guess, this is about backtraces.

Usually, it should not be necessary for the normal user to do this. However, we might have a bad day and release a somewhat buggy version or you are running CVS which can also be unstable sometimes. This is where the backtraces come in: if aMule crashes, and you get an "OOPS - aMule crashed" and so on, we'd like to know. The backtrace aMule provides is not always very usefull as it contains little information, but, as usual, there's a better way: A *real* backtrace.

First of all, you need the GNU Debugger installed. It's called gdb and you could check for that by typing which gdb in a console window. You should see something like this:

$ which gdb
/usr/bin/gdb

If you dont have GDB installed, you will get a message like this:

$ which gdb
which: no gdb in (/bin:/usr/bin:[sic])

If that is the case, the GNU Debugger is most likely not installed on your system and you should install it before you proceed.

If your OS is Gentoo Linux you have just to type that:

# emerge gdb

Then, compile aMule with debugging information:

$ ./configure --enable-debug --disable-optimise --prefix=/where/to/install/aMule
$ make
$ make install

If you do not want to overwrite you old copy of aMule, simply do this instead:

$ ./configure --enable-debug --disable-optimise
$ make

aMule can then be run by going into the dir src and typing ./amule

If you are unable or unwilling to recompile, or are running a RPM version, proceed anyway, but be aware that backtraces from debugging enabled builds are much more useful to us.

Now create in your home directory the file .gdbinit and put these lines into it:

ha SIGPIPE nostop noprint pass
ha SIG32 nostop noprint pass

For those who want to know the meaning of the previous lines: the first one avoid GDB stopping at broken pipes; the second one avoid GDB stopping at new thread.

To create a backtrace, open a console and do the following:

$ gdb /where/to/install/aMule/bin/amule
(gdb) run

Now use aMule normally until it crashes. If it crashes do the following:

(gdb) bt
(gdb) bt full

Post the output of the last two commands in the backtraces forum with some additional comment about the circumstances the segfault happened and what aMule version you used (or checkout time for CVS).

So, that's it, have fun with aMule

Greetings, Citroklar

(Most of the above shamelessly stolen from pure_ascii's post in backtraces forum, thanks, pure!)

Please read this to learn more about GDB and Valgrind.