Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-13042

Cannot obtain a handle to the inferior: The parameter is incorrect.

    XMLWordPrintable

Details

    • eba6912e17320cfb8e9b2f963932ad8d968191b3

    Description

      When running C or C++ console application on Windows error occurs: "Cannot obtain a handle to the inferior: The parameter is incorrect".

      Problem seems to occur because user application may finish execution before ConsoleProcess::readStubOutput() function is able to process information (PID and thread id) provided via pipe by qtcreator_process_stub.exe and call OpenProcess() on time. Thus OpenProcess() is being called on non-existing process with closed handle, which leads to error.

      I was not able to dig into code enough, but I think qtcreator_process_stub.exe should wait for ConsoleProcess and keep handles open (do not call CloseHandle(pi.hProcess) and CloseHandle(pi.hThread) until it is signaled by ConsoleProcess.

      Attachments

        For Gerrit Dashboard: QTCREATORBUG-13042
        # Subject Branch Project Status CR V

        Activity

          People

            qdoc Michal Policht
            qdoc Michal Policht
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes