为什么core文件总是不完整的?

周靖峰 2014-12-16 11:29:16
我运行程序前都加了

ulimit -c unlimited
ulimit -s unlimited
ulimit -m unlimited


但是,每次产生的core文件总是不完整的,gdb显示如下

BFD: Warning: /zjf/ui/IPU3/bin/core is truncated: expected core file size >= 614891520, found: 118554624.

Core was generated by `./visionapp'.
Program terminated with signal 6, Aborted.
#0 0x08ad3f0a in malloc_consolidate ()
(gdb) bt
#0 0x08ad3f0a in malloc_consolidate ()
Cannot access memory at address 0x6463be30


这到底是core文件不完整,还是内存被破坏了啊?
...全文
1283 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
siyitianshi 2015-11-19
  • 打赏
  • 举报
回复
大兄弟,问题解决了吗?我看到时间太久了,回复也没有啥效果了
buyong 2014-12-18
  • 打赏
  • 举报
回复
引用 9 楼 nbda1121440 的回复:
那我问下大家,程序崩溃的时候,不产生core文件是怎么回事?就算内存出错,也应该产生core文件的吧?
不一定,有课能产生不出
menger1216 2014-12-17
  • 打赏
  • 举报
回复
引用 5 楼 buyong 的回复:
这是内存被破坏了,还是查程序问题吧
同意!
  • 打赏
  • 举报
回复
引用 2 楼 nbda1121440 的回复:
什么是soft limit和hard limit? ulimit -c unlimited是soft limit吗? hard limit怎么设置?
/etc/security/limits.conf # man limits.conf: <type> hard for enforcing hard resource limits. These limits are set by the superuser and enforced by the Kernel. The user cannot raise his requirement of system resources above such values. soft for enforcing soft resource limits. These limits are ones that the user can move up or down within the permitted range by any pre-existing hard limits. The values specified with this token can be thought of as default values, for normal system usage. - for enforcing both soft and hard resource limits together.
周靖峰 2014-12-17
  • 打赏
  • 举报
回复
引用 5 楼 buyong 的回复:
这是内存被破坏了,还是查程序问题吧
我想也是内存被破坏了,可是我用valgrind来定位问题时,程序又不崩溃了,难道内存破坏还和程序运行快慢有关系?
buyong 2014-12-17
  • 打赏
  • 举报
回复
这是内存被破坏了,还是查程序问题吧
周靖峰 2014-12-17
  • 打赏
  • 举报
回复
另外

root@localhost:/zjf/ui/IPU3/bin# ulimit -H -c
unlimited
root@localhost:/zjf/ui/IPU3/bin# ulimit -S -c
unlimited
root@localhost:/zjf/ui/IPU3/bin# ulimit -c 
unlimited
现在程序崩溃产生core文件不完整,有时甚至不产生,定位问题很棘手啊
周靖峰 2014-12-17
  • 打赏
  • 举报
回复
哦,我知道了,我的soft limit是1024,hard limit是4096,这和core文件有什么关系?

root@localhost:/zjf/ui/IPU3/bin# ulimit -Hn
4096
root@localhost:/zjf/ui/IPU3/bin# ulimit -Sn
1024
周靖峰 2014-12-17
  • 打赏
  • 举报
回复
什么是soft limit和hard limit? ulimit -c unlimited是soft limit吗? hard limit怎么设置?
周靖峰 2014-12-17
  • 打赏
  • 举报
回复
那我问下大家,程序崩溃的时候,不产生core文件是怎么回事?就算内存出错,也应该产生core文件的吧?
  • 打赏
  • 举报
回复
what's the current soft limit and hard limit?

23,116

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