zombie process can't be killed

前端 未结 6 790
北海茫月
北海茫月 2021-01-02 08:41

Is there a way to kill a zombie process? I\'ve tried calling exit to kill the process and even sending SIGINT signal to the process, but it seems t

6条回答
  •  抹茶落季
    2021-01-02 09:38

    A zombie process is a process id (and associated termination status and resource usage information) that has not yet been waited for by its parent process. The only ways to eliminate it are to get its parent to wait for it (sometimes this can be achieved by sending SIGCHLD to the parent manually if the parent was just buggy and had a race condition where it missed the chance to wait) but usually you're out of luck unless you forcibly terminate the parent.

    Edit: Another way, if you're desperate and don't want to kill the parent, is to attach to the parent with gdb and forcibly call waitpid on the zombie child.

提交回复
热议问题