Qt Creator 8.0.2 crashes when I press the "Stop" button to stop an embedded Linux application
-
Hello,
I'm a newby in Qt6 and Qml. I have created a Hello World application for Linux-Desktop (Ubuntu) and for embedded Linux. When I run my application on the target device and press the "Stop" (red) button above the integrated terminal inside Qt Creator then the Qt Creator 8.0.2 crashes and the application is still running on the target device:source /opt/b2qt/3.3.4/environment-setup-aarch64-poky-linux ${HOME}/Qt/Tools/QtCreator/bin/qtcreator SOFT ASSERT: "current->id() != tc->id()" in file /home/qt/work/build/qt-creator/src/plugins/projectexplorer/toolchainmanager.cpp, line 226 SOFT ASSERT: "current->id() != tc->id()" in file /home/qt/work/build/qt-creator/src/plugins/projectexplorer/toolchainmanager.cpp, line 226 qtc.utils.deviceshell: Failed installing device shell script Speicherzugriffsfehler (Speicherabzug geschrieben)When I use the Qt Creator 7.0.0, the stop button works without crash and the application on the target is stopping:

I have Ubuntu 20.04.5 LTS.
Why this crash happens with Qt Creator 8.0.2?
-
Hello,
I'm a newby in Qt6 and Qml. I have created a Hello World application for Linux-Desktop (Ubuntu) and for embedded Linux. When I run my application on the target device and press the "Stop" (red) button above the integrated terminal inside Qt Creator then the Qt Creator 8.0.2 crashes and the application is still running on the target device:source /opt/b2qt/3.3.4/environment-setup-aarch64-poky-linux ${HOME}/Qt/Tools/QtCreator/bin/qtcreator SOFT ASSERT: "current->id() != tc->id()" in file /home/qt/work/build/qt-creator/src/plugins/projectexplorer/toolchainmanager.cpp, line 226 SOFT ASSERT: "current->id() != tc->id()" in file /home/qt/work/build/qt-creator/src/plugins/projectexplorer/toolchainmanager.cpp, line 226 qtc.utils.deviceshell: Failed installing device shell script Speicherzugriffsfehler (Speicherabzug geschrieben)When I use the Qt Creator 7.0.0, the stop button works without crash and the application on the target is stopping:

I have Ubuntu 20.04.5 LTS.
Why this crash happens with Qt Creator 8.0.2?
@KerstinJ said in Qt Creator 8.0.2 crashes when I press the "Stop" button to stop an embedded Linux application:
the application on the target is stopping
It is actually crashing according to your screenshot.
Are you running your app through debugger? -
@KerstinJ said in Qt Creator 8.0.2 crashes when I press the "Stop" button to stop an embedded Linux application:
the application on the target is stopping
It is actually crashing according to your screenshot.
Are you running your app through debugger? -
@jsulm
No, the screenshot is from the Qt Creator 7.0.0. This version works without crashing.No, I pressed the "Run" button (Crtl+R).
@KerstinJ said in Qt Creator 8.0.2 crashes when I press the "Stop" button to stop an embedded Linux application:
No, the screenshot is from the Qt Creator 7.0.0. This version works without crashing.
I mean your application is crashing.
Try to start your app with debugger in QtCreator 8
-
My application is not crashing.
The Qt Creator 8 is crashing when I stop my application with the red button in the 'Application Output' terminal and also with the menu "Debug -> Stop Debugger" in debugging mode.
I start the Creator from the command line and after crashing these 2 messages are shown:qtc.utils.deviceshell: Failed installing device shell script Speicherzugriffsfehler (Speicherabzug geschrieben)As my application runs, it shows these messages in a loop

