LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 11-16-2007, 02:39 PM   #1
Daws
Member
 
Registered: May 2006
Location: UK
Distribution: Debian, Linux From Scratch
Posts: 416
Blog Entries: 1

Rep: Reputation: 30
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".

Hmm.

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,

Daws
 
Old 11-17-2007, 03:50 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,536

Rep: Reputation: 148Reputation: 148
When the program crashes, gdb prints something. What it is?
 
Old 11-17-2007, 05:38 PM   #3
Daws
Member
 
Registered: May 2006
Location: UK
Distribution: Debian, Linux From Scratch
Posts: 416
Blog Entries: 1

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

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

Rep: Reputation: 70
Quote:
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 you’d like). Then, keep typing next until you see the problem occurring. At that point, type backtrace. It’s kind of hard to explain since debugging is an art.
 
Old 11-17-2007, 07:18 PM   #5
Daws
Member
 
Registered: May 2006
Location: UK
Distribution: Debian, Linux From Scratch
Posts: 416
Blog Entries: 1

Original Poster
Rep: Reputation: 30
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
 
  


Reply


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-24-2007 11:35 PM
Alsa backtrace? hosler Slackware 9 02-07-2006 12:23 AM
kde crash backtrace help MRDucks Mandriva 1 11-14-2005 01:10 PM
SUSE Linux 9.3 for Dummies (For Dummies S.) samuelmp Suse/Novell 11 08-01-2005 01:42 PM
How to interpret backtrace (gdb) jnusa Programming 1 12-06-2004 09:16 AM


All times are GMT -5. The time now is 03:33 PM.

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