- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- On gdb ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2002 06:55 AM
10-01-2002 06:55 AM
On gdb ...
At times when I do a "bt" on the core the stack it shows is limited. Why is it so. How can I get the whole stack ... or at least 30 to 40 stacks.
Thanks and Regards
Vishal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2002 09:07 AM
10-01-2002 09:07 AM
Re: On gdb ...
kaps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2002 09:24 AM
10-01-2002 09:24 AM
Re: On gdb ...
Why you don??t use what command to check the core file ?
> what
You can also check this:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x2e8f93e260b0d611abdb0090277a778c,00.html
Hope it helps you.
Regards,
Bassoi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2002 01:40 AM
10-02-2002 01:40 AM
Re: On gdb ...
When a coredump happens and when it is being analysed using gdb debugger, the backtrace command ("bt") fetches the contents of the stack of the core.
At times the number of stacks it shows is quite a good number e.g. 25-30. At times it show 3 or 4. Why does this vary ? I guess it is something to do with the core ... I mean when/how the core was created. Any idea about increasing the stacks that gdb will display when performing a bt ?
"what" doesn't help much I believe
Thanks and Regards
Vishal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2002 02:09 PM
10-02-2002 02:09 PM
Re: On gdb ...
2. You may get better answers from a newer wdb from http://www.hp.com/go/wdb .
3. You may get better answers from a newer libcl.2 such as in patch PHSS_27469 for 11.00. The stack unwind routines are in libcl.2, (but wdb might have its own.)
4. If the program has damaged the stack, you may be able to get more information by dumping the stack contents yourself.
Even when a stack is too damaged for wdb to unwind it, there are
probably several real return addresses in the stack. You can dump the
contents of the stack yourself and try to pick out the addresses that
are return pointers. The "/a" format will print an address as an offset
from a symbol if it's value is close to some symbol.
You could use wdb and a command like
set print array on
print /a (*($sp-200))@50
or
set print array on
set print elements 500
print /a (*($sp-2000))@500
Then look for an interesting pattern of function addresses. The last
data printed would be closest to the final routine that core dumped. There
will probably be a few values that look like return pointers but are not
really used as return pointers. That leaves room for imagination and
detective work identifying the plausible situations that match the
evidence. Try using the mechanism when you can see the call stack to
get an idea what to expect.
Real return pointers have low bits of 0x3, (indicating a low privilege
level). You can use the "disassemble" command to examine around likely
return addresses to see if they follow a calling instruction such as bl,
ble, or bve. If the code did not make a call it is not a true return
address.
---------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2002 02:15 PM
10-02-2002 02:15 PM
Re: On gdb ...
option. That option is also enabled by -O, so an optimized compile should "just work".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2002 11:09 PM
10-02-2002 11:09 PM
Re: On gdb ...
I tried what u said ... but couldn't distinguish the function calls ... However have got enough clue on where to start. So will proceed in that direction.
Can u please let me know why the message "Cannot access memory at address 0x[Some Address]" appears in gdb (I never use wdb but gdb .. the reason is its a GUI and my network is a slow one; so its difficult to work on motif applications after exporting the DISPLAY. I have to wait for minutes to get the screen refreshed. Hope there is no drastic difference between wdb and gdb). U mentioned about libc ... is it something to do with it ? If so can u please give me some details/pointers ... ?
Thanks and Regards
Vishal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2002 11:56 PM
10-02-2002 11:56 PM
Re: On gdb ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2002 03:45 AM
10-03-2002 03:45 AM
Re: On gdb ...
Even if the executable is stripped and has no debugging info, we can make use of gdb and get a very good back trace info by ftpying the core to the dev box ... running gdb on the same version of the executable (we have a dev/test machine that is an exact replica of the prod box with unstripped exec instead of stripped exec code). So I get all those info. But the problem I'm facing is that I get the backtrace info upto the 3rd part libs and libc. Given below is a sample
(gdb)
#0 0xc0dd9e88 in _XFlushInt () from /usr/lib/libX11.3
#1 0xc0dd9dd4 in _XFlush () from /usr/lib/libX11.3
#2 0xc0dcfd50 in XRaiseWindow () from /usr/lib/libX11.3
#3 0xc63e291c in WinNatPopToFront () from /opt/net/ccia/lib/libndvgmcpp.sl
Cannot access memory at address 0xc63dd0d8
(gdb)
A "bt full" does not help much nor analyzing these stacks ... coz I'm not intereted in the 3rd party libs nor in the libX11. Before I can put the blame on these libs I need to make sure that I'm clean. So I need to go furthur down ... I need to know which function of my program is calling these 3rd party/X11 libs and have to make sure that everything is fine there. But unfortunately that is missing in the gdb trace. As u mentioned I can rely on the logs/nohup files. But sadly the production logs are always minimal. So the question how can I increase gdb displaying the number of stacks. If I can get upto 30 stacks (instead of 3 as shown above) ... the problem is completely solved coz I can define my problem properly.
Thanks and Regards
Vishal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2002 04:29 AM
10-03-2002 04:29 AM
Re: On gdb ...
If you use the format:-
gdb
(gdb)
#0 0xc0dd9e88 in _XFlushInt () from /usr/lib/libX11.3
#1 0xc0dd9dd4 in _XFlush () from /usr/lib/libX11.3
#2 0xc0dcfd50 in XRaiseWindow () from /usr/lib/libX11.3
#3 0xc63e291c in WinNatPopToFront () from /opt/net/ccia/lib/libndvgmcpp.sl
Cannot access memory at address 0xc63dd0d8
(gdb)
and then
(gdb) disassem 0xc63e291c
Does that go far enough back?
Remember that a core file is what was in memory at the time of the failure and a "bt" will only go as far back as that.
Also if this core dump is predictable then a "tusc" trace on the pid as the core dump occurs may give you more history.
HTH
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2002 06:00 AM
10-03-2002 06:00 AM
Re: On gdb ...
The core shows the "what was in memory at the time of the failure" and interestingly I have my application running normally. So I expect more stacks to be displayed ... One doubt: Does the core shows the active-memory (that has not been swapped out) ? Even in the other case its hard to believe that it dumps only upto 3 stacks and I desperately want more stacks to be displayed ..
So back to sqare one.
Thanks and Regards
Vishal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2002 06:36 AM
10-03-2002 06:36 AM
Re: On gdb ...
To achieve what you require I believe that you will have to run the program from within gdb - this is not something I have tried:-
gdb -e
This link may help:-
http://www.delorie.com/gnu/docs/gdb/gdb_15.html
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2002 11:43 AM
10-03-2002 11:43 AM
Re: On gdb ...
1. If the stack has been trashed or the unwind records are incorrect then gdb will read those bad values and complain that they are not valid addresses.
2. If you unmap a shared library but still have references to it then gdb will complain that the address is not a good address anymore. That address from your example does look like a reasonable address for shared library code, so I am inclined to suspect an unmapped library.
You can get a list of the currently loaded shared libraries with "info share" in gdb.
The matter about getting a newer wdb/gdb/libcl is just about checking that you have the most current patches and releases for the tools you are running.