加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

使用运行进程的共享内存收集核心转储

发布时间:2020-12-16 10:01:43 所属栏目:百科 来源:网络整理
导读:核心转储仅收集进程空间,但不收集为进程间通信创建的共享内存.如何使核心转储也包含运行进程的共享内存? 解决方法 在每个 http://man7.org/linux/man-pages/man5/core.5.html的/ proc / PID / coredump_filter中设置核心文件过滤器: 控制将哪些映射写入核
核心转储仅收集进程空间,但不收集为进程间通信创建的共享内存.如何使核心转储也包含运行进程的共享内存?

解决方法

在每个 http://man7.org/linux/man-pages/man5/core.5.html的/ proc / PID / coredump_filter中设置核心文件过滤器:

控制将哪些映射写入核心转储

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 in the event that a core dump is performed for the
   process with the corresponding process ID.

   The value in the file is a bit mask of memory mapping types (see
   mmap(2)).  If a bit is set in the mask,then memory mappings of the
   corresponding type are dumped; otherwise they are not dumped.  The
   bits in this file have the following meanings:

       bit 0  Dump anonymous private mappings.
       bit 1  Dump anonymous shared mappings.
       bit 2  Dump file-backed private mappings.
       bit 3  Dump file-backed shared mappings.
       bit 4 (since Linux 2.6.24)
              Dump ELF headers.
       bit 5 (since Linux 2.6.28)
              Dump private huge pages.
       bit 6 (since Linux 2.6.28)
              Dump shared huge pages.
       bit 7 (since Linux 4.4)
              Dump private DAX pages.
       bit 8 (since Linux 4.4)
              Dump shared DAX pages.

   By default,the following bits are set: 0,1,4 (if the
   CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS kernel configuration option is
   enabled),and 5.  This default can be modified at boot time using the
   coredump_filter boot option.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读