1

Does /proc/sys/kernel/core_pattern decide where core dump files are created? Mine looks like

$ cat /proc/sys/kernel/core_pattern
|/usr/share/apport/apport %p %s %c %d %P

which I guess means to pipe the core dump to the apport script. Will the apport script write the input core dump to some file? If yes, where will the file be created? (My /var/crash/ doesn't have a core dump file from the following commands, and /var/lib/systemd/coredump/ is always empty for the following commands.)

When the soft limit for core file is 0, there is no core dump file in the current directory. Where is it created? ("If the message says “(core dumped)” then core really was dumped.")

$ ulimit -S -c 
0
$ sleep 10
^\bash: line 1: 11837 Quit                    (core dumped) sleep 10
$ ls core
ls: cannot access 'core': No such file or directory

When I increase the soft limit, why do I get a core dump file in the current working directory?

$ ulimit -S -c 1024;
$ ulimit -S -c;
1024
$ sleep 10
^\Quit (core dumped)
$ ls core
core

Thanks.

  • Does the last part (a core file is created in the current directory if ulimit -c unlimited was set) also happen if you set (as root) systctl kernel.core_pattern='|/bin/true'? (this should cause a process killed with SIGQUIT to report (core dumped), but no core file to be written anywhere). – mosvy Dec 2 '18 at 4:13
  • 1
    stackoverflow.com/a/18368068/10306503, especially the part about how apport is doing itself the core file creation in cwd – mosvy Dec 2 '18 at 5:08

Your Answer

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

Browse other questions tagged or ask your own question.