【转】How to obtain a core file without restarting an application?

295 篇文章 0 订阅
117 篇文章 0 订阅

How to obtain a core file without restarting an application?

https://access.redhat.com/solutions/9952

  • Red Hat Enterprise Linux

问题

  • How to obtain a core file without restarting an application?
  • How an application core can be generated when a process is not crashing?
  • How to create an application core when process core size is set to 0?

决议

  • The gcore command can be used to obtain the core file without causing the application to abort using the following procedure:

    • Ensure that the gdb package is installed.
    • Run the application.
    • Execute the gcore command to generate a core file (like core.pid) from the application in the current directory:

      Raw

      $ gcore (pid of the process)
      
  • The core file will be outputted to the present working directory.

  • Note :
    • The gcore command runs gdb and attaches to the process, causing the process to enter T status. However, the process should try to continue to run after gdb finishes collecting a core.
    • One point to remember is that with gcore we can't get a coredump of a kernel process. Because kernel processes are immune to system call tracing, ptrace which the gcore command uses. When we issue a gcore to a pid, we are using PTRACE_ATTACH . When a parent process traces a child process, it uses PTRACE_TRACEME. See the man page of ptrace for more details.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值