Help! Zombies


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Help! Zombies
# 8  
Old 10-03-2013
Quote:
Originally Posted by olyanderson
Code:
 ps -ef|grep efu   
root 19693  2564  0 13:56:30 ?         0:00 <defunct>
myusernamehere 19724 12092  0 13:56:39 pts/tk    0:00 grep efu


.... yields my user name... that was not helpful.

I'd like to know how to find and kill this zombie process... if you want a ps -ef just ask. I can't find its parent. It's been on 'top' for a month or so now...
note, i will not post my ps -ef, usernames in prod env. sorry.

suggestions? thanks..
There are two process lines in that response - one is your grep, the other is the zombie process.
This User Gave Thanks to CarloM For This Post:
# 9  
Old 10-03-2013
Quote:
Originally Posted by olyanderson
Code:
 ps -ef|grep efu   
root 19693  2564  0 13:56:30 ?         0:00 <defunct>
myusernamehere 19724 12092  0 13:56:39 pts/tk    0:00 grep efu


.... yields my user name... that was not helpful.

I'd like to know how to find and kill this zombie process... if you want a ps -ef just ask. I can't find its parent. It's been on 'top' for a month or so now...
note, i will not post my ps -ef, usernames in prod env. sorry.

suggestions? thanks..
No. It was very helpful.
It shows that your zombie's PID is 19693. It will remain a zombie until its parent wait()s for it or dies. Its parent's PID is 2564.
Code:
ps -ef|grep [2]564

will show you ps output that contains the description of the parent process, other children of that process, and possibly some other processes that have 2564 somewhere in their ps output. You want the one where 2564 appears in the 2nd column of the output.

Last edited by Don Cragun; 10-03-2013 at 06:11 PM.. Reason: Fix typos
This User Gave Thanks to Don Cragun For This Post:
# 10  
Old 10-03-2013
Quote:
Originally Posted by Don Cragun
No. It was very helpful.
It shows that your zombie's PID is 19693. It will remain a zombie until its parent wait()s for it or dies. Its parent's PID is 2564.
Code:
ps -ef|grep [2]564

will show you ps output that contains the description of the parent process, other children of that process, and possibly some other processes that have 2564 somewhere in their ps output. You want the one where 2564 appears in the 2nd column of the output.
that helps a lot!!! thanks. thats what i was looking for: what to do. 2 steps here. got it. thanks both of you.

oh and i dont think i should kill the parent y/n?
looks important Smilie

Code:
$ ps -ef|grep [2]564
    root  2564     1  0  Sep 15  ?         8:43 /usr/sbin/stm/uut/bin/tools/moni
tor/ia64_corehw
    root 20346  2564  0 14:14:36 ?         0:00 <defunct>

# 11  
Old 10-03-2013
Some searching seems to indicate that it's normal (or at least a known issue which doesn't cause a problem).

Last edited by CarloM; 10-03-2013 at 07:12 PM..
These 2 Users Gave Thanks to CarloM For This Post:
# 12  
Old 10-03-2013
Having a zombie or two lying around isn't a big deal. The only thing that still exists for a zombie is a process table entry (which includes its process ID and its exit status). Its address space has already been returned to the system and is available for use by other processes.

If you have a lot of zombies, your process table could fill up and you would be unable to start other processes.

Last edited by Don Cragun; 10-04-2013 at 12:21 AM.. Reason: fix typo
This User Gave Thanks to Don Cragun For This Post:
# 13  
Old 10-04-2013
still there

Quote:
Originally Posted by Don Cragun
Actually, you can kill zombies; they just won't notice that they've been killed (again).
Code:
kill 0 pid_of_zombie

will complete successfully telling you that the zombie hasn't been reaped yet.
Code:
kill TERM pid_of_zombie

will send a SIGTERM signal to the zombie and will complete successfully (assuming you have permission to send a signal to that process), but the zombie will never notice that the signal was sent nor be able to act upon that signal.
Code:
phantom [/home/petey/TEST-SAVE-2013]
$ ps -ef |grep efu
    root 27333  2564  0 07:40:26 ?         0:00 <defunct>
   petey 27347 12092  0 07:41:23 pts/tk    0:00 grep efu

phantom [/home/petey/TEST-SAVE-2013]
$ sudo kill 27333
Password:
Last successful login:       Thu Oct  3 15:12:59 PDT 2013 phantom
Last authentication failure: Mon Sep 23 16:03:31 PDT 2013 phantom
kill: 27333: no such process

phantom [/home/petey/TEST-SAVE-2013]
$ ps -ef |grep efu
    root 27348  2564  0 07:41:26 ?         0:00 <defunct>
   petey 27352 12092  0 07:41:45 pts/tk    0:00 grep efu

phantom [/home/petey/TEST-SAVE-2013]
$ top -n 1




System: phantom                                       Fri Oct  4 07:41:57 2013
Load averages: 0.07, 0.06, 0.06
375 processes: 334 sleeping, 40 running, 1 zombie
Cpu states:

zombie is still there.. help... i am not allowed to issue kill -9 on this server, i'll get fired. your thoughts?
# 14  
Old 10-04-2013
That is not "the" zombie. Note the pid change.

Why?

zombies arise from really poor programming practices - failing to call wait() on children. kill DOES NOT KILL A ZOMBIE!! Stop trying.
Are we clear on this point?

What you are seeing is:

Code:
1 Process 2564 is the parent.
2 It calls fork()
3 Process xxxx9 is created.
4 It runs.
5 It exits.
6 The OS twiddles its thumbs
7 The OS decides to make a zombies out of xxxx9
8 Meanwhile 2564 is asleep at the switch.
9 Later on, 2564 comes out of a coma calls wait(), when it wants to fork a new child
   xxxx10
10 goto #4 above, continue forever until process 2564 code is fixed.

This is a programming problem. NOT system management. Fix the code behind it.
If your management wants you to get rid of it, get a copy of Stevens & Rago, 'Advanced Programming in the UNIX Environment', look up zombie, show it to the manager. If he can read it, you are good. He will get that it is a programming problem.
These 4 Users Gave Thanks to jim mcnamara For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. Programming

Ways to eliminate Zombies?

what are the precautions to be taken care for avoiding zombie process ? (8 Replies)
Discussion started by: Gopi Krishna P
8 Replies

2. UNIX for Dummies Questions & Answers

Zombies

I had a problem deleting a zombie process. It refused to be killed. I even tried kill -9 process# but it refused. Any other way of killing it? (7 Replies)
Discussion started by: victorn
7 Replies

3. Programming

FreeBSD, fork() and zombies

i'm writing small http proxy server (accept client -> connect to remote proxy server -> recv client's request -> send to remote proxy server -> get responce from remote proxy server -> send answer to client -> close connection to client and to remote proxy server) and having problems with fork().... (2 Replies)
Discussion started by: PsycoMan
2 Replies

4. HP-UX

How can i kill Zombies

Hi All I need help, how can i kill zombies instead of rebooting the system. Regards System: sna Tue Apr 5 17:50:23 2005 Load averages: 0.05, 0.15, 0.22 168 processes: 157 sleeping, 5 running, 6 zombies Cpu states: CPU LOAD USER NICE... (5 Replies)
Discussion started by: cgege
5 Replies

5. UNIX for Dummies Questions & Answers

No zombies!

Is there a command that will automaticaly go through and kill all children when you try to kill the parent process. Thanks, David (3 Replies)
Discussion started by: nucca
3 Replies

6. UNIX for Dummies Questions & Answers

Zombies

Okay, I'm working within ansi C and Sun Solaris 7. I have a problem with zombies. I'm currently using the kill command to return the status of a process. How do I check for Zombie PIDs or the right function to return its PID from within a C program? (1 Reply)
Discussion started by: karpolu
1 Replies
Login or Register to Ask a Question