简体   繁体   中英

gdb core file missing

I used to use GDB to debug my C/C++ program. But after the server crashed and reinstalled, the GDB is not working properly. After the program reports a 'core dumped', actually the core file is not found. My flags to compile is:

CFLAGS=     -ggdb -g -pg -Wall -O2 $(shell pkg-config --libs glib-2.0 gthread-2.0 --cflags glib-2.0)

And I also set this:

ulimit -c unlimited

I already remove all object/executable files and recompile. But the core file is simply missing. Could anybody tell what is other probable reason? Thanks.

On my machine (Ubuntu 12.04), the file /proc/sys/kernel/core_pattern pipes the core dumped result to /usr/share/apport/apport :

|/usr/share/apport/apport %p %s %c

So changed to pattern:

sudo bash -c 'echo core.%e.%p > /proc/sys/kernel/core_pattern'

It works.

Reference: Unable to create a core file for my crashed program

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM