Issue
When my program segfaults, I expect a coredump but there is none. I thought just compiling with -g was enough to get a core file. Here are the gcc lines from my makefile:
gcc -g -c client.c $(incdirs)
gcc -g -o client client.o $(LIBDIRS) $(LIBS) -lrt -lidn -lssl \
/home/calls/cgi/libcurl/lib/libcurl.a -lezxml -lxmlate $(SQLIBS)
All of the libraries are compiled/linked with -g as well.
And here's the gcc version info:
calls/cgi/client>gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-51)
My question: What more do I have to tell gcc (or anybody else) to get a core file?
Solution
it may be that the core size is set to 0. Try
ulimit -a
if it shows
core file size (blocks, -c) 0
then do
ulimit -c unlimited
(you may need to modify your profile scripts to change this permanently)
Answered By - elijah Answer Checked By - Timothy Miller (WPSolving Admin)