<table><tr><td style="">brauch created this revision.<br />brauch added reviewers: apol, KDevelop.<br />Restricted Application added a subscriber: kdevelop-devel.<br />brauch requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D9858" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>See: <a href="https://forum.kde.org/viewtopic.php?f=218&t=129389" class="remarkup-link" target="_blank" rel="noreferrer">https://forum.kde.org/viewtopic.php?f=218&t=129389</a></p>
<p>Not sure if this is the right fix, I didn't really look into it in depth ... maybe the process should not be deleted that early ... Aleix?</p>
<p>This is the valgrind output, process is already deleted when the debug is called:</p>
<h3 class="remarkup-header">11028== Invalid read of size 8</h3>
<h3 class="remarkup-header">11028== at 0xA79EAF4: KProcess::program() const (in /usr/lib/libKF5CoreAddons.so.5.41.0)</h3>
<h3 class="remarkup-header">11028== by 0x4F80A0D: operator() (runtimecontroller.cpp:44)</h3>
<h3 class="remarkup-header">11028== by 0x4F80A0D: call (qobjectdefs_impl.h:130)</h3>
<h3 class="remarkup-header">11028== by 0x4F80A0D: call<QtPrivate::List<QProcess::ProcessError>, void> (qobjectdefs_impl.h:240)</h3>
<h3 class="remarkup-header">11028== by 0x4F80A0D: QtPrivate::QFunctorSlotObject<IdentityRuntime::startProcess(KProcess*) const::{lambda(QProcess::ProcessError)#1}, 1, QtPrivate::List<QProcess::ProcessError>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (qobjectdefs_impl.h:423)</h3>
<h3 class="remarkup-header">11028== by 0xBCE5B2E: QMetaObject::activate(QObject*, int, int, void**) (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xBC2E551: QProcess::errorOccurred(QProcess::ProcessError) (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xBC35590: ??? (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xBC3A834: ??? (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xBC2FD6B: QProcess::waitForFinished(int) (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xBC306F1: QProcess::~QProcess() (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xA79E809: KProcess::~KProcess() (in /usr/lib/libKF5CoreAddons.so.5.41.0)</h3>
<h3 class="remarkup-header">11028== by 0xBCE354C: QObjectPrivate::deleteChildren() (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xBCED17B: QObject::~QObject() (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0x545C31C2: ~ScriptAppJob (scriptappjob.h:38)</h3>
<h3 class="remarkup-header">11028== by 0x545C31C2: ScriptAppJob::~ScriptAppJob() (scriptappjob.h:38)</h3>
<h3 class="remarkup-header">11028== by 0xBCE6470: QObject::event(QEvent*) (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xAB53E3B: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/libQt5Widgets.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xAB5B815: QApplication::notify(QObject*, QEvent*) (in /usr/lib/libQt5Widgets.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xBCB51DF: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xBCB7E45: QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xBD120A3: ??? (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0x1554C26F: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.5400.0)</h3>
<h3 class="remarkup-header">11028== by 0x1554DF68: ??? (in /usr/lib/libglib-2.0.so.0.5400.0)</h3>
<h3 class="remarkup-header">11028== by 0x1554DFAD: g_main_context_iteration (in /usr/lib/libglib-2.0.so.0.5400.0)</h3>
<h3 class="remarkup-header">11028== by 0xBD11690: QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0x31152151: ??? (in /usr/lib/libQt5XcbQpa.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xBCB382A: QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xBCBCB17: QCoreApplication::exec() (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0x114B9A: main (main.cpp:824)</h3>
<h3 class="remarkup-header">11028== Address 0x677edbf0 is 0 bytes inside a block of size 32 free'd</h3>
<h3 class="remarkup-header">11028== at 0x4C2E64B: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)</h3>
<h3 class="remarkup-header">11028== by 0xA79E7ED: KProcess::~KProcess() (in /usr/lib/libKF5CoreAddons.so.5.41.0)</h3>
<h3 class="remarkup-header">11028== by 0xA79E809: KProcess::~KProcess() (in /usr/lib/libKF5CoreAddons.so.5.41.0)</h3>
<h3 class="remarkup-header">11028== by 0xBCE354C: QObjectPrivate::deleteChildren() (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xBCED17B: QObject::~QObject() (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0x545C31C2: ~ScriptAppJob (scriptappjob.h:38)</h3>
<h3 class="remarkup-header">11028== by 0x545C31C2: ScriptAppJob::~ScriptAppJob() (scriptappjob.h:38)</h3>
<h3 class="remarkup-header">11028== by 0xBCE6470: QObject::event(QEvent*) (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xAB53E3B: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/libQt5Widgets.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xAB5B815: QApplication::notify(QObject*, QEvent*) (in /usr/lib/libQt5Widgets.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xBCB51DF: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xBCB7E45: QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xBD120A3: ??? (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0x1554C26F: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.5400.0)</h3>
<h3 class="remarkup-header">11028== by 0x1554DF68: ??? (in /usr/lib/libglib-2.0.so.0.5400.0)</h3>
<h3 class="remarkup-header">11028== by 0x1554DFAD: g_main_context_iteration (in /usr/lib/libglib-2.0.so.0.5400.0)</h3>
<h3 class="remarkup-header">11028== by 0xBD11690: QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0x31152151: ??? (in /usr/lib/libQt5XcbQpa.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xBCB382A: QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xBCBCB17: QCoreApplication::exec() (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0x114B9A: main (main.cpp:824)</h3>
<h3 class="remarkup-header">11028== Block was alloc'd at</h3>
<h3 class="remarkup-header">11028== at 0x4C2D52F: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)</h3>
<h3 class="remarkup-header">11028== by 0xA79E467: KProcess::KProcess(QObject*) (in /usr/lib/libKF5CoreAddons.so.5.41.0)</h3>
<h3 class="remarkup-header">11028== by 0x545C065B: ScriptAppJob::ScriptAppJob(ExecuteScriptPlugin*, KDevelop::ILaunchConfiguration*) (scriptappjob.cpp:51)</h3>
<h3 class="remarkup-header">11028== by 0x545B9D66: ScriptAppLauncher::start(QString const&, KDevelop::ILaunchConfiguration*) (scriptappconfig.cpp:166)</h3>
<h3 class="remarkup-header">11028== by 0x4F2942F: KDevelop::RunController::execute(QString const&, KDevelop::ILaunchConfiguration*) (runcontroller.cpp:425)</h3>
<h3 class="remarkup-header">11028== by 0x4F2AA78: KDevelop::RunController::executeDefaultLaunch(QString const&) (runcontroller.cpp:878)</h3>
<h3 class="remarkup-header">11028== by 0x4F28B18: KDevelop::RunController::slotExecute() (runcontroller.cpp:561)</h3>
<h3 class="remarkup-header">11028== by 0xBCE5B2E: QMetaObject::activate(QObject*, int, int, void**) (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xAB4D382: QAction::triggered(bool) (in /usr/lib/libQt5Widgets.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xAB4FC05: QAction::activate(QAction::ActionEvent) (in /usr/lib/libQt5Widgets.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xACD5C34: ??? (in /usr/lib/libQt5Widgets.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xACDD2FB: ??? (in /usr/lib/libQt5Widgets.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xACDE163: QMenu::mouseReleaseEvent(QMouseEvent*) (in /usr/lib/libQt5Widgets.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xAB93E37: QWidget::event(QEvent*) (in /usr/lib/libQt5Widgets.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xACE049B: QMenu::event(QEvent*) (in /usr/lib/libQt5Widgets.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xAB53E3B: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/libQt5Widgets.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xAB5BD90: QApplication::notify(QObject*, QEvent*) (in /usr/lib/libQt5Widgets.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xBCB51DF: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xAB5AD19: QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) (in /usr/lib/libQt5Widgets.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xABAEFB6: ??? (in /usr/lib/libQt5Widgets.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xABB199F: ??? (in /usr/lib/libQt5Widgets.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xAB53E3B: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/libQt5Widgets.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xAB5B815: QApplication::notify(QObject*, QEvent*) (in /usr/lib/libQt5Widgets.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xBCB51DF: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xB361633: QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) (in /usr/lib/libQt5Gui.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xB363185: QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) (in /usr/lib/libQt5Gui.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xB33ABBB: QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) (in /usr/lib/libQt5Gui.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0x3115215C: ??? (in /usr/lib/libQt5XcbQpa.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xBCB382A: QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028== by 0xBCBCB17: QCoreApplication::exec() (in /usr/lib/libQt5Core.so.5.10.0)</h3>
<h3 class="remarkup-header">11028</h3></div></div><br /><div><strong>REPOSITORY</strong><div><div>R32 KDevelop</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D9858" rel="noreferrer">https://phabricator.kde.org/D9858</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>kdevplatform/shell/runtimecontroller.cpp</div></div></div><br /><div><strong>To: </strong>brauch, apol, KDevelop<br /><strong>Cc: </strong>kdevelop-devel<br /></div>