Sorry. I didn't look at your example carefully. The method "sage.interfaces.sagespawn.SagePtyProcess.terminate_async" also spawns a zombie process. So the following code spawns zombie processes even if I change the definition of start_cleaner.
s = sage.interfaces.sage0.Sage() s.eval('4') s.quit() Sho Takemori 2016年2月19日金曜日 11時52分04秒 UTC+9 Daniel Lännström: > > I have noticed that when using the sage0 interface zombie processes remain > even after running the sage.interfaces.quit.expect_quitall function. > > Is this a bug? Is there some way to migrate this? > > Here is an example of what I am talking about. Here is the content of the > file zombie_test.sage > > import sage.interfaces.sage0 > import sage.interfaces.quit > > def create_new_instances(): > s = sage.interfaces.sage0.Sage() > s('4') > del s > > print "Create instances" > create_new_instances() > raw_input('continue?') > print "Run expect_quit" > sage.interfaces.quit.expect_quitall(verbose=True) > raw_input('continue?') > > After running the create_new_instances() function the relevant part of the > process tree looks like this. > > | | | `-bash,7619 /usr/lib/sagemath/local/bin/sage-python > zombie_test.sage.py > | | | |-python,7661 > /usr/lib/sagemath/local/bin/sage-cleaner > | | | `-python,7663 zombie_test.sage.py > | | | |-python,7668 > /usr/lib/sagemath/local/bin/sage-ipython > --HistoryManager.hist_file=:memory: ... > | | | `-(python,7669) > > But process 7669 is a zombie! > > PID TTY STAT TIME COMMAND > 7669 pts/6 Z 0:00 [python] <defunct> > > Next running sage.interfaces.quit.expect_quitall outputs > > Exiting Sage with PID 7668 running > /usr/lib/sagemath/local/bin/sage-ipython > --HistoryManager.hist_file=:memory: --colors=NoColor > > Indeed process 7668 has been removed but process 7669 remains and the > process tree looks like this: > > | | | `-bash,7619 /usr/lib/sagemath/local/bin/sage-python > zombie_test.sage.py > | | | |-python,7661 > /usr/lib/sagemath/local/bin/sage-cleaner > | | | `-python,7663 zombie_test.sage.py > | | | |-(python,7668) > | | | |-(python,7669) > | | | `-python,7701 zombie_test.sage.py > > In my work I'm running a long executing program and these zombie processes > are annoying. > > Finally some info about my setup: > Sage Version 6.9, Release Date: 2015-10-10 > Ubuntu MATE 15.10 > Linux kernel 4.2.0-27-generic > > > > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.