Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Killing a zombie process?



On Thu, 1 Oct 2015, Robert Elz wrote:

   Date:        Wed, 30 Sep 2015 18:03:03 +0700
   From:        Robert Elz <kre%munnari.OZ.AU@localhost>
   Message-ID:  <16072.1443610983%andromeda.noi.kre.to@localhost>

 | I think I'd start with the proc structure of the zombie itself,

Even before that, you might want to check whether the process truly is
a zombie, or just dead - ps prints both as 'Z' - modifying (temporarily)
ps to show dead processes differently (maybe just z instead of Z) might
reveal that the zombie in question hasn't actually putrified yet, and is
just a corpse.

Interesting idea. I'm applying the following patch to ps/print.c so it will print a ZZ state for LSDEAD (vs only one Z for LSZOMB)

Index: print.c
===================================================================
RCS file: /cvsroot/src/bin/ps/print.c,v
retrieving revision 1.123
diff -u -p -r1.123 print.c
--- print.c     15 Nov 2014 01:58:34 -0000      1.123
+++ print.c     30 Sep 2015 22:44:08 -0000
@@ -513,6 +513,9 @@ state(void *arg, VARENT *ve, enum mode m
                *cp = 'O';
                break;

+       case LSDEAD:
+               *cp++ = 'Z';
+               /* FALLTHRU */
        case LSZOMB:
                *cp = 'Z';
                is_zombie = 1;



Dead state isn't supposed to persist for long (processes should rot quickly)
but while in that state, the process is not yet ready for reaping.

Of course, even if this is what is happening, the question of what it is
waiting for still remains.   Or maybe the processes are just waiting for
Oct 31 ?

:)



+------------------+--------------------------+-------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com    |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org  |
+------------------+--------------------------+-------------------------+


Home | Main Index | Thread Index | Old Index