tkinter hanging

Thomas Wouters thomas at xs4all.nl
Mon Jul 3 03:55:04 EDT 2000


On Sun, 2 Jul 2000 15:25:21 +0100, Robin Becker <robin at jessikat.demon.co.uk>
wrote:
>I'm having problems with zombie processes under win32 with a tkinter
>linked against Tk 8.3. I seem to be exiting the mainloop ok and have
>destroyed all subwindows and then the gui object itself, but
>occasionally I still generate a zombie. I have checked that my after's
>are cancelled and debug prints seem to show me exiting the script.

Does your Tkinter script become a zombie process, or a sub-process ? Zombie
processes are processes that exited normally, but of which the parent hasn't
(yet) read the exit code (with one of the 'wait' family of functions.) If
your process exits without wait()ing on its children, those children will be
inherited by 'init', the first process to start on a UNIX box, which does a
continous wait().

Zombie processes do not really take up much resources, except a slot in the
process table and the int that is needed for the exit code. If you have one
or two lingering around for a couple of minutes, you shouldn't worry.
However, if you see hundreds of them lying around, something might be wrong
;-P Check their parent process (with ps -l) -- if it's '1', something is
wrong with your init. If it's another process, that process needs to be
fixed ;-) You can always 'fix' it by killing it and starting a new one, but
you might not like the side-effects. Adding waitfor() calls at appropriate
places might be a less destructive and more permanent solution ;)

Halloween-ly-y'rs,
	Thomas



More information about the Python-list mailing list