I'm running kernel 2.6.35 on a custom embedded device (ARMv7). I'm trying to get a core dump but it appears core dumps are disabled.

My kernel config can be found here: https://pastebin.com/XXZ8YyaA

My test application is the following:

int main() {
    return 1/0;

I expect the following:

Floating point exception (core dumped)

But instead get this:

Floating point exception

Meaning core dumps are disabled. How can I enable them for my platform? It looks like the option to toggle functionality in the kernel CONFIG_COREDUMP wasn't added till kernel version 3.7. Is it not always enabled in previous kernels?

# ulimit -a
-t: cpu time (seconds)              unlimited
-f: file size (blocks)              unlimited
-d: data seg size (kbytes)          unlimited
-s: stack size (kbytes)             8192
-c: core file size (blocks)         unlimited
-m: resident set size (kbytes)      unlimited
-u: processes                       1710
-n: file descriptors                1024
-l: locked-in-memory size (kbytes)  64
-v: address space (kbytes)          unlimited
-x: file locks                      unlimited
-i: pending signals                 1710
-q: bytes in POSIX msg queues       819200
-e: max nice                        0
-r: max rt priority                 0
-N 15:                              unlimited
# ./crash
Floating point exception  
  • Is the core dump file size set to zero? Test with ulimit -c. Change it to unlimited with ulimit -c unlimited. – Kusalananda Jan 3 at 17:01
  • There are know bugs in those kernel versions that make the kernel/any server using it hang once in a while. Hope you are trying to debug such a situation. – Rui F Ribeiro Jan 3 at 17:18
  • @Kusalananda Doesn't matter if ulimit -c is set to 0 or unlimited, core dumps are disabled. It should still report a core dump regardless if it creates the file or not. – dangeroushobo Jan 3 at 17:49

The missing kernel option was CONFIG_ELF_CORE.

General setup -> Configure standard kernel features (for small systems) -> Enable ELF core dumps

After enabling this I'm able to get core dumps.

# ./crash
Floating point exception (core dumped)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.