[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 May 14 09:13:08 PDT 2015


================
Comment at: lib/Support/Unix/Program.inc:209
@@ -189,1 +208,3 @@
 
+  if (!ProgramSignalHandlerAdded) {
+    AddSignalHandler(WaitForChildren, nullptr);
----------------
This can race on ProgramSignalHandlerAdded.

================
Comment at: lib/Support/Unix/Program.inc:342
@@ -316,2 +341,3 @@
   PI.Pid = child;
+  ChildPIDs->push_back(PI);
 
----------------
Shouldn't we also make sure to remove (or maybe just clear to 0, to indicate it is gone?) the PID when the child goes away?

================
Comment at: lib/Support/Unix/Program.inc:352
@@ -323,2 +351,3 @@
+// the sigaction man page.
 ProcessInfo sys::Wait(const ProcessInfo &PI, unsigned SecondsToWait,
                       bool WaitUntilTerminates, std::string *ErrMsg) {
----------------
This comment should be adjusted to not this is only necessary when ErrMsg=0, since the code trivially fails the comment if not.

http://reviews.llvm.org/D9420

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






More information about the llvm-commits mailing list