Consultor Eletrônico



Kbase 11054: What are defunct processes and what causes them ?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/10/1998
What are defunct processes and what causes them ?


A defunct process is one which no longer exists but still
occupies an entry in the system's process table. This occurs
when a process forks a subprocess and the subprocess finishes
doing whatever it does and exits. When it exits, it emits an
exit status which can be collected by its parent process.
In order that the exit status can be kept until the parent
asks for it, it is stored in the process table entry of the subprocess.

So, when the subprocess (also called a child process) has exited,
it is "defunct" until the parent asks the system for the exit status.
Once the parent has done this, the entry is deleted by the system.
Usually, the parent process will retrieve the exit status very soon
after the child exits, so you don't see the defunct processes.

If the parent never asks for the child's exit status, the process
table entry stays there.


So, now when does Progress create subprocesses?

0. When you say "proserve blah", an instance if _mprosrv is created.
It then forks a copy of itself to run in the background, and exits,
leaving the background process there. This background process is
the broker.

1. The broker forks servers to access the database on behalf of remote
clients. The servers are supposed to detach themselves
from their parent to become "detached" or "background" processes
like the broker.

2. When you do a unix escape, a subprocess is created.

3. When you do "input through" or "output through" a subprocess is
created.

Bugs in the code for any of these operations can cause defunct
processes to appear.

Progress Software Technical Support Note # 11054