in reply to Determining process cause of death

Signal handlers in perl aren't 100% safe, at least not up until recently. (I think you need a perl in the 5.7.x range for safe signals) Because of that, this'll occasionally die, because perl does things in signal handlers that aren't legal. (No memory allocation allowed, for one)

Replies are listed 'Best First'.
Re: Re: Determining proces
by Marcello (Hermit) on Apr 23, 2002 at 19:20 UTC
    Hi Elian,

    Thank you for your clear answer, is my solution then still the preferred way to clean up zombie processes or is there a better one which does NOT use signals (and therefore my parent process never stops)?

    Regards,
    Marcello
      Try this:
      $SIG{CHLD} = 'IGNORE';
      Depending on your platform that should prevent zombie processes.

      -sam

      It's about the best you can manage. If you don't declare lexicals in the signal handler you may find yourself more (though not completely) stable. Whatever you do, don't use those variables anywhere outside the signal handler!

      If you've got Inline, you could always try writing the signal handler in C, since what you're doing doesn't really require any perl interaction.