Qt Creator hangs when deploying to a remote device if that device is rebooted.
-
Hello. I can use Qt Creator to deploy, run and debug programs on a remote Linux device (I usually use some embedded devices with embedded Linux). But if I reboot the device, the next deployment attempt causes Qt Creator to hang: I can only terminate Qt Creator via the task manager. But if I reboot Qt Creator at the same time as the board, the hang does not happen. I tried using different versions of Qt Creator (from 13.0 to 17.0) on different Xubuntu operating systems. I tried use different ssh servers on the boards (openssh and dropbear) - behaviour didn't chadnged.
What could be the reason for this behavior?
-
I tested different versions of my projects. And I realized that this behavior is typical only for Cmake-based projects with subdirectories. This is the minimal project that causes the problem:
├── CMakeLists.txt ├── testapp1 │ ├── CMakeLists.txt │ └── testapp1.c └── testapp2 ├── CMakeLists.txt └── testapp2.c
# ./CMakeLists.txt cmake_minimum_required(VERSION 3.5) project(test) add_subdirectory(testapp1) add_subdirectory(testapp2)
# ./testapp1/CMakeLists.txt cmake_minimum_required(VERSION 3.5) project(testapp1 LANGUAGES C) add_executable(testapp1 testapp1.c) install(TARGETS testapp1 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
// ./testapp1/testapp1.c #include <stdio.h> int main() { printf("Hello World!\n"); return 0; }
# ./testapp2/CMakeLists.txt cmake_minimum_required(VERSION 3.5) project(testapp2 LANGUAGES C) add_executable(testapp2 testapp2.c) install(TARGETS testapp2 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
// ./testapp2/testapp2.c #include <stdio.h> int main() { printf("Hello World!\n"); return 0; }
It is log of Qt Creator's. I made 3 attempt to deploying. I rebooted remote device after second deployment and it boke Qt Creator:
21:11:08.039 qtc.utils.process: Process 0 starting (non blocking): /usr/bin/cmake --build /tmp/testapp/bin --target all install 21:11:08.096 default: SOFT ASSERT [21:11:08.096]: "d->m_stdOut.keepRawData" in ./src/libs/utils/process.cpp:1733 21:11:08.096 default: SOFT ASSERT [21:11:08.096]: "d->m_stdErr.keepRawData" in ./src/libs/utils/process.cpp:1739 21:11:08.096 qtc.utils.process: Process 0 finished: result=0, ex=0, 0 bytes stdout: "", 0 bytes stderr: "", 57 ms elapsed 21:11:08.097 qtc.utils.process: Process 1 starting (non blocking): device://{0b29edf9-a387-4220-8a48-c84fd0a21b5f}/bin/sh -c 'cd /proc; for pid in `ls -d [0123456789]*`; do if [ "`readlink /proc/$pid/exe`" = "/usr/bin/testapp1" ]; then kill -15 -$pid $pid;fi; done; cd /proc; for pid in `ls -d [0123456789]*`; do if [ "`readlink /proc/$pid/exe`" = "/usr/bin/testapp1" ]; then kill -9 -$pid $pid;fi; done' 21:11:08.097 qtc.utils.process: Process 2 starting (non blocking): /usr/bin/ssh -M -N -o ControlPersist=no -o ServerAliveInterval=10 -o PermitLocalCommand=yes -o LocalCommand=echo -o StrictHostKeyChecking=no -o Port=22 -o User=root -o BatchMode=no -o ConnectTimeout=10 -o ControlPath=/tmp/QtCreator-ySuyWK/cs 192.168.1.100 21:11:08.247 qtc.utils.process: Process 3 starting (non blocking): /usr/bin/ssh -q -o StrictHostKeyChecking=no -o Port=22 -o User=root -o BatchMode=no -o ConnectTimeout=10 -o ControlPath=/tmp/QtCreator-ySuyWK/cs 192.168.1.100 'echo __qtc$$__qtc && exec /bin/sh -c '\''cd /proc; for pid in `ls -d [0123456789]*`; do if [ "`readlink /proc/$pid/exe`" = "/usr/bin/testapp1" ]; then kill -15 -$pid $pid;fi; done; cd /proc; for pid in `ls -d [0123456789]*`; do if [ "`readlink /proc/$pid/exe`" = "/usr/bin/testapp1" ]; then kill -9 -$pid $pid;fi; done'\''' 21:11:08.947 qtc.utils.process: Process 3 finished: result=0, ex=0, 0 bytes stdout: "", 0 bytes stderr: "", 700 ms elapsed 21:11:08.947 qtc.utils.process: Process 1 finished: result=0, ex=0, 0 bytes stdout: "", 0 bytes stderr: "", 850 ms elapsed 21:11:08.965 qtc.utils.process: Process 4 starting (non blocking): /usr/bin/ssh -q -o StrictHostKeyChecking=no -o Port=22 -o User=root -o BatchMode=no -o ConnectTimeout=10 192.168.1.100 /bin/sh 21:11:09.284 qtc.utils.process: Process 5 starting (non blocking): rsync -e '/usr/bin/ssh -o StrictHostKeyChecking=no -o Port=22 -o User=root -o BatchMode=no -o ConnectTimeout=10 -o ControlPath=/tmp/QtCreator-ySuyWK/cs' -av /tmp/QtCreator-jQGfKk/staging-18b0b9018464f6fb/usr/bin/testapp2 /tmp/QtCreator-jQGfKk/staging-18b0b9018464f6fb/usr/bin/testapp1 root@192.168.1.100:/usr/bin 21:11:09.366 qtc.utils.process: Process 5 finished: result=0, ex=0, 0 bytes stdout: "", 0 bytes stderr: "", 82 ms elapsed 21:11:23.467 qtc.utils.process: Process 6 starting (non blocking): /usr/bin/cmake --build /tmp/testapp/bin --target all install 21:11:23.523 default: SOFT ASSERT [21:11:23.523]: "d->m_stdOut.keepRawData" in ./src/libs/utils/process.cpp:1733 21:11:23.523 default: SOFT ASSERT [21:11:23.523]: "d->m_stdErr.keepRawData" in ./src/libs/utils/process.cpp:1739 21:11:23.523 qtc.utils.process: Process 6 finished: result=0, ex=0, 0 bytes stdout: "", 0 bytes stderr: "", 56 ms elapsed 21:11:23.524 qtc.utils.process: Process 7 starting (non blocking): device://{0b29edf9-a387-4220-8a48-c84fd0a21b5f}/bin/sh -c 'cd /proc; for pid in `ls -d [0123456789]*`; do if [ "`readlink /proc/$pid/exe`" = "/usr/bin/testapp1" ]; then kill -15 -$pid $pid;fi; done; cd /proc; for pid in `ls -d [0123456789]*`; do if [ "`readlink /proc/$pid/exe`" = "/usr/bin/testapp1" ]; then kill -9 -$pid $pid;fi; done' 21:11:23.524 qtc.utils.process: Process 8 starting (non blocking): /usr/bin/ssh -q -o StrictHostKeyChecking=no -o Port=22 -o User=root -o BatchMode=no -o ConnectTimeout=10 -o ControlPath=/tmp/QtCreator-ySuyWK/cs 192.168.1.100 'echo __qtc$$__qtc && exec /bin/sh -c '\''cd /proc; for pid in `ls -d [0123456789]*`; do if [ "`readlink /proc/$pid/exe`" = "/usr/bin/testapp1" ]; then kill -15 -$pid $pid;fi; done; cd /proc; for pid in `ls -d [0123456789]*`; do if [ "`readlink /proc/$pid/exe`" = "/usr/bin/testapp1" ]; then kill -9 -$pid $pid;fi; done'\''' 21:11:24.249 qtc.utils.process: Process 8 finished: result=0, ex=0, 0 bytes stdout: "", 0 bytes stderr: "", 725 ms elapsed 21:11:24.249 qtc.utils.process: Process 7 finished: result=0, ex=0, 0 bytes stdout: "", 0 bytes stderr: "", 725 ms elapsed 21:11:24.291 qtc.utils.process: Process 9 starting (non blocking): rsync -e '/usr/bin/ssh -o StrictHostKeyChecking=no -o Port=22 -o User=root -o BatchMode=no -o ConnectTimeout=10 -o ControlPath=/tmp/QtCreator-ySuyWK/cs' -av /tmp/QtCreator-jQGfKk/staging-18b0b9018464f6fb/usr/bin/testapp2 /tmp/QtCreator-jQGfKk/staging-18b0b9018464f6fb/usr/bin/testapp1 root@192.168.1.100:/usr/bin 21:11:24.362 qtc.utils.process: Process 9 finished: result=0, ex=0, 0 bytes stdout: "", 0 bytes stderr: "", 71 ms elapsed 21:11:43.677 qtc.utils.process: Process 10 starting (non blocking): /usr/bin/cmake --build /tmp/testapp/bin --target all install 21:11:43.733 default: SOFT ASSERT [21:11:43.733]: "d->m_stdOut.keepRawData" in ./src/libs/utils/process.cpp:1733 21:11:43.733 default: SOFT ASSERT [21:11:43.733]: "d->m_stdErr.keepRawData" in ./src/libs/utils/process.cpp:1739 21:11:43.733 qtc.utils.process: Process 10 finished: result=0, ex=0, 0 bytes stdout: "", 0 bytes stderr: "", 56 ms elapsed 21:11:43.734 qtc.utils.process: Process 11 starting (non blocking): device://{0b29edf9-a387-4220-8a48-c84fd0a21b5f}/bin/sh -c 'cd /proc; for pid in `ls -d [0123456789]*`; do if [ "`readlink /proc/$pid/exe`" = "/usr/bin/testapp1" ]; then kill -15 -$pid $pid;fi; done; cd /proc; for pid in `ls -d [0123456789]*`; do if [ "`readlink /proc/$pid/exe`" = "/usr/bin/testapp1" ]; then kill -9 -$pid $pid;fi; done' 21:11:43.734 qtc.utils.process: Process 12 starting (non blocking): /usr/bin/ssh -q -o StrictHostKeyChecking=no -o Port=22 -o User=root -o BatchMode=no -o ConnectTimeout=10 -o ControlPath=/tmp/QtCreator-ySuyWK/cs 192.168.1.100 'echo __qtc$$__qtc && exec /bin/sh -c '\''cd /proc; for pid in `ls -d [0123456789]*`; do if [ "`readlink /proc/$pid/exe`" = "/usr/bin/testapp1" ]; then kill -15 -$pid $pid;fi; done; cd /proc; for pid in `ls -d [0123456789]*`; do if [ "`readlink /proc/$pid/exe`" = "/usr/bin/testapp1" ]; then kill -9 -$pid $pid;fi; done'\''' 21:11:43.740 qtc.utils.process: Process 2 finished: result=1, ex=255, 0 bytes stdout: "", 123 bytes stderr: "Warning: Permanently added '192.168.1.100' (ED25519) to the list of known hosts.\nclient_loop: send disconnect: Broken pipe\n", 35643 ms elapsed 21:11:43.741 default: SOFT ASSERT [21:11:43.741]: "m_resultData.m_error == QProcess::FailedToStart" in ./src/libs/utils/process.cpp:2066 21:11:43.741 qtc.utils.process: Process 11 finished: result=1, ex=255, 0 bytes stdout: "", 0 bytes stderr: "", 7 ms elapsed 21:11:43.743 qtc.utils.process: Process 4 finished: result=1, ex=255, 0 bytes stdout: "", 0 bytes stderr: "", 34778 ms elapsed 21:11:43.743 qtc.utils.deviceshell: Shell exited with error code: 255 ( "Command «/usr/bin/ssh -q -o StrictHostKeyChecking=no -o Port=22 -o User=root -o BatchMode=no -o ConnectTimeout=10 192.168.1.100 /bin/sh» exited with the code 255." )
As you can see, after I rebooted the device, Qt Creator was unable to make deploy. It seems to be holding some running processes (№2 and №4) in the background, and this causes IDE to hang when the connection to the remote device is lost. It seems as bug :(