raised sigabort, but it did not dump core

Viewed 22

I'm tracking down a problem and I thought I'd be smart and put a raise (SIGABRT);in my code when the error happens so I can look at the stack. The error function is part of a statically linked c library that is linked to my main program (a linux command line tool).

For some reason when this error happens the program just exits without creating a coredump when I raise the SIGABRT. For reference I have tested a simple program that just raises it and the coredump is created just fine, my ulimit is unlimited etc.

But I was thinking, after this error my thread terminates. Do I have to keep the program alive long enough fro the SIGABRT to write the dump file?

1 Answers

Do I have to keep the program alive long enough fro the SIGABRT to write the dump file?

No. The core dump is product of the operating system. At the time of execution that you'd want a core dump, the program is too far gone to keep itself alive. The core dump requires OS buy-in.

Where is my core dump?

The core(5) man page contains information on

  • What might cause a core file to not be generated
  • Ways to configure the core generation

There's not enough information in your question to figure out where your core file is, if it was generated at all.

Related