]> scripts.mit.edu Git - wizard.git/blobdiff - wizard/shell.py
Fix kernel buffer overflow by avoiding passing --debug to subprocesses.
[wizard.git] / wizard / shell.py
index b8d4bd1e6dcfa8cda550c192b63a74a3146a435c..2197cdecc3cf219beebe5d5afe10744917682869 100644 (file)
@@ -121,13 +121,16 @@ class Shell(object):
             stderr=kwargs["stderr"]
         # XXX: There is a possible problem here where we can fill up
         # the kernel buffer if we have 64KB of data.  This shouldn't
-        # be a problem, and the fix for such case would be to write to
+        # normally be a problem, and the fix for such case would be to write to
         # temporary files instead of a pipe.
+        #
+        # However, it *is* a problem when you do something silly, like
+        # pass --debug to mass-upgrade.
+        #
         # Another possible way of fixing this is converting from a
         # waitpid() pump to a select() pump, creating a pipe to
-        # ourself, and then setting up a
-        # SIGCHILD handler to write a single byte to the pipe to get
-        # us out of select() when a subprocess exits.
+        # ourself, and then setting up a SIGCHILD handler to write a single
+        # byte to the pipe to get us out of select() when a subprocess exits.
         proc = subprocess.Popen(args, stdout=stdout, stderr=stderr, stdin=stdin, cwd=self.cwd, )
         if self._async(proc, args, **kwargs):
             return proc