Skip to content

Missing zombie at some point #4

Description

@lobeg25

I might have found a bug in a case that is maybe a corner case.

I am investigating a problem in our tests where a unit test launches an arbitrary executable (i used ping.exe, but works with other exe), waits for it to complete and then calls a function that ensures that we are not able to get a handle on this process again (i.e. we ensure there is no zombie, hence the name of the function :) WaitUntilProcessAndItsZombieAreDead). Everything worked fine with that but we changed something in the way we call the unittest and it broke, i.e. a zombie now remains... That's it for context.

So debugging all that, I discovered your tool. Previously I used RAMMap to detect zombies.

Here is the problem I got:
Please note: I have a debugger attached to my unit test executable, in case it changes something.
My code does that:

  • Calls CreateProcess to launch ping,exe
  • Waits for the process to be signaled:
    BOOST_REQUIRE( WaitForSingleObject( pi.hProcess, INFINITE ) == WAIT_OBJECT_0 );
  • Closes the handles on the thread and process:
    BOOST_REQUIRE( CloseHandle( pi.hThread ) != 0 );
    BOOST_REQUIRE( CloseHandle( pi.hProcess ) != 0 );
    After closing the process handle, we do not see ping.exe in the zombie processes in ObjExp.exe, which seems reasonable to me, but RAMMap, after a refresh, still shows the process, as a zombie (0K private memory)...
  • Then we call OpenProcess using the pid of ping.exe and we successfully get a handle on it, which would indicate that the process was still existing somewhere, as a zombie.
  • At this moment, if I refresh ObjExp.exe, the zombie reappears from the... dead? :)

I don't know why, but it seems the process was hiding somewhere ObjExp.exe does not find it. Maybe linked to the debugger? If I get time, I could try it without the debugger if it can help.

I know, maybe what I try to do with WaitUntilProcessAndItsZombieAreDead is not that useful but that's another question ;)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions