Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-10453

QProcess::waitForFinished ignores timeout on Windows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.0.0
    • 4.7.0, 4.7.4, 4.8.0
    • Core: I/O
    • None
    • Windows Vista 64, tested with MSVC 2008 and MinGW

    Description

      See attached example.

      #include <QtCore/QDebug>
      #include <QtCore/QProcess>
      
      int main(int argc, char *argv[])
      {
          QProcess p;
          p.start("find \"foo\"");
          p.waitForStarted();
          p.write("bar");
          p.closeWriteChannel();
          qDebug() << "waiting...";
          p.waitForFinished(1000); // program stops here, ignoring timeout
          qDebug() << "You won't see this...";
      }
      
      

      "find" is not started because of the incorrect handling of quotation marks. Program continues up to the call to waitForFinished() and stops there. The timeout seems to be ignored.

      Yes, the documentation says that quotation marks must be quoted, but this doesn't change this behavior.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              jbornema Joerg Bornemann
              rlohning Robert Löhning
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes