首页 > 其他 > 详细

SIGSEGV导致的Segmentation fault

时间:2014-12-26 18:15:55      阅读:584      评论:0      收藏:0      [点我收藏+]

code as below:

f_read = fopen("records/frame_read.ini", "r");
fclose(f_read);

 


in fact, records/frame_read.ini is not exist.

when I used gdb to debug it, appears "Program received signal SIGSEGV, Segmentation fault. 0xb7ebefc7 in flose() from /lib/i386-linux-gnu/i686/cmov/libc.so.6"

Solve it by using code as below:

f_read = fopen("records/frame_read.ini", "r");
if (f_read != NULL) fclose(f_read);

 

SIGSEGV导致的Segmentation fault

原文:http://www.cnblogs.com/aqing1987/p/4187052.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!