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. Sometimes qprocess does not work (about children?)

Sometimes qprocess does not work (about children?)

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 2 Posters 1.9k Views
  • 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.
  • KonstantinosK Offline
    KonstantinosK Offline
    Konstantinos
    wrote on last edited by
    #1

    QProcess p;
    p.start("one.exe", arguments);
    p.waitForFinished(-1);

    Sometimes this process works (3 children), sometimes does not (2 children). Any help?

    K 1 Reply Last reply
    0
    • KonstantinosK Konstantinos

      QProcess p;
      p.start("one.exe", arguments);
      p.waitForFinished(-1);

      Sometimes this process works (3 children), sometimes does not (2 children). Any help?

      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @Konstantinos
      What do you mean with 3 children?

      You start three applications in a row and the last is not started?

      In that case you may face an endless loop in the last application started. It is not ended or may wait for input from somewhere. With p.waitForFinished(-1) you wait inifinitely until the application you have started finishes.

      Vote the answer(s) that helped you to solve your issue(s)

      KonstantinosK 1 Reply Last reply
      1
      • K koahnig

        @Konstantinos
        What do you mean with 3 children?

        You start three applications in a row and the last is not started?

        In that case you may face an endless loop in the last application started. It is not ended or may wait for input from somewhere. With p.waitForFinished(-1) you wait inifinitely until the application you have started finishes.

        KonstantinosK Offline
        KonstantinosK Offline
        Konstantinos
        wrote on last edited by Konstantinos
        #3

        @koahnig

        Sometimes when I call this process, it works and it has three children, two of type QWindowsPipeReader and one of type QWinEventNotifier:

        alt text

        But some other times, when I call this process, it does not work and it just has two children of type QWindowsPipeReader:

        alt text

        Why may it happen?

        Process finishes (if it starts) after a few seconds. I am tracking it using task manager.

        K 1 Reply Last reply
        0
        • KonstantinosK Konstantinos

          @koahnig

          Sometimes when I call this process, it works and it has three children, two of type QWindowsPipeReader and one of type QWinEventNotifier:

          alt text

          But some other times, when I call this process, it does not work and it just has two children of type QWindowsPipeReader:

          alt text

          Why may it happen?

          Process finishes (if it starts) after a few seconds. I am tracking it using task manager.

          K Offline
          K Offline
          koahnig
          wrote on last edited by
          #4

          @Konstantinos

          One still needs a crystal ball to give you an answer.

          As far as I see your process runs into some kind of exception and dies. You need to monitor the output channels of your process and see if there is some output you can interpret. Check out readAllStandardError and readAllStandardOutput

          Vote the answer(s) that helped you to solve your issue(s)

          KonstantinosK 1 Reply Last reply
          1
          • K koahnig

            @Konstantinos

            One still needs a crystal ball to give you an answer.

            As far as I see your process runs into some kind of exception and dies. You need to monitor the output channels of your process and see if there is some output you can interpret. Check out readAllStandardError and readAllStandardOutput

            KonstantinosK Offline
            KonstantinosK Offline
            Konstantinos
            wrote on last edited by Konstantinos
            #5

            @koahnig

            In both cases(does - does not work), they (both readAllStandardError and readAllStandardOutput) give me nothing. Just a blank - vacuum:""

            To help you a little to help me, the process does not work, when I call another class before calling this process. If I don't call this class, the process works well, but if I call this class, then the problems appear.

            So, the question is, what this class may do, to influence another process in a completely different location?

            K 1 Reply Last reply
            0
            • KonstantinosK Konstantinos

              @koahnig

              In both cases(does - does not work), they (both readAllStandardError and readAllStandardOutput) give me nothing. Just a blank - vacuum:""

              To help you a little to help me, the process does not work, when I call another class before calling this process. If I don't call this class, the process works well, but if I call this class, then the problems appear.

              So, the question is, what this class may do, to influence another process in a completely different location?

              K Offline
              K Offline
              koahnig
              wrote on last edited by
              #6

              @Konstantinos

              No clue what that could be. My crystal ball is broken ;)
              You would be required to ask the oracle of delphi for that one.
              Nobody can give you advice without knowing all the details.

              It could be anything from exhausted memory by this additional to eating away the complete throughput of CPU or comm channels.

              You need to check what you are doing in that class and how it might interfere with your other process you start. Some issues are listed above. There might be dozens of more possible issues.

              Vote the answer(s) that helped you to solve your issue(s)

              1 Reply Last reply
              2
              • KonstantinosK Offline
                KonstantinosK Offline
                Konstantinos
                wrote on last edited by
                #7

                Ok I found the problem.

                As I said this is the process:

                QProcess p;
                p.start("one.exe", arguments);
                p.waitForFinished(-1);

                It looks for one.exe in its default directory, but in the other class, I changed the directory of the app.

                K 1 Reply Last reply
                0
                • KonstantinosK Konstantinos

                  Ok I found the problem.

                  As I said this is the process:

                  QProcess p;
                  p.start("one.exe", arguments);
                  p.waitForFinished(-1);

                  It looks for one.exe in its default directory, but in the other class, I changed the directory of the app.

                  K Offline
                  K Offline
                  koahnig
                  wrote on last edited by
                  #8

                  @Konstantinos

                  Glad you found your problem. Thanks for feedback.

                  Vote the answer(s) that helped you to solve your issue(s)

                  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