Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. I've got a weird message
Qt 6.11 is out! See what's new in the release blog

I've got a weird message

Scheduled Pinned Locked Moved General and Desktop
10 Posts 3 Posters 5.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • 3 Offline
    3 Offline
    357mag
    wrote on last edited by
    #1

    Sometimes when I run a console program I get this "Cannot obtain a handle to the inferior. The parameter is incorrect".

    Yet my program runs okay. What in the world? Any way to stop that message?

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      please use the search before posting a question...
      Read "this":http://qt-project.org/forums/viewthread/21311 thread.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • 3 Offline
        3 Offline
        357mag
        wrote on last edited by
        #3

        I read that and I used the Search before posting, just so you know. Appears that people are still having the issue.

        1 Reply Last reply
        0
        • raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          maybe you can provide a bit more infos with your question next time so i could have known...
          You also could have told us what you already tried so far ...

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0
          • 3 Offline
            3 Offline
            357mag
            wrote on last edited by
            #5

            Only thing I've tried so far has been to install version 5.1. I still get that message. I don't see an application folder, cuz I was going to try that fellow's suggestion as he talked about in that post.

            1 Reply Last reply
            0
            • C Offline
              C Offline
              ChrisW67
              wrote on last edited by
              #6

              I assume you mean Qt 5.1

              Since you have not told us I am going to assume that you are using a recent Qt Creator on the Windows platform and that the message is displayed in the Application Output pane of Qt Creator when it is run.

              The first part of message comes from Qt Creator, and the second "Parameter is invalid" from Windows. It is in response to this Windows API call:
              @
              // Qt Creator source: src/libs/utils/consoleprocess_win.cpp
              // ConsoleProcess::readStubOutput()

                      d->m_hInferior = OpenProcess(
                              SYNCHRONIZE | PROCESS_QUERY_INFORMATION | PROCESS_TERMINATE,
                              FALSE, d->m_appPid);
                      if (d->m_hInferior == NULL) {
                          emit processError(tr("Cannot obtain a handle to the inferior: %1")
                                            .arg(winErrorMessage(GetLastError())));
                          // Uhm, and now what?
                          continue;
                      }
              

              @

              The first two parameters have little leeway to be incorrect, leaving the third argument: the process id (PID) of the launched program. It strikes me that this will fail if the program, launched by the Qt Creator process stub on your behalf, has already run to completion and terminated. In that case the specified PID will not exist. Does your unspecified "console program" run through quickly to completion?

              It would also fail if the Qt Creator process stub output no PID, or zero, after the "pid " introducer. This would indicate a failing CreateProcessW() call in src/libs/utils/process_stub_win.c of Qt Creator.

              1 Reply Last reply
              0
              • 3 Offline
                3 Offline
                357mag
                wrote on last edited by
                #7

                I build. I run. The program shows the DOS window output. Just like it's supposed to. But there is this warning in red ink in the application output pane.

                1 Reply Last reply
                0
                • C Offline
                  C Offline
                  ChrisW67
                  wrote on last edited by
                  #8

                  Could you answer the question?

                  bq. Does your unspecified “console program” run through quickly to completion?

                  1 Reply Last reply
                  0
                  • 3 Offline
                    3 Offline
                    357mag
                    wrote on last edited by
                    #9

                    Yes. I noticed that I can run a program and the first time everything is fine with no warnings. If I choose to run the program again that message comes up. I've also tried using Qt with VS2012. Same message.

                    1 Reply Last reply
                    0
                    • C Offline
                      C Offline
                      ChrisW67
                      wrote on last edited by
                      #10

                      The message has nothing to do with your choice of Qt version or compiler for your project. The message is originating in Qt Creator when it is asked to run your program (which may have no Qt involvement at all).

                      Creator launches the executable using a stub launcher program that provides Creator with some information about the process launched. This stub returns the process id, and Creator tries to get a handle to that process so it can be notified when it terminates. If it cannot get a handle to the process then you get the warning; this may happen if the process id has already ceased to exist because the program exited quickly. It may be something else, I am just making an intelligent guess. Whether you could avoid this situation I don't know.

                      From what you are saying it runs your program successfully in spite of the warning. Unless you intend to debug the Qt Creator stub and handling code I suggest you simply ignore the warning.

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved