[PATCH] Processes that spawn other processes should wait for their children to exit before exiting due to a signal.

Daniel Dunbar daniel at zuster.org
Thu Apr 30 15:17:40 PDT 2015


It doesn't look like ChildPIDs is ever added to?

This implementation can possibly call free() from ChildPIDs->clear(), and
while sys::Wait() looks safe as invoked, I could see how someone might
change it in a way that would cause it to break. It might be safer to call
waitpid() directly, or at least to add a comment to sys::Wait() noting that
it needs to stay signal safe when WaitUntilTerminates == 0 && ErrMsg ==
nullptr.

Also, I think you should take care not to register WaitForChildren()
multiple times.

Probably also good to include a note about why we are waiting for children.

- Daniel


http://reviews.llvm.org/D9420

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list