当前位置:网站首页>Generation method and usage of coredump

Generation method and usage of coredump

2022-06-25 14:58:00 qq_ twenty-three million nine hundred and fifty-three thousand

1, How to enable generation coredump file
echo “ulimit -c 1024” >> /etc/profile // Limit generation core The size of the file is 1024KB
Or input directly on the console ulimit -c // Don't limit core File size
Remove the restrictions ulimit -c unlimited
2, Check to see if it opens
ulimit -a see
3, modify core File storage path
echo “/corefile/core-%e-%p-%t” > /proc/sys/kernel/core_pattern
%e Command name
%p pid
%t Time stamp
4, debugging
gdb main /corefile/xxxxxx
5,core The default storage path for files
cat /proc/sys/kernel/core_pattern Just view it in the file

ulimit Introduce

type
soft: The effective value of the current system
hard The maximum value set in the current system
soft The limits of can't be compared with hard High limit of
resource:
core - Limit the size of kernel files
date - Maximum data size
fsize - Maximum file size
memlock - Maximum locked memory address space
nofile - Maximum number of open files
rss - Maximum persistent setting size
stack - Maximum stack size
cpu - Most in minutes CPU Time
noproc - The maximum number of processes
as - Address space limit
maxlogins - The maximum number of logins allowed for this user

ulimit working principle

1,ulimit Is configured in /etc/security/limits.conf in
2,limits.conf yes pam_limits.so Configuration file for , When users use pam Load on module /etc/pam.d Next service

How to make ulimit The settings of are permanently effective

explain
1, Simply set ulimit -c unlimited Only effective for the currently logged in session

Permanent effective method
1, stay /root/.bash_profile Add ulimit -c unlimited
2,source /root/.bash_profile that will do

原网站

版权声明
本文为[qq_ twenty-three million nine hundred and fifty-three thousand ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202200514582494.html