From: Anders J. <aj...@ry...> - 2008-08-31 13:41:49
|
Hi, I'm not exactly sure where the bug is here. I'm running nepomuk in the latest KDE svn (4.1.63, I believe), and it uses strigi. However, it leaves behind it a ton of zombie pdftotext processes, and the only thing I can find that executes pdftotext is strigi (in streams/processinputstream.cpp) In there, it forks off and executes pdftotext, but the parent then just exits, it never does a waitpid() on the child. Shouldn't it? It seems to me that it's good practice for a process to always clean up after itself, and not assume that any parent processes will do it after it exits. Something like this, perhaps: --- processinputstream.cpp.orig 2008-08-31 15:38:57.000000000 +0200 +++ processinputstream.cpp 2008-08-31 15:41:06.000000000 +0200 @@ -149,6 +149,7 @@ ProcessInputStream::runCmdWithInput() { int pin[2]; int pout[2]; + int status; pipe(pin); pipe(pout); @@ -179,4 +180,5 @@ close(pout[1]); fdout = pout[0]; fdin = pin[1]; + waitpid(pid, &status, WEXITED); } Thanks Anders |