I am running Fedora core 14. I have a program that occasionally (rarely) segfaults. When this happened most recently I noticed to my consternation that there was no core file generated after the segfault, so I was unable to retroactively gdb the program and core file.
I added an interactive command so that I could intentionally generate a fault that is supposed to generate a core file, and what I found was that sometimes a core file is generated and sometimes it is not generated. I have set the coredumpsize limit to "unlimited" and have plenty of disk space, and a writeable current working directory.
I would like to debug this issue of not generating core files reliably. (I'm sure ther开发者_运维技巧e will be some simple solution, but as of now it eludes me.)
Could someone tell me where to find the source code that generates core dump files when a gcc/g++ program under Linux segfaults or does a floating exception? I'm hoping that having a look at the source code for how core dump files get generated will help me figure out why I don't get one sometimes. I am running FC 14, linux kernel 2.6.35.11-83.
Thanks in advance for any help!
Greg Johnson
I always use lxr when I'm trying to track down whats going in the kernel. exec.c has info in it relating to core dumps. That may be useful to you.
http://lxr.free-electrons.com/source/fs/exec.c
精彩评论