unable to kill -9 for zombie process (4549 Views)
Reply
Regular Advisor
Yarok
Posts: 106
Registered: ‎12-28-2010
Message 1 of 18 (4,549 Views)
Accepted Solution

unable to kill -9 for zombie process

Hello,

I tried to kill a zombie process but it could not stopted (top -> kill -9 PID).

top indicated of 5 zombie and several sleep processes.

The zombie process belong to other user.
I tried to rlogin to this user but it didnt work.

I tried to find an equivalent command pstree (in order to kill the parent) but I count found.

Please advice,

Yaron
Please use plain text.
Trusted Contributor
sangilak
Posts: 86
Registered: ‎12-19-2010
Message 2 of 18 (4,549 Views)

Re: unable to kill -9 for zombie process

[ Edited ]

Hi,


There is a 'pstree' script for HP-UX, see attachment... Hope that will help you!

BTW, there are quite a few threads on ITRC that discuss killing zombie processes, have a look at for example:
http://h30499.www3.hp.com/t5/System-Administration/Zombie-process-utilising-99-of-the-CPU/m-p/472262...

sangilak

Please use plain text.
Regular Advisor
Yarok
Posts: 106
Registered: ‎12-28-2010
Message 3 of 18 (4,549 Views)

Re: unable to kill -9 for zombie process

Thank you,

I red the "Zombie process utilising 99% of the CPU issue".

How can I install the script?

What location?

Can it harm the system?

BR,

Yaron
Please use plain text.
Trusted Contributor
sangilak
Posts: 86
Registered: ‎12-19-2010
Message 4 of 18 (4,549 Views)

Re: unable to kill -9 for zombie process

Hi,


It is just a shell script. So just put it in /tmp (for example), rename it to 'ptree', give it executable permissions and run the script. See a copy/past from the script's code below:

# SYNOPSIS
# ptree [-n] [pid]
# ptree [-n] [pid] [level] [datafile]
#
# DESCRIPTION
# This command will print the process tree for the
# process identified by pid. When called by the user,
# only the first format shown should be used. If the
# process ID (pid) is not passed, process 1 is assumed.
#
# The second format of this command is only used when
# this command calls itself recursively to print the next
# level of the process tree.
#
# -n Do not recurse


I found the script in another thread on ITRC and it looks harmless to me. But just have a look at the code yourself if you have any doubts.


sangilak
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,697
Registered: ‎03-06-2006
Message 5 of 18 (4,549 Views)

Re: unable to kill -9 for zombie process

You can't kill zombies, you can only kill the zombie master.

>in order to kill the parent

You can use "ps -fp PID" to find the zombie master.
Please use plain text.
Regular Advisor
Yarok
Posts: 106
Registered: ‎12-28-2010
Message 6 of 18 (4,549 Views)

Re: unable to kill -9 for zombie process

Hi,

I put is on tmp
change the name for ptree
#chmod 777 ptree
#ptree
ptree: command not found

then I tried to move it to .sh
# mv ptree ptree.sh
#ptree.sh
/sbin/sh: ptree: not found.

What did I miss?
BR,

Yaron
Please use plain text.
Trusted Contributor
sangilak
Posts: 86
Registered: ‎12-19-2010
Message 7 of 18 (4,549 Views)

Re: unable to kill -9 for zombie process

Hi,


Try (depending what the name of the script now is):
# ./ptree
or
# ./ptree.sh

Or just specify the full path:
# /tmp/ptree
or
# /tmp/ptree.sh


sangilak
Please use plain text.
Honored Contributor
Emil Velez
Posts: 1,450
Registered: ‎05-17-2000
Message 8 of 18 (4,549 Views)

Re: unable to kill -9 for zombie process

you cant kill a zombie.. It is already dead.. It is a process table entry that is not being updated. For some reason the parent process has not cleared that entry.

Some kind of bad code.

It is not using 99% of the cpu.. look at your cpu utilization in top.

ONly way to get rid of zombies is to reboot if they do not go away after a few minutes.

Please use plain text.
Trusted Contributor
Tor-Arne Nostdal
Posts: 268
Registered: ‎08-17-1998
Message 9 of 18 (4,549 Views)

Re: unable to kill -9 for zombie process

Ha, ha... that's a good one.
A zombie who uses >90% CPU...
Is it dead or is it dead...

Sleep processes - yes it is normal that some processes have to wait for different events to take place.

