x****e 发帖数: 8 | 1 1. when will core dump occur?
2. what can you get from core? and how to get it?
Any reference book? Thanks. |
y***y 发帖数: 56 | 2 在精华区里找找,我看到过的。
【在 x****e 的大作中提到】 : 1. when will core dump occur? : 2. what can you get from core? and how to get it? : Any reference book? Thanks.
|
n********g 发帖数: 10 | 3 gdb -c core *.ou
【在 x****e 的大作中提到】 : 1. when will core dump occur? : 2. what can you get from core? and how to get it? : Any reference book? Thanks.
|
c*****z 发帖数: 1211 | 4
core dumped when process receive signal 9 or bus error
u can know the where the program break and the variable
value
by use gdb or ddd.
【在 y***y 的大作中提到】 : 在精华区里找找,我看到过的。
|
s*****g 发帖数: 219 | 5 When you access an address beyond your own, i.e.
write other programs' memory, a core dump occurs
and the OS kill your program.
It usually happen when you use pointer in C. For
example:
main()
{
int *p;
*p = 1000;
printf("%d\n", p);
}
You forget to use malloc/new to allocate memory,
right?
If you compile program by adding -g, say,
$> gcc -g sample.c
Then you can trace the core dump happens in which
line, by using gdb.
$> gdb a.out core
When you are in gdb, use command "bt" or "backtrace"
t
【在 c*****z 的大作中提到】 : : core dumped when process receive signal 9 or bus error : u can know the where the program break and the variable : value : by use gdb or ddd.
|