歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> 尋找ubuntu下的core dump文件

尋找ubuntu下的core dump文件

日期:2017/3/1 16:04:27   编辑:關於Linux
尋找ubuntu下的core dump文件 1. 打開系統core dump設定 Shell代碼 ulimit -c unlimited ulimit -a 2. 查看core dump生成方式 Java代碼 socol@ubuntu:~$ cat /proc/sys/kernel/core_pattern |/usr/share/apport/apport %p %s %c 3. 運行一個crash程序 C代碼 socol@ubuntu:~/tmp$ cat testcoredump.c #include <stdio.h> int main(int argc, char* argv[]) { char* abc = "abc"; printf("%s\n", abc); char* abd = 0; char coredump = abd[0]; printf("%c\n", coredump); return 0; } 編譯運行: Shell代碼 gcc -g -o testcoredump testcoredump.c ./testcoredump 最後會在當前目錄下得到core文件。
Copyright © Linux教程網 All Rights Reserved