13

I had issued the ps -ef|grep java command and this is one of the entries that I got :

subhrcho   875   803  0 Jan23 pts/5    00:02:27 [java] <defunct>

What is <defunct> implying here ? What state is that process is that process with PID=875 in ?

15

From the ps manpage:

Processes marked <defunct> are dead processes (so-called "zombies") that remain because their parent has not destroyed them properly. These processes will be destroyed by init(8) if the parent process exits.

  • what is the contract between a parent process and child process for destruction of the child process ? I thought it is the duty of the child process to notify the parent that it is being destroyed ? – Geek Jan 24 '13 at 18:02
  • @Geek The kernel destroys the child process and notifies the parent. The child only calls _exit or dies of a signal. When the kernel destroys a process, all that remains is an entry in the process table, which goes away when the parent (or process 1, for orphans) calls wait. – Gilles Jan 24 '13 at 21:44
  • 2
    @Giles What does it mean when the man page says parent has not destroyed properly the child process ? parent did not call wait ? – Geek Jan 25 '13 at 4:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.