Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 11-16-2007, 03:39 PM   #1
Registered: May 2006
Location: UK
Distribution: Debian
Posts: 448

Rep: Reputation: 37
Generating a backtrace for dummies (me).

Hello I figure this is the best forum for this.

I was wondering if someone could provide some insight into generating a decent backtrace for a bug report. Not something I usually have to do.

One of my favourite programs, rtorrent, dies on opening a .torrent file. So I:

1) recompile the program, enabling debug symbols
2) install gdb
3) "gdb rtorrent"
4) gdb> "run"

Then I make it die by opening a .torrent.

I then type "backtrace"

to which gdb retorts: "No stack".


Have I missed something? I figure it is something simple I forgot to do.

Also if you have any other advice on what to include (and maybe how to get it) in "the perfect bug report" please chip in.

Many Thanks,

Old 11-17-2007, 04:50 PM   #2
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,575

Rep: Reputation: 181Reputation: 181
When the program crashes, gdb prints something. What it is?
Old 11-17-2007, 06:38 PM   #3
Registered: May 2006
Location: UK
Distribution: Debian
Posts: 448

Original Poster
Rep: Reputation: 37
It says: program exited with error code 0377.

Last edited by Daws; 11-17-2007 at 06:52 PM. Reason: 0377 not 037 sorry.
Old 11-17-2007, 08:11 PM   #4
HCL Maintainer
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 76
Originally Posted by Daws View Post
It says: program exited with error code 0377.
A backtrace of the kind you are seeking will only be available when the program crashes (i.e., the debugger catches the SIGSEGV signal and halts execution), not dies gracefully. In your case, it seems the program itself detects the error and makes a graceful exit. So you have to set a breakpoint for a function you think will be in the stack trace of the guilty code (you could go all the way back to main() if youd like). Then, keep typing next until you see the problem occurring. At that point, type backtrace. Its kind of hard to explain since debugging is an art.
Old 11-17-2007, 08:18 PM   #5
Registered: May 2006
Location: UK
Distribution: Debian
Posts: 448

Original Poster
Rep: Reputation: 37
Ahh ok. I thought I was doing something wrong. Fortunately, it is not something I come across on a regular basis. I guess I will have to wait until I do and then I will learn to do it properly


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
backtrace your program? lswhbcb Programming 6 05-25-2007 12:35 AM
Alsa backtrace? hosler Slackware 9 02-07-2006 01:23 AM
kde crash backtrace help MRDucks Mandriva 1 11-14-2005 02:10 PM
SUSE Linux 9.3 for Dummies (For Dummies S.) samuelmp SUSE / openSUSE 11 08-01-2005 02:42 PM
How to interpret backtrace (gdb) jnusa Programming 1 12-06-2004 10:16 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:47 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration