tutorials:troubleshooting:coredumpfile
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorials:troubleshooting:coredumpfile [2020/09/04 08:50] – [What do do with a core file] miconda | tutorials:troubleshooting:coredumpfile [2021/04/29 06:22] (current) – miconda | ||
---|---|---|---|
Line 6: | Line 6: | ||
After a crash of the server it may generate a core file in its working directory, if the functionality is not disabled. This core file can be used to get the cause (or at least a hint) of the crash. The core file contains the memory of the process at the moment it crashes as well as the execution trace, so it could contain sensitive data. | After a crash of the server it may generate a core file in its working directory, if the functionality is not disabled. This core file can be used to get the cause (or at least a hint) of the crash. The core file contains the memory of the process at the moment it crashes as well as the execution trace, so it could contain sensitive data. | ||
- | ===== Potential | + | ===== Potential |
* Invalid input data, e.g. some messages or from the database | * Invalid input data, e.g. some messages or from the database | ||
* Errors in the program code, e.g. null pointer access | * Errors in the program code, e.g. null pointer access | ||
- | ===== What to do with a core file ===== | + | ===== Analyze Core File ===== |
Core files can be examined with **gdb**, the GNU debugger. It can read the crash informations, | Core files can be examined with **gdb**, the GNU debugger. It can read the crash informations, | ||
Line 51: | Line 51: | ||
If you don't understand the information that gdb prints, some developer on the mailling list should be able to help you. | If you don't understand the information that gdb prints, some developer on the mailling list should be able to help you. | ||
- | ===== How do get a core file ===== | + | ===== How To Get Core Files ===== |
Sometimes the server don't write the core file after a crash. | Sometimes the server don't write the core file after a crash. | ||
Line 65: | Line 65: | ||
</ | </ | ||
- | in the shell where you started the server. If you run from a init script it should normally already take care of this. If its still not create a core file then perhaps the server has no permissions to write into its working directory, check its permissions and the startup option " | + | in the shell where you started the server. If you run from a init script it should normally already take care of this. If its still not create a core file then perhaps the server has no permissions to write into its working directory, check its permissions and the startup option " |
+ | |||
+ | On some operating systems it may be required to run Kamailio as privileged user (e.g., root) or change the **fs.suid_dumpable** sysctl setting: | ||
+ | |||
+ | * https:// | ||
To get per-process core file then you can use on Linux: | To get per-process core file then you can use on Linux: | ||
Line 79: | Line 83: | ||
</ | </ | ||
+ | ==== CentOS Core Dump Settings ==== | ||
+ | |||
+ | For CentOS 7, the following settings can be useful: | ||
+ | |||
+ | Edit **/ | ||
+ | |||
+ | < | ||
+ | kernel.core_pattern = / | ||
+ | kernel.core_uses_pid=1 | ||
+ | fs.suid_dumpable = 2 | ||
+ | </ | ||
+ | |||
+ | Run **sysctl --system** to reload kernel parameters. | ||
+ | |||
+ | Edit **/ | ||
+ | |||
+ | < | ||
+ | DUMP_CORE=yes | ||
+ | </ | ||
===== Useful Links ===== | ===== Useful Links ===== |
tutorials/troubleshooting/coredumpfile.1599209448.txt.gz · Last modified: 2020/09/04 08:50 by miconda