Re: WIndows process table and process image.



Thanks Ivan.
In your example, the parent process is holding the handle of the child
process, I can understand
the child process won't go away as long as the parent process is alive.
But what happens after the parent process is also killed?
My understanding is that if a process is terminated, the OS will close all
the handles it opened.

In my application, only the child process is listed in process list without
process image.
All other related(parent) processes are gone.

Thanks,
Chris



"Ivan Brugiolo [MSFT]" <Ivan.Brugiolo@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:OfG$5M1iGHA.4504@xxxxxxxxxxxxxxxxxxxxxxx
As long as there is one active referece to the process object,
then the process will in the process list.
Zombie processes are normally caused by a handle leak on some other
process.

For example this code would cause that

HANDLE hProcess = OpenProcess(PID,...);
TerminateProcess(hProcess,...);

You would need to call CloseHandle(hProcess) to remove
your own reference to the process object.


--
--
This posting is provided "AS IS" with no warranties, and confers no
rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"Chris" <chrisforng@xxxxxxxxxxxxxxxx> wrote in message
news:%232burB1iGHA.3816@xxxxxxxxxxxxxxxxxxxxxxx
Hi,

Please help me understand how Windows process is managed.

My application uses some utility programs such as nslookup and dnscmd.
Fo some cases my application needs to kill those child process by calling
TerminateProcess().

Here is something I cannot understand, after killing a process why the
process is still in process table but its image is gone?

I used Process explorer to check, the process is listed but its image
does not exist.

I tried windbg to connect to the process but windbg told me the process
image is not there.

The process does hold some file handles so its current directory cannot
be removed.

Is there a zambie process in Windows as unix? I cannot find any
documents about Windows Zambie processes.

Thanks,
Chris






.



Relevant Pages

  • Re: A tricky problem about Process.wait and popen
    ... There is a parent process and a fixed number of child processes. ... using IO.popen and then wait for any child process exits. ... it will read correspondant pipe to get result ... puts "Started" ...
    (comp.lang.ruby)
  • Re: DEFUNCT Processes
    ... When a child process dies the parent process gets notified with a signal ... The child process stays as DEFUNCT in the ... handler for SIGCHLD to IGNORE. ...
    (comp.unix.aix)
  • Re: Monitor a child process of a parent process,...
    ... how do i programmatically monitor a child process ... right when the parent process starts the child process. ... I know that i could use some sort of output redirection ...
    (microsoft.public.win32.programmer.kernel)
  • Re: fork and pipe
    ... In summary, the pipe(2) call creates a single, unidirectional pipe, ... The parent process calls pipeto open two fds. ... the parent process calls forkto spawn a child process ... the child process inherits all open fds from the parent process, ...
    (comp.unix.programmer)
  • Re: CGI: Execute a perl script inside another perl script
    ... > and I am using Windows ... this particular behaviour (modifications of the environment of a ... child process will never be back-propped to the parent process) applies to ...
    (comp.lang.perl.misc)