Important Bug

Important Bug

Discuss everything related to running Spring on your chosen distribution of Linux.

Moderator: Moderators

Post Reply
hollowsoul
Posts: 665
Joined: 06 Jun 2006, 19:49

Important Bug

Post by hollowsoul »

Damnit anyone know why spring goes as a zombie procress ???

Anyone care to find out why & fix it plz asap

Need it sorted so UnityLobby can tell when user has left the online / offline battle they were in
own3d
Posts: 129
Joined: 25 Aug 2006, 16:31

Post by own3d »

**EDIT **

It has to do with the way you exit the program see here:
http://216.239.59.104/search?q=cache:zp ... =firefox-a
and here is quite handy - telling you how to avoid making them

http://216.239.59.104/search?q=cache:be ... =firefox-a

3. On a Unix system, a Process that has called exit(3), but whose parent process has not yet called the wait() function to be notified of its termination.

Note that although zombie processes will show up in ps(1) and top(1), the only resource they use is an entry in the process table; they cannot be allocated memory or CPU time.

The only way to get rid of a zombie process is to either kill the parent process, or convince it to call wait().

Pressing the i key in top will tell it not to display idle and zombie processes.

Want to know more? Have a look at ZombieProcess or the manpages for ps(1), top(1) and wait(2).


In unix-like operating systems, ALL processes (apart from the first one) are created by other processes. To create a new process, a current process does a fork(2) system call. The kernel then creates the internal structures needed in the process table. Often, the parent process does a wait4(2) system call, which means it waits for the child process to finish. This means you can get a little info about the process after it finished, like cpu time, etc.

If you don't care when the process finishes, you have to explicitly say so, otherwise the kernel will keep the info in the process table expecting your process to eventually call wait4(2) or a similar function. A process that has finished (and so is using no memory) but has not yet been "reaped" is called a Zombie, and the kernel is keeping its process table entry alive.

Two ways to avoid creating Zombies (other than calling one of the wait() functions) include:

1. handling the SIGCHLD signal (see that page for example code)
2. fork(2) and then get the child to fork(2) again and then exit immediately, so that you've created a grandchild rather than a child.

Zombie processes will show 'Z' in the STAT column of ps -aux
This page also has some useful info
http://wlug.org.nz/SIGCHLD
hollowsoul
Posts: 665
Joined: 06 Jun 2006, 19:49

Post by hollowsoul »

Got it in the end
False Alarm

Needed 1 line of code

Code: Select all

os.waitpid(self.pid, os.WNOHANG)
To handle getting rid of that zombie process
Post Reply

Return to “Linux”