- 论坛徽章:
- 0
|
请问在sco unix系统里如何分析core dump文件,找出是因为那个程序的那一行出的错。
我做的过程是:
测试代码如下,文件名为a.c
- #include <stdio.h>;
- int main ()
- {
- char aa [ 10 ][100] ;
- int i = 0 ;
- memset ( aa , 0x00 , sizeof ( aa ) ) ;
- for ( i = 0 ; i<= 20 ; i++ )
- {
- strcpy ( aa[i] , "abcdkadkfasfasfdasjkdfjk" ) ;
- }
- }
复制代码
编译连接a.c,生成 aaa
$ cc -g a.c -o aaa
执行程序aaa ,产生coredump
$ ./aaa
Memory fault(coredump)
用dbx分析core文件
$ dbx ./aaa ./core
Reading symbolic information ...
[using memory image in ./core]
Type 'help' for help.
没有显示出出错的地方
而且执行
(dbx) where
possible stack frame corruption; text address is 0x6b64616b
(dbx)
请指点,谢谢! |
|