Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. QtonPi
  4. QProcess doesn´t emit finished() when done

QProcess doesn´t emit finished() when done

Scheduled Pinned Locked Moved Unsolved QtonPi
24 Posts 5 Posters 19.3k Views 2 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #13

    Did you check the content of the standard error and standard output of all your QProcess ? There might be a clue there to what is happening.

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    1 Reply Last reply
    0
    • L Offline
      L Offline
      LogiSch17
      wrote on last edited by
      #14

      yes i did. got nothing.
      Currently i removed the ifconfig QProccess from my code and run it as script in init.d before running my programm.
      Now everything works fine.
      Look´s like QProccess has problems with the ifconfig command.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #15

        Can you provide a minimal code sample that triggers that ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • L Offline
          L Offline
          LogiSch17
          wrote on last edited by
          #16

          i got something like

              QStringList arguments;
              arguments << "can0" << "up";
              QProcess::execute("ifconfig",  arguments );
          
          

          but i had it allready with finished() and errorOccured() signals conected to slots -> same result.
          I would say my buildroot generated OS makes the problem.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #17

            Really surprising. If you call any other command, do you have the same problem ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • L Offline
              L Offline
              LogiSch17
              wrote on last edited by
              #18

              No never seen the problem before , and i have a lot of qproccess in my code. From shutdown , reboot, mv , cp to a lot of scripts .

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #19

                Is it only on your device or can you reproduce that on your desktop machine ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  LogiSch17
                  wrote on last edited by
                  #20

                  On my desktop machine it works fine. But i have no CAN device their.
                  So i returns that can0 device not exists and goes on normaly. But the the other proccesses are working afterwards.

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #21

                    Since the can bus is a network device, did you try calling ifconfig up on another device ? That might help narrow down the problem.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • L Offline
                      L Offline
                      LogiSch17
                      wrote on last edited by
                      #22

                      No didn´t tried yet. I have it fixed now by running a startup script . Which does exatly the same.
                      But i will have a look at this problem again when i have some more time. I will let you know if i find out something.

                      1 Reply Last reply
                      0
                      • L LogiSch17

                        i always start my scripts with:

                        process->start("/bin/sh", QStringList << "/path/to/my
                        script.sh");
                        

                        when i try to start ls it does not work either.

                        B Offline
                        B Offline
                        bisou
                        wrote on last edited by
                        #23

                        @LogiSch17 I had a similar problem in that no QProcess::finished() signals were being emitted. The problem was SOLVED by not catching the Unix signal SIGCHLD, which implies that this signal is being used by QProcess to communicate between parent and child processes. Maybe this was your problem too.

                        JonBJ 1 Reply Last reply
                        0
                        • B bisou

                          @LogiSch17 I had a similar problem in that no QProcess::finished() signals were being emitted. The problem was SOLVED by not catching the Unix signal SIGCHLD, which implies that this signal is being used by QProcess to communicate between parent and child processes. Maybe this was your problem too.

                          JonBJ Offline
                          JonBJ Offline
                          JonB
                          wrote on last edited by
                          #24

                          @bisou

                          signal SIGCHLD, which implies that this signal is being used by QProcess to communicate between parent and child processes.

                          SIGCHLD is precisely how the QProcess knows when the child has exited/terminated, so that QProcess::finished() can be emitted.

                          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