rlogin - require specific setup of trust between your users. Normally you can not do rlogin (remote login) to users.
If you ar root user on the same machine you could use the su command to "login" as this user 'su user' or 'su - user' see man su

/Tor-Arne
I'm trying to become President of the state I'm in...
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,697
Registered: ‎03-06-2006
Message 10 of 18 (4,549 Views)

Re: unable to kill -9 for zombie process

>Emil: It is not using 99% of the CPU. look at your CPU utilization in top.

That's the problem, top gets it wrong.

>Only way to get rid of zombies is to reboot

That's not the only way. If you kill the zombie master, they will be reaped.
Please use plain text.
Esteemed Contributor
Ismail Azad
Posts: 487
Registered: ‎11-09-2010
Message 11 of 18 (4,537 Views)

Re: unable to kill -9 for zombie process

Hi,

Every process or service has a "graceful" way of exitting and talking in terms of process, a zombie in any terminology would always mean "dead" but not as harmful as a "ghost" or a "living dead" in the sense that it's just " a memory release" that happened in a weird fashion leaving an entry in the "process table", a table that was rigid on 8.x but is now called as a "process list" as it is no more rigid.

The "graceful reboot", does this in the clean fashion and gets rid of this "defunct" stuff. Or as mentioned kill the master zombie to get rid of the dead.

Regards
Ismail Azad
Read, read and read... Then read again until you read "between the lines".....
Please use plain text.
Regular Advisor
Yarok
Posts: 106
Registered: ‎12-28-2010
Message 12 of 18 (4,537 Views)

Re: unable to kill -9 for zombie process

Well. it seems that I found the reason for the zombie effect.
I reconstructed it and the same senario, including ~100% cpu process occured.

I used a local script that "bring down" the inner software and kills all processes which involved with it.

Then I reconstructed it again, but this time I used the ptree script (for HP UX - shows all process and thier parents). I found the parent zombie process that called then I ps -ef | grep defunct to kill -9 it.
The zombie disappeared but still the cpu process was very busy (~100%).

Shoulnt the zombie killing necessarily low the cpu ?
Any suggestion?
Please use plain text.
Honored Contributor
Patrick Wallek
Posts: 13,711
Registered: ‎06-21-2000
Message 13 of 18 (4,537 Views)

Re: unable to kill -9 for zombie process

>>but still the cpu process was very busy (~100%)

If you invoke 'top' or 'glance' what is the process that is using the most CPU? Is it related to the zombie or is it something completely different.
Please use plain text.
Regular Advisor
Yarok
Posts: 106
Registered: ‎12-28-2010
Message 14 of 18 (4,537 Views)

Re: unable to kill -9 for zombie process

I use the 'top' command and the cpu using process rising up to 100% (and more... how can it be?) as per time factor (minutes).

>Is it related to the zombie or is it something completely different.

I run the top parallel to the problematic process (on other HP machine) and most of time I saw the zombies (they are also rises as a factor of time).
When I bring down the process the cpu usage immediately goes back to its normal level and the zombies disapear, except of 1 the alwas exists (I dont know how or who is its parent).
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,697
Registered: ‎03-06-2006
Message 15 of 18 (4,537 Views)

Re: unable to kill -9 for zombie process

>(and more... how can it be?)

Using threads.

>When I bring down the process the CPU usage immediately goes back to its normal level and the zombies disappear,

Well, you killed the zombie master.

>except of 1 the always exists (I don't know how or who is its parent).

A child of ia64_corehw?
Please use plain text.
Regular Advisor
Yarok
Posts: 106
Registered: ‎12-28-2010
Message 16 of 18 (4,537 Views)

Re: unable to kill -9 for zombie process

Yes, I can see that ia64_corehw is runnig.
what is this process (monitoring the HW)?
Why its child is zombie?

BTW, I noticed that is exists on other HP machine.
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,697
Registered: ‎03-06-2006
Message 17 of 18 (4,537 Views)

Re: unable to kill -9 for zombie process

>I can see that ia64_corehw is running.
>what is this process (monitoring the HW)?

This is a known problem in the diagnostic software, fixed on 11.31.
Please use plain text.
Regular Advisor
Yarok
Posts: 106
Registered: ‎12-28-2010
Message 18 of 18 (4,537 Views)

Re: unable to kill -9 for zombie process

thank you all for the information.
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation