pstack (gstack) kills process running deleted executable from NFS mount

Solution In Progress - Updated -

Environment

  • pstack-1.2-7.2.2
  • gdb-7.0.1-45.el5
  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 5

Issue

  • GDB attempting to attach to a running process with a deleted executable kills the process

  • A running process is wrongly killed when an executable from an NFS drive is running, the executable is deleted, then pstack is called on the active pid. This does not happen when the executable is on a local ext4 drive.

  • pstack is a symlink to gstack on RHEL5

    • pstack-1.2-7.2.2
    • gdb-7.0.1-45.el5
  • pstack is a symlink to gstack on RHEL6; included in gdb rpm

    • gdb-7.2-75.el6.x86_64
  • The gdb call has issues and claims a program is being debugged already, prompting to kill it (y or n). Somehow the gstack script confirms the prompt.

Resolution

Root Cause

  • GDB no longer kills running processes with deleted executables
  • Prior to this update, GDB attempting to attach to a running process with a deleted executable would accidentally kill the process. This bug has been fixed, and GDB no longer erroneously kills processes with deleted executables.
  • Component
  • gdb

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments