Unsolved QProcess doesn´t emit finished() when done
-
@SGaist No even if i wait i have the can0-> waitForFinished(), all the following QProcesses are not returning.
do i have to close something?@ambershark I allready tried but, it stays for the default 30000msecs, but afterwards nothing has been returned.
-
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.
-
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. -
Can you provide a minimal code sample that triggers that ?
-
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. -
Really surprising. If you call any other command, do you have the same problem ?
-
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 .
-
Is it only on your device or can you reproduce that on your desktop machine ?
-
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. -
Since the can bus is a network device, did you try calling
ifconfig up
on another device ? That might help narrow down the problem. -
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. -
@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.
-
signal SIGCHLD, which implies that this signal is being used by QProcess to communicate between parent and child processes.
SIGCHLD
is precisely how theQProcess
knows when the child has exited/terminated, so thatQProcess::finished()
can be emitted.