In case of a task exception, you need to record the last words and use GDB for debugging. Therefore, you need to record the coredump file.
View settings:
Run sysctl-A | grep core under the root user to check whether the core file is correctly configured.
Command settings:
1) run the ulimit-C unlimited command to set the maximum space available for coredump files;
Or modify it in VI/etc/security/limits. conf.
2)/proc/sys/kernal/core_pattern you can set the path and file name format generated by coredump. If not modifiedProgramGenerated under the execution directory.
Or use the command to modify:
Sysctl-W kernel. core_pattern =/CORE. % E. % P
If the above two points are set, coredump still cannot be generated, which may be due to the following reasons:
1) Some semaphores do not generate coredump by default. You can use man signal to check them.
2) the hard disk space is insufficient, and coredump requires a lot of hard disk space (upper GB space );
3) The ulimit-C command is valid only on the current terminal, that is, the terminal setting of the program startup. This command is invalid. Of course, coredump cannot be generated.