What do these messages mean? -
Same problem here.
Backtrace in gdb:
qtc.utils.deviceshell: Failed installing device shell script
Thread 43 "QThread" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff517fa640 (LWP 341392)]
0x00007ffff7daf550 in Utils::QtcProcess::commandLine() const () from /home/prus/Qt/Tools/QtCreator/bin/../lib/qtcreator/libUtils.so.8
(gdb) bt
#0 0x00007ffff7daf550 in Utils::QtcProcess::commandLine() const () from /home/prus/Qt/Tools/QtCreator/bin/../lib/qtcreator/libUtils.so.8
#1 0x00007ffff7ca1f59 in Utils::DeviceShell::start() () from /home/prus/Qt/Tools/QtCreator/bin/../lib/qtcreator/libUtils.so.8
#2 0x00007fff77e1c931 in ?? () from /home/prus/Qt/Tools/QtCreator/lib/qtcreator/plugins/libRemoteLinux.so
#3 0x00007fff77e12744 in ?? () from /home/prus/Qt/Tools/QtCreator/lib/qtcreator/plugins/libRemoteLinux.so
#4 0x00007ffff62fc78c in QObject::event(QEvent*) () from /home/prus/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt6Core.so.6
#5 0x00007ffff753e4d2 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /home/prus/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt6Widgets.so.6
#6 0x00007ffff62ac1ea in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /home/prus/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt6Core.so.6
#7 0x00007ffff62af114 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /home/prus/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt6Core.so.6
#8 0x00007ffff6551ba3 in ?? () from /home/prus/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt6Core.so.6
#9 0x00007ffff2fdbd1b in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007ffff30306f8 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#11 0x00007ffff2fd93c3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#12 0x00007ffff655152a in QEventDispatcherGlib::processEvents(QFlagsQEventLoop::ProcessEventsFlag) () from /home/prus/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt6Core.so.6
#13 0x00007ffff62b849b in QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) () from /home/prus/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt6Core.so.6
#14 0x00007ffff63c1162 in QThread::exec() () from /home/prus/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt6Core.so.6
#15 0x00007ffff643baaf in ?? () from /home/prus/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt6Core.so.6
#16 0x00007ffff5caeb43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#17 0x00007ffff5d40a00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
(gdb) threads
Undefined command: "threads". Try "help".
(gdb) thread
[Current thread is 43 (Thread 0x7fff517fa640 (LWP 341392))]QtCreator Version:
Qt Creator 8.0.2
Based on Qt 6.3.2 (GCC 10.3.1 20210422 (Red Hat 10.3.1-1), x86_64)Erstellt am Oct 19 2022 12:45:31
Revision 2d5512f2c4
-
I installed QtCreator debugging symbols. Now there is a better backtrace.
qtc.utils.deviceshell: Failed installing device shell script
Thread 43 "QThread" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff2b7fe640 (LWP 343839)]
Utils::QtcProcess::commandLine (this=0x0) at /home/qt/work/build/qt-creator/src/libs/utils/qtcprocess.cpp:1131
1131 /home/qt/work/build/qt-creator/src/libs/utils/qtcprocess.cpp: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0 Utils::QtcProcess::commandLine (this=0x0) at /home/qt/work/build/qt-creator/src/libs/utils/qtcprocess.cpp:1131
#1 0x00007ffff7ca1f59 in Utils::DeviceShell::start (this=0x258b210) at /opt/rh/gcc-toolset-10/root/usr/include/c++/10/bits/unique_ptr.h:173
#2 0x00007fff8c620931 in RemoteLinux::ShellThreadHandler::start (this=0x258b150, parameters=...) at /opt/rh/gcc-toolset-10/root/usr/include/c++/10/bits/unique_ptr.h:173
#3 0x00007fff8c616744 in operator() (_closure=0x3327e20) at /home/qt/work/build/qt-creator/src/plugins/remotelinux/linuxdevice.cpp:1099
#4 QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, bool, RemoteLinux::LinuxDevicePrivate::setupShell()::<lambda()> >::call (arg=0x7fffffffb668, f=...)
at /home/qt/work/build/qt_install_dir/include/QtCore/qobjectdefs_impl.h:163
#5 QtPrivate::Functor<RemoteLinux::LinuxDevicePrivate::setupShell()::<lambda()>, 0>::call<QtPrivate::List<>, bool> (arg=0x7fffffffb668, f=...)
at /home/qt/work/build/qt_install_dir/include/QtCore/qobjectdefs_impl.h:277
#6 QtPrivate::QFunctorSlotObject<RemoteLinux::LinuxDevicePrivate::setupShell()::<lambda()>, 0, QtPrivate::List<>, bool>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this=0x3327e10, r=<optimized out>, a=0x7fffffffb668, ret=<optimized out>)
at /home/qt/work/build/qt_install_dir/include/QtCore/qobjectdefs_impl.h:444
#7 0x00007ffff62fc78c in QObject::event(QEvent*) () from /home/prus/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt6Core.so.6
#8 0x00007ffff753e4d2 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /home/prus/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt6Widgets.so.6
#9 0x00007ffff62ac1ea in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /home/prus/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt6Core.so.6
#10 0x00007ffff62af114 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /home/prus/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt6Core.so.6
#11 0x00007ffff6551ba3 in ?? () from /home/prus/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt6Core.so.6
#12 0x00007ffff2fdbd1b in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#13 0x00007ffff30306f8 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#14 0x00007ffff2fd93c3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#15 0x00007ffff655152a in QEventDispatcherGlib::processEvents(QFlagsQEventLoop::ProcessEventsFlag) () from /home/prus/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt6Core.so.6
#16 0x00007ffff62b849b in QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) () from /home/prus/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt6Core.so.6
#17 0x00007ffff63c1162 in QThread::exec() () from /home/prus/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt6Core.so.6
#18 0x00007ffff643baaf in ?? () from /home/prus/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt6Core.so.6
#19 0x00007ffff5caeb43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#20 0x00007ffff5d40a00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
(gdb) thread
[Current thread is 43 (Thread 0x7fff2b7fe640 (LWP 343839))] -
This crash looks similar to the bug report QTCREATORBUG-27916 Cannot stop running application.
Does the solution presented there fix the issue here?Never mind, afterwards I saw the QNX part of the bug report.But QTCREATORBUG-28072 - Constantly crashing on Boot2Qt builds and/or stopping running Boot2Qt process seems more like the case here.
-
https://codereview.qt-project.org/c/qt-creator/qt-creator/+/442538 should hopefully fix it. Is anyone able to confirm / deny whether the provided patch fixes this reproducible crash?