[PLUG] Bad coding samples/examples

Roderick A. Anderson raanders at cyber-office.net
Mon Feb 6 19:19:17 UTC 2012


I'm looking for some examples of bad coding.  Specifically programs that 
  ignore their children (creating zombie processes) and that do not exit 
cleanly (creating orphans) for init to adopt.

Though that may sound like I know what I'm talking about I don't 
completely.  I was asked during an interview about the kill command 
which led to getting rid of zombie process.  I made a complete fool of 
myself with my answer (who frets about no-human zombies theses days?) so 
went a-lookin' and found the _right_ (more correct?) answer(s).  Now I'd 
like to test them.
    The example code I've found so far has been pretty simplistic -- 
create a bunch of zombie processes then exit cleanly, cleaning up after 
itself.  Plus the program didn't run long enough to even test using 
'kill -s SIGCHLD <ppid>'.
    Finally I'd like it to exit without cleaning up causing the 
zombie(s) to become an orphans.

Not asking much am I?  :-)


TIA,
Rod
-- 



More information about the PLUG mailing list