Core dump and/proc debugging-orisun-blog park core dump and/proc debugging

Source: Internet
Author: User

Core dump and/proc debugging-orisun-blog

Core dump and/proc debugging

Core Dump

Using core dump is post-event debugging (postmortem Debug ).

First, set the core file size to 1024.

Orisun @ zcypc :~ $ Ulimit-C

0

Orisun @ zcypc :~ $ Ulimit-C 1024

Note that this modification is only valid for the current Shell

Root @ zcypc:/home/orisun # echo "/corefile/Core-% E-% P-% t">/proc/sys/kernel/core_pattern

All core files will be stored in/corefile. The file name format is: core-command name-PID-timestamp we write a script to simulate core dump behavior # script that dumps corekill-s sigsrgv $ save as crash. sh # chmod + x crash. sh #. /crash. the shsegmentation fault signal SIGSEGV is caused by a segment error (segmentation fault) caused by memory access out-of-bounds, null pointer, and other errors. You can use GDB [exec file] [core file] to debug core files. /Proc /Proc is a virtual file system that exists only internally. You can obtain system information through/proc, or modify system parameters through it.
CAT/proc/cpuinfo Echo "/corefile/Core-% E-% P-% t">/proc/sys/kernel/core_pattern mentioned in core dump debugging is to modify the/proc file orisun @ zcypc: ~ $ PS aux | grep initroot 1 0.0 0.1 2808 1556? SS/sbin/initorisun 2993 0.0 0.0 3552 pts/0 S + grep init orisun @ zcypc :~ $ Pstreeinit-neural-NetworkManager restart-acpid restart-apturl ── apturl-GTK-neural-gksu ── synaptic-neural-synaptic ── dpkg ── frontend ── FLA + │ ─ ── {synaptic} │ ─ ── {apturl-GTK} ├ ── ATD +─ avahi-daemon ── bonobo-activati ── {bonobo-activat} Then ── chrome-chrome-│ chrome-8 * [{chrome}] │ chrome-27 * [{chrome}] chrome-Example-7 * [chrome-{chrome}] │ ─ ── chrome ── 4 * [{chrome}] Fuser to view a file or directory being accessed) process ID, such as viewing which processes use the dynamic shared library ld-2.11.1.soor Isun @ zcypc :~ $ Fuser-V/lib/ld-2.3.3.soSpecified filename/lib/ld-2.3.3.so does not exist. orisun @ zcypc :~ $ Fuser-V/lib/ld-2.11.1.so user process number permission command/lib/ld-2.11.1.so: orisun 1336 .... M gnome-keyring-D orisun 1354 .... M gnome-session orisun 1392 .... M producer-launch orisun 1393 .... M queue-daemon orisun 1395 .... M fcitx orisun 1397 .... M gconfd-2lsof is opposite to Fuser, it looks at Program Or the files opened by the process. Lsof-C init Trace Tool Backtrace to view stack information Strace is used to track and monitor every system call of a program. LtraceIt is used to track and monitor every C/C ++ library function call of the program. LTT (Linux trace Toolkit) is a kernel patch and a set of related tools used to track various kernel events, such as process creation, suspension and debugging, file read/write, and memory management, data analysis tools are provided to display the analysis results in a graphical manner.

Core Dump

Using core dump is post-event debugging (postmortem Debug ).

First, set the core file size to 1024.

Orisun @ zcypc :~ $ Ulimit-C

0

Orisun @ zcypc :~ $ Ulimit-C 1024

Note that this modification is only valid for the current Shell

Root @ zcypc:/home/orisun # echo "/corefile/Core-% E-% P-% t">/proc/sys/kernel/core_pattern

All core files will be stored in/corefile. The file name format is: core-command name-PID-timestamp we write a script to simulate core dump behavior # script that dumps corekill-s sigsrgv $ save as crash. sh # chmod + x crash. sh #. /crash. the shsegmentation fault signal SIGSEGV is caused by a segment error (segmentation fault) caused by memory access out-of-bounds, null pointer, and other errors. You can use GDB [exec file] [core file] to debug core files. /Proc /Proc is a virtual file system that exists only internally. You can obtain system information through/proc, or modify system parameters through it.
CAT/proc/cpuinfo Echo "/corefile/Core-% E-% P-% t">/proc/sys/kernel/core_pattern mentioned in core dump debugging is to modify the/proc file orisun @ zcypc: ~ $ PS aux | grep initroot 1 0.0 0.1 2808 1556? SS/sbin/initorisun 2993 0.0 0.0 3552 pts/0 S + grep init orisun @ zcypc :~ $ Pstreeinit-neural-NetworkManager restart-acpid restart-apturl ── apturl-GTK-neural-gksu ── synaptic-neural-synaptic ── dpkg ── frontend ── FLA + │ ─ ── {synaptic} │ ─ ── {apturl-GTK} ├ ── ATD +─ avahi-daemon ── bonobo-activati ── {bonobo-activat} Then ── chrome-chrome-│ chrome-8 * [{chrome}] │ chrome-27 * [{chrome}] chrome-Example-7 * [chrome-{chrome}] │ ─ ── chrome ── 4 * [{chrome}] Fuser to view a file or directory being accessed) process ID, such as viewing which processes use the dynamic shared library ld-2.11.1.soor Isun @ zcypc :~ $ Fuser-V/lib/ld-2.3.3.soSpecified filename/lib/ld-2.3.3.so does not exist. orisun @ zcypc :~ $ Fuser-V/lib/ld-2.11.1.so user process number permission command/lib/ld-2.11.1.so: orisun 1336 .... M gnome-keyring-D orisun 1354 .... M gnome-session orisun 1392 .... M producer-launch orisun 1393 .... M queue-daemon orisun 1395 .... M fcitx orisun 1397 .... M gconfd-2lsof is the opposite of Fuser, which shows which files a program or process has opened. Lsof-C init Trace Tool Backtrace to view stack information Strace is used to track and monitor every system call of a program. LtraceIt is used to track and monitor every C/C ++ library function call of the program. LTT (Linux trace Toolkit) is a kernel patch and a set of related tools used to track various kernel events, such as process creation, suspension and debugging, file read/write, and memory management, data analysis tools are provided to display the analysis results in a graphical manner.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.