$ gdb XXX core.XXX GNU gdb (GDB) Red Hat Enterprise Linux ( 7.0.1-32.el5) Copyright (C) 2009 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" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /home/XXX/XXX...done. BFD: Warning: /home/XXX/core.XXX is truncated: expected core file size >= 747175936, found: 1236992. warning: core file may not match specified executable file. Cannot access memory at address 0x344201cc88
调查 ulimit -a的结果如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
core file size (blocks, -c) 1000 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 40960 max locked memory (kbytes, -l) 32 max memory size (kbytes, -m) unlimited open files (-n) 65000 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 536870912 real-time priority (-r) 0 stack size (kbytes, -s) 1024000 cpu time (seconds, -t) unlimited max user processes (-u) 40960 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited
经别人指点,说是“core file size”的值太小了。
修改core file size的方法 1 使用root用户登录,在/etc/security/limits.conf文件中,添加了“* hard core unlimited”行,添加后此文件的内容大致如下:
1 2 3 4 5 6 7 8 9 10 11
# /etc/security/limits.conf # # Each line describes a limit for a user in the form: # # <domain> <type> <item> <value> # * - msgqueue 536870912 * soft nofile 65000 * hard nofile 65000 * soft core unlimited * hard core unlimited