
Coredump 的解析
1. 什么是coredump
程序出现段错误,内核错误的时候出现的错误文件。
可以通过该文件复现出现错误的位置,查看错误时的各项值,来解决Bug。
2. coredump取得
默认情况下 home/coredump 中可以看到相关文件,文件名:core.xxxxxx
1)使用ulimit -c unlimited命令,开启core dump功能
2)可以通过修改/proc/sys/kernel/core_pattern,控制core文件保存位置。
3. 运行coredump
使用命令格式 gdb [执行程序] [coredump文件名]
例如
[root@localhost coredump]# gdb cplane core.1234
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-94.el7
Copyright © 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type “show copying”
an

最低0.47元/天 解锁文章
882

被折叠的 条评论
为什么被折叠?



