Chinaunix首页 | 论坛 | 博客
  • 博客访问: 541065
  • 博文数量: 493
  • 博客积分: 2891
  • 博客等级: 少校
  • 技术积分: 4960
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-17 17:11
文章分类

全部博文(493)

文章存档

2010年(493)

分类:

2010-05-12 16:42:57

研发接到问题单后,先用gdb工具对产生的core文件进行分析。使用命令:bt ,发现在堆栈中显示:
#0  0x40228417 in () from /lib/i686/libc.so.6
#1  0x080d5c6d in HMS_GetTotalDiskVolume() ()
    at om-agent-mib/hms_getsysperf.cpp:912
#2  0x080c4c7b in System_File_Info::get_hd_total_volume(int&) (this=0x81d2fc0,
) at om-agent-mib/hms_platform_basicinfo.cpp:514
使用 f 命令查看每一条详细信息,发现是在调用fclose函数时出错,导致系统死机。使用打印命令打印出fclose函数所释放的文件指针时,发现文件指针fp竟然是个空指针。
查看相应位置的代码,发现在释放这个文件指针前,没有对这个文件指针进行检查是否不为空
阅读(388) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~