Zombie process using CPU

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Zombie process using CPU

John Tapsell-3
Hi,

  After a program (vuze) crashed I ended up in the situation of having
a process, java, using 100% CPU of a core while also being a zombie.

  Looking in /proc/<pid>/task  I saw two pids - the main task and a
subtask.  The main task (cat /proc/<pid>/task/<pid>/status ) was
indeed a zombie, but the subtask was still running and using CPU.

  I could not find any way to kill this process. kill -9  on the <pid>
 and on the pid on the subtask did nothing.  In the end I had to
reboot.

  is this situation supposed to be possible?  How do I kill a subtask?

John

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: Zombie process using CPU

Ike Panhc
Hi,

IIRC zombie process is waiting for his parent process to end him.

If I see an zombie process, I will use "pstree" to find his parent
process and see what I can do. Maybe kill the parent process.

Hope its helpful.

John Tapsell wrote:

> Hi,
>
>   After a program (vuze) crashed I ended up in the situation of having
> a process, java, using 100% CPU of a core while also being a zombie.
>
>   Looking in /proc/<pid>/task  I saw two pids - the main task and a
> subtask.  The main task (cat /proc/<pid>/task/<pid>/status ) was
> indeed a zombie, but the subtask was still running and using CPU.
>
>   I could not find any way to kill this process. kill -9  on the <pid>
>  and on the pid on the subtask did nothing.  In the end I had to
> reboot.
>
>   is this situation supposed to be possible?  How do I kill a subtask?
>
> John
>


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: Zombie process using CPU

John Tapsell-3
On 20 April 2010 14:27, Ike Panhc <[hidden email]> wrote:
> Hi,
>
> IIRC zombie process is waiting for his parent process to end him.
>
> If I see an zombie process, I will use "pstree" to find his parent
> process and see what I can do. Maybe kill the parent process.

Ah I forgot to mention - I did indeed kill its parent and it became
re-parented to init.
So we had a zombie process whose parent is init.

John

> Hope its helpful.
>
> John Tapsell wrote:
>> Hi,
>>
>>   After a program (vuze) crashed I ended up in the situation of having
>> a process, java, using 100% CPU of a core while also being a zombie.
>>
>>   Looking in /proc/<pid>/task  I saw two pids - the main task and a
>> subtask.  The main task (cat /proc/<pid>/task/<pid>/status ) was
>> indeed a zombie, but the subtask was still running and using CPU.
>>
>>   I could not find any way to kill this process. kill -9  on the <pid>
>>  and on the pid on the subtask did nothing.  In the end I had to
>> reboot.
>>
>>   is this situation supposed to be possible?  How do I kill a subtask?
>>
>> John
>>
>
>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: Zombie process using CPU

Ike Panhc
Hi,

Sounds like kill its parent is a bad idea. I remember I have made
some of the zombie process before, but not anymore after I force the
parent to ignore SIGCHLD before fork.

I believe it can be fixed by modifying something in the application
not in the kernel.

John Tapsell wrote:

> On 20 April 2010 14:27, Ike Panhc <[hidden email]> wrote:
>> Hi,
>>
>> IIRC zombie process is waiting for his parent process to end him.
>>
>> If I see an zombie process, I will use "pstree" to find his parent
>> process and see what I can do. Maybe kill the parent process.
>
> Ah I forgot to mention - I did indeed kill its parent and it became
> re-parented to init.
> So we had a zombie process whose parent is init.
>
> John
>
>> Hope its helpful.
>>
>> John Tapsell wrote:
>>> Hi,
>>>
>>>   After a program (vuze) crashed I ended up in the situation of having
>>> a process, java, using 100% CPU of a core while also being a zombie.
>>>
>>>   Looking in /proc/<pid>/task  I saw two pids - the main task and a
>>> subtask.  The main task (cat /proc/<pid>/task/<pid>/status ) was
>>> indeed a zombie, but the subtask was still running and using CPU.
>>>
>>>   I could not find any way to kill this process. kill -9  on the <pid>
>>>  and on the pid on the subtask did nothing.  In the end I had to
>>> reboot.
>>>
>>>   is this situation supposed to be possible?  How do I kill a subtask?
>>>
>>> John
>>>
>>
>


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: Zombie process using CPU

Andy Whitcroft-3
In reply to this post by John Tapsell-3
On Tue, Apr 20, 2010 at 01:45:27PM +0900, John Tapsell wrote:

> Hi,
>
>   After a program (vuze) crashed I ended up in the situation of having
> a process, java, using 100% CPU of a core while also being a zombie.
>
>   Looking in /proc/<pid>/task  I saw two pids - the main task and a
> subtask.  The main task (cat /proc/<pid>/task/<pid>/status ) was
> indeed a zombie, but the subtask was still running and using CPU.
>
>   I could not find any way to kill this process. kill -9  on the <pid>
>  and on the pid on the subtask did nothing.  In the end I had to
> reboot.
>
>   is this situation supposed to be possible?  How do I kill a subtask?

A zombie should indeed be nothing more than a shell.  I am not sure
there is even anything to run once a process hits Z state.  It is more
likely that the accounting is wrong than it was actually consuming the
CPU claimed.  Cirtainly it is not something I have experienced here.

-apw

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: Zombie process using CPU

John Tapsell-3
On 20 April 2010 18:47, Andy Whitcroft <[hidden email]> wrote:

> On Tue, Apr 20, 2010 at 01:45:27PM +0900, John Tapsell wrote:
>> Hi,
>>
>>   After a program (vuze) crashed I ended up in the situation of having
>> a process, java, using 100% CPU of a core while also being a zombie.
>>
>>   Looking in /proc/<pid>/task  I saw two pids - the main task and a
>> subtask.  The main task (cat /proc/<pid>/task/<pid>/status ) was
>> indeed a zombie, but the subtask was still running and using CPU.
>>
>>   I could not find any way to kill this process. kill -9  on the <pid>
>>  and on the pid on the subtask did nothing.  In the end I had to
>> reboot.
>>
>>   is this situation supposed to be possible?  How do I kill a subtask?
>
> A zombie should indeed be nothing more than a shell.  I am not sure
> there is even anything to run once a process hits Z state.  It is more
> likely that the accounting is wrong than it was actually consuming the
> CPU claimed.  Cirtainly it is not something I have experienced here.

The problem is that its _subtask_ is running and using CPU.

Specifically:

$ cat /proc/5728/status  | grep State
State:  Z (zombie)

$ ls /proc/5728/task/
5728  5810

$ kill -9 5810
$ cat /proc/5728/task/5810/status | grep State
State:  R (running)

So this process '5810' is running despite the kill -9.

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: Zombie process using CPU

Andy Whitcroft-3
On Tue, Apr 20, 2010 at 07:06:28PM +0900, John Tapsell wrote:

> On 20 April 2010 18:47, Andy Whitcroft <[hidden email]> wrote:
> > On Tue, Apr 20, 2010 at 01:45:27PM +0900, John Tapsell wrote:
> >> Hi,
> >>
> >>   After a program (vuze) crashed I ended up in the situation of having
> >> a process, java, using 100% CPU of a core while also being a zombie.
> >>
> >>   Looking in /proc/<pid>/task  I saw two pids - the main task and a
> >> subtask.  The main task (cat /proc/<pid>/task/<pid>/status ) was
> >> indeed a zombie, but the subtask was still running and using CPU.
> >>
> >>   I could not find any way to kill this process. kill -9  on the <pid>
> >>  and on the pid on the subtask did nothing.  In the end I had to
> >> reboot.
> >>
> >>   is this situation supposed to be possible?  How do I kill a subtask?
> >
> > A zombie should indeed be nothing more than a shell.  I am not sure
> > there is even anything to run once a process hits Z state.  It is more
> > likely that the accounting is wrong than it was actually consuming the
> > CPU claimed.  Cirtainly it is not something I have experienced here.
>
> The problem is that its _subtask_ is running and using CPU.
>
> Specifically:
>
> $ cat /proc/5728/status  | grep State
> State:  Z (zombie)
>
> $ ls /proc/5728/task/
> 5728  5810
>
> $ kill -9 5810
> $ cat /proc/5728/task/5810/status | grep State
> State:  R (running)
>
> So this process '5810' is running despite the kill -9.

That looks stuck.  If its system time I'd guess a kernel bug.  From IRC
I see this is actually a 2.6.33 mainline kernel, so I'd be interested to
know if you can reproduce this on our release kernels.

To see what its doing, you will likely have to try either stracing it or
use the running process stack dump option off the sysrq menu.

-apw

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: Zombie process using CPU

Scott James Remnant-2
In reply to this post by John Tapsell-3
On Tue, 2010-04-20 at 19:06 +0900, John Tapsell wrote:

> The problem is that its _subtask_ is running and using CPU.
>
Unless I'm going mad, I'm pretty sure that a process can't be both dead
and have threads.

So something pretty screwy has gone on here.

Scott
--
Scott James Remnant
[hidden email]

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (205 bytes) Download Attachment