GNOME Bugzilla – Bug 319861
Subprocesses Zombify on Exit
Last modified: 2005-10-30 17:59:57 UTC
1.) Enable "Desktop Programs" or "Command line programs" 2.) Enter in a command to be executed 3.) Exit out of program that was executed The spawmed program becomes a zombie on the system. The processes don't quit fully until deskbar-applet is exited. This bug is caused by spawn* being used with P_NOWAIT and seems to be unavoidable. I tried executing xterm in the python interpreter and noticed the same thing happened. To cause the zombie process to exit I had to call waitpid as "os.waitpid(pid, os.WNOHANG)". The process then exits fully and returns a tuple with the pid and the exit status. If I knew Python better I'd write the code but I'd hate to ruin such a good project with bad code :p
Created attachment 54066 [details] [review] Patch to fix zombies Here is the patch to fix zombie processes. Basically replaces spawn with gobject.spawn_async. Processes no longer zombie on exit. only thing not changed is beaglelive.py (I'm not sure what 'actions' is and I don't have beagle running/installed.) This is my first time ever submitting a patch... so I'm a bit nervous. Hope it works.
Created attachment 54071 [details] [review] Correct Patch Well. First time I made a big mistake. Fixed now. This is the correct patch :p Good thing I caught that.
Created attachment 54072 [details] [review] This will work... reallyE :( An extra space on one line. I scowered it this time. How embarassing. Third time is the charm, no?
Well the patch seems to work for me atleast Martin :) The only handlers left are the *-live ones right?
Created attachment 54083 [details] [review] New patch fixes google-live.py Only thing left not fixed is beagle-live.py. Not sure how the plugin works entirely.. but basically the first argument just needs to be a list of strings (can't have a string and then a list in a list, for example).
The beagle-live fix is the same, just use "args" as the list to spawn_async, normally the program (named "action") is set in as the first element of the list.
Created attachment 54091 [details] [review] beagle-live.py now fixed also Thanks. Here is the full patch for all the os.spawn* Zombies eradicated just in time for Halloween.
Created attachment 54093 [details] [review] Fixed Didn't need to append action to the args, it was done already. Also forgot to import gobject. I tested this out again and it works fine. As you can tell I'm very new to the patching thing.
In CVS, thanks for the first patch , and welcome on board :)