|
From: sfeam (E. Merritt) <eam...@gm...> - 2012-01-10 04:56:11
|
On Monday, 09 January 2012, Jérôme Lodewyck wrote: > Le Dimanche 8 Janvier 2012 21:55:35 vous avez écrit : > > I have been running with this one (version 2) under linux. > > It looks pretty good. Over the day or so of testing I've accumulated > > 3 zombie gnuplot_qt processes, however. So there's a termination > > condition that's being missed somewhere. > > I tried very hard to crash it but failed to reproduce your observation. Each > time I get a gnuplot_qt zombie, there is a gnuplot one, and killing the later > kills the former. I wasn't really trying to crash anything. I was just trying to debug other, unrelated, problems. Sometimes the program would crash. Apparently some of those times it would leave behind a zombie. I didn't notice till later, so I can't tell you exactly what I was doing at the time. Nevertheless, I think I can now reproduce it consistently. This is today's CVS with your patch #2 applied. Here is a recipe: $ ./gnuplot # terminal defaults to qt gnuplot> plot x # so far, so good [in another terminal window] $ ps -efT | grep gnuplot # both ./gnuplot and gnuplot_qt visible $ kill -9 <pid of ./gnuplot> $ ps -efT | grep gnuplot # gnuplot_qt is visible, ./gnuplot is gone [close the qt plot window by clicking 'X' in the window title bar] $ ps -efT | grep gnuplot # gnuplot_qt is now a zombie I think the problem is that if the parent process dies hard, either from an unintentional segfault or from receiving a KILL signal, then any atexit() processing that would have sent a signal to the child doesn't happen. I thought at first that maybe this only happened if the child window was closed at the time the parent process was killed, but apparently that doesn't matter. So what I see doesn't seem to match what you see, since you say that if you kill the parent process then the child process dies also. That isn't happening here. > An interesting question would be whether the zombies you > observed are still reachable by starting a new gnuplot and entering > set term qt widget "qtgnuplotXXX" > where XXX is the pid of the zombie gnuplot_qt. Yes, that works. So strictly speaking they are not zombies. But they will sit forever in that state unless you do something clever. cheers, Ethan |