We have a binary that generates coredump. So I ran the gdb command to analyze the issue. Pleae note the binary and code are in two different locations and we cannot build the whole binary using debugging symbols. Hence how and what details can I find from below backtarce:
Please provide me gdb commands that I can issue to find what’s data inside each stack frame , what’s the issue probably is, where it is failing, other debugging methods if any?
Thanks in advance
FYI : if the binary is not compiled with a debug option,
the source with GDB will not help you at all, all you will see is hxa/binay codes for instructions, pointers (adresses) and data --
so unless you can read or have the time to translate machinecode (wich is possible) gdb will not help you .
I've got a core dump in my weblogic home directory, which i have tried to debug by initiating savecore from /etc/init.d/savecore start
but savecore failed to create the two files, that is vmcore.n and vmunix.n.
savecore is enable on my server to save vmcore and vmunix in /var/crash/hostname
1)... (4 Replies)
can some tell me how to do this. I mean, i tried finding this out on my own but when I checked the man pages, i got a truckload of commands available pertaining to this task which in turn got me confused.
so my question is, if there is a simple straight forward(not necessarily easy) way to... (2 Replies)
MY friends:
my program under sco unix have a problem?
it create a core dump file on the path when execute program ,
but i can't find the error of the C program ,i don't know how to
see the error about my program use core, please help me
or give me some suggest and what tools can use... (1 Reply)
Hi All,
i am new to this forum.i want detail of reading the core file and trace the problem because of what the program get crashed.please help me.if any body knows any website or tutoril plese let me know.
sudhir (6 Replies)
Hi All
I am new for this forum. I have a core file by using gdb and bt cmd I got the function name but I want to the exact cause of the core dump because of I can not reproduse the binary so if any one know the cmd plz plz plz let me know. (0 Replies)
Hello all,
Iam new to unix while executing java program which finely working in windows know iam testing with unix ,but in unix while executing iam getting core dump, my application is in client server environment and it is menu drivrn application on clicking options no problem but after some time... (1 Reply)
my progrme complaints 'Segmentation fault'.
How to let it print 'Segmentation fault(core dumped)' and generate core dump file?
$ulimit
unlimited (22 Replies)
Hi guys,
just want to know which core file pattern is best to set for core dumps:
1) per-process file name pattern
or
2) global file name pattern.
I will really appreciate an explanation why the chosen one is better.
Thanks a lot guys. (2 Replies)
Discussion started by: cjashu
2 Replies
LEARN ABOUT REDHAT
njamdpm
NJAMDPM(1) General Commands Manual NJAMDPM(1)NAME
njamdpm - Not Just Another Malloc Debugger Post-Mortem
SYNOPSIS
njamdpm [OPTIONS] <HEAP FILE>
DESCRIPTION
njamdpm is a companion utility that allows you to examine the persistent heap saved by libnjamd(3) You can do things like query for certain
addresses, show memory leaks, and show all past allocated memory. As of NJAMD 0.6.0, gdb(1) is required to make sense of the return
addresses.
USAGE
Options
HEAP FILE
The heap file will be in the current directory with a name of the form njamd-<pid>-heap, but only if NJAMD_PERSISTANT_HEAP was in
the environment at the time of program execution
-a address
Search through the heap file for a chunk of memory that contains address. This can be VERY helpful when using gdb. Simply find the
address that you accessed to cause the segmentation fault, use njamdpm to look it up in the heap, and viola! You have all sorts of
info about the chunk: When it was allocated, when it was freed, how big is is, etc.
-d depth
When displaying return address info, only display depth return addresses. The max is specified in ./include/lib/njamd.h in the
define TRACE_DEPTH (default is 3).
-t Trim the heap file down to only the used portion. This is useful if for some reason the program somehow exits without trimming its
own heap file down first. Note that when the heap file appears huge it's not actually taking up disk space.
-s Dump basic status info about peak memory usage, NJAMD overhead, etc. Useful for determining if you should buy more ram, or write me
an angry email :)
-l Dump memory leaks in the heap. Also shows you info about where the memory was leaked, along with a total. Do note that this total
and the subtotals are aligned bytes. They are aligned to the alignment of your architecture, or as specified by the value the
NJAMD_ALIGN environment variable had when the heap was created.
-f Dump freed memory in the heap. This option is only available if LIBNJAMD ran without NJAMD_CHK_FREE=none set.
Using gdb with njamdpm
When a segmentation fault happens, it's because, of course, you accessed an invalid address. So all you need to do is get gdb to give you
the address you accessed, and then feed it to njamdpm. Ie if the segfault occurs on a line that does buf[i] = 2, issue print &buf[i] to
gdb. Note that libnjamd(3) now has a function __nj_ptr_info that can be called from gdb that performs all this without njamdpm.
To get gdb to translate these return addresses into something meaningful, issue
info line *0xaddress
to obtain the line number of the allocation request, or
list *0xaddress
to see the adjacent code as well.
NOTES
Eventually I hope to add symbol translation right into njamdpm.
AUTHORS
Mike Perry <mikepery@fscked.org>
SEE ALSO
http://freshmeat.net/appindex/development/debugging.html
njamd(3), efence(3), malloc(3), mmap(2), mprotect(2)
NJAMD - 5 Oct 2000 NJAMDPM(1)