It used to be that I would get Segmentation Fault with no core, then I added -ggdb to the compile command and executed this command in bash prior to executing gcc:
ulimit -c unlimited
All was good for a while (I got a core), but now I get Segmentation Fault (core dumped) but no core in the directory where gcc command was issued? Could it be going somewhere else? What else can I try?
A little additional info:
- OS: Gentoo Linux
- Enable ELF core dumps is enabled in the running kernel.
- The application is a text editor written in gtk+
Answer:
I found it two ways:
find / -name "core" -ls-
As torek suggested:
$ strace ./executable > output.txt 2>&1
$ grep chdir output.txt
As @JonathanLeffler noted, the core dump goes in the current directory.
You can use
straceto see if the process has done a chdir(). Unfortunatelystracedoes not show where the core dump itself went, but:and there is now a core.pid file in there.