Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-10-2012, 07:34 PM   #1
Registered: Aug 2011
Posts: 40

Rep: Reputation: Disabled
How to view the stack information

When I run the TCL in the GDB.There is an error as follows:
Program received signal SIGFPE, Arithmetic exception.
ZBR::c_skip (Li=50725377) at zbr/
2106 Cm_sum = Cm_sum + pow(NetSystemConfig.Cm, k);

After I run bt to look for stack information. There are some information as follows.But I don't know how to analysis the stack information.Can you help me?Thank you very much.

#0 ZBR::c_skip (Li=50725377) at zbr/
#1 0x082c90d6 in ZBR::rt_clusterhead (this=0x886c220, dst=4)
at zbr/
#2 0x082c7160 in ZBR::recvRequest (this=0x886c220, p=0x8b3f308)
at zbr/
#3 0x082c70b7 in ZBR::recvZBR (this=0x886c220, p=0x8b3f308) at zbr/
#4 0x082c6f2b in ZBR::recv (this=0x886c220, p=0x8b3f308) at zbr/
#5 0x081ce899 in Classifier::recv (this=0x886afb0, p=0x8b3f308, h=0x0)
at classifier/
#6 0x081c71cd in NsObject::handle (this=0x886afb0, e=0x8b3f308)
at common/
#7 0x081c43bc in Scheduler::dispatch (this=0x87f6240, p=0x8b3f308,
t=10.323193112133071) at common/
#8 0x081c42f0 in Scheduler::run (this=0x87f6240) at common/
#9 0x081c449d in Scheduler::command (this=0x87f6240, argc=2, argv=0xbfffd6f8)
at common/
#10 0x083bd85a in TclClass::dispatch_cmd(void*, Tcl_Interp*, int, char const**)
#11 0x083c1431 in OTclDispatch (cd=0x87f6118, in=0x862b3e8, argc=3,
argv=0xbfffd7f0) at otcl.c:434
#12 0x083c546e in TclInvokeStringCommand ()
#13 0x083c7acd in TclEvalObjvInternal ()
#14 0x083f1ff2 in TclExecuteByteCode ()
Old 05-12-2012, 06:15 AM   #2
Senior Member
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Everywhere you see '#<number>' is a stack frame, #0 is the current stack frame. The backtrace command just shows you the sequence of function calls the program made to get to where it is. If this isn't what you were after then maybe you wanted to see what values were actually on the stack -

64bit arch:
display/16xg $rsp
32bit arch:
display/24xw $esp
You can modify the number if you have larger stack usage
Old 05-14-2012, 12:48 AM   #3
Registered: Aug 2011
Posts: 40

Original Poster
Rep: Reputation: Disabled
When I run display/24xw $esp.There are some information as follows.But I don't know what this mean.
0xbfffd380: 0x00000000 0x40100000 0x00000000 0x407ff000
0xbfffd390: 0x08bb3338 0x00000015 0x30553261 0x0004a92a
0xbfffd3a0: 0x00000004 0x00000001 0xe3a22f83 0x4024a5a0
0xbfffd3b0: 0x086e4410 0x00000018 0x55555555 0x7fd55555
0xbfffd3c0: 0x00000000 0x7fd00000 0x00000200 0x30553261
0xbfffd3d0: 0x3f33a92a 0x00000000 0xbfffd418 0x082c9109
Old 05-14-2012, 12:53 AM   #4
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
These are addresses inside the program binary. In general, you will want to compile your program with debug options turned on (-g in gcc) to get human readable translations of the addresses spewed forth by gdb.
Old 05-14-2012, 12:55 AM   #5
Senior Member
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
These are the 32bit values on the stack, they could be saved registers, pointers or temporary variables -it's up to you to know how your program uses the stack and whether each value is valid/expected.


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
View stack of process grob115 Programming 4 03-04-2011 10:06 PM
Nagios user permissions to view any information of the Services requested. sonwayi Linux - Newbie 1 09-20-2010 11:18 AM
Personal Information Manager (Kontact) does not show to-do list items in summary view marietechie Linux - Newbie 1 02-10-2007 11:06 AM
View System Information darkarcon2015 Linux - Software 3 09-22-2005 12:44 PM
can't view floppy information on RH9 PC caf Red Hat 1 05-09-2004 03:50 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:19 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
Open Source Consulting | Domain Registration