Is it possible to get a Linux coredump that only contains callstack, threads, and local variables?

邮差的信 提交于 2019-12-07 01:04:33

You can pipe core dumps to a program, and so write your own filter. Extract from man core

Since kernel 2.6.19, Linux supports an alternate syntax for the /proc/sys/kernel/core_pattern file. If the first character of this file is a pipe symbol (|), then the remainder of the line is interpreted as a program to be executed. Instead of being written to a disk file, the core dump is given as standard input to the program.

You can also control which mappings are written to the core dump, this maybe use to reduce the core dump size.

Since kernel 2.6.23, the Linux-specific /proc/PID/coredump_filter file can be used to control which memory segments are written to the core dump file

Of course, all these depends of kernel version and configuration options.

see the link I've provided for examples or details.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!