Skip to content
  • Kevin Funk's avatar
    Fix crash when attaching GammaRay to running proc · 65234d36
    Kevin Funk authored
    
    
    Backtrace (excerpt):
    ```
    Thread 1 "qtcreator" received signal SIGSEGV, Segmentation fault.
    0  0x00007fffe2a809d0 in ProjectExplorer::Runnable::Runnable (this=0x7fffffffc5c0, other=...) at /home/kfunk/devel/src/qt-creator-4.3/src/plugins/projectexplorer/runconfiguration.h:175
    1  0x00007fffe2a81eab in QPair<ProjectExplorer::Runnable, Utils::ProcessHandle>::QPair (this=0x7fffffffc5c0, t1=..., t2=...) at ../../../../qt5.8/qtbase/include/QtCore/../../../../../src/qt5.8/qtbase/src/corelib/tools/qpair.h:61
    2  0x00007fffe2a81f04 in qMakePair<ProjectExplorer::Runnable, Utils::ProcessHandle> (x=..., y=...) at ../../../../qt5.8/qtbase/include/QtCore/../../../../../src/qt5.8/qtbase/src/corelib/tools/qpair.h:151
    3  0x00007fffe2a6e74a in ProjectExplorer::ProjectExplorerPlugin::runningRunControlProcesses () at /home/kfunk/devel/src/qt-creator-4.3/src/plugins/projectexplorer/projectexplorer.cpp:2568
    4  0x00007fffdfcfef4e in GammaRayIntegration::Internal::ProcessTrackerBackendQtCreator::checkProcess (this=0x555556240c10, pid=6881) at ../../../src/qtauto/kdab-plugin-gammaray-qtas1.2/gammarayprocesstrackerbackendqtc.cpp:112
    5  0x00007fffdf943b6a in GammaRay::ProcessTracker::D::requestUpdate (this=0x555556230800) at /home/kfunk/devel/src/qtauto/gammaray-qtas1.2/common/processtracker.cpp:72
    6  0x00007fffdf943548 in GammaRay::ProcessTracker::D::qt_static_metacall (_o=0x555556230800, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x7fffffffc800) at common/processtracker.moc:77
    7  0x00007ffff66cf95a in QMetaObject::activate (sender=0x555556230900, signalOffset=3, local_signal_index=0, argv=0x0) at /home/kfunk/devel/src/qt5.8/qtbase/src/corelib/kernel/qobject.cpp:3743
    
    (gdb) frame 0
    0  0x00007fffe2a809d0 in ProjectExplorer::Runnable::Runnable (this=0x7fffffffc5c0, other=...) at /home/kfunk/devel/src/qt-creator-4.3/src/plugins/projectexplorer/runconfiguration.h:175
    (gdb) p other.d
    8 = std::unique_ptr<ProjectExplorer::Runnable::Concept> containing 0x0
    ```
    
    Fixed both locations where there's a potential nullptr derefence in this
    file.
    
    Change-Id: I23f7db6f18675470b19cdf39dce449c5b694160d
    Reviewed-by: default avatarChristian Stenger <christian.stenger@qt.io>
    Reviewed-by: default avatarhjk <hjk@qt.io>
    65234d36