Fix crash in CMakePreferences::updateCache
Happened when invoking a solution involving starting up the
project config page.
Backtrace:
SUMMARY: AddressSanitizer: undefined-behavior
/home/kfunk/devel/src/kf5/kdevelop-stable/projectmanagers/cmake/settings/cmakepreferences.cpp:180:9
in
ASAN:DEADLYSIGNAL
31850==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000
(pc 0x7f10b452f8b7 bp 0x7fff26dce210 sp 0x7fff26dcdd20 T0)
#0 0x7f10b452f8b6 in CMakePreferences::updateCache(KDevelop::Path
const&)
/home/kfunk/devel/src/kf5/kdevelop-stable/projectmanagers/cmake/settings/cmakepreferences.cpp:180:9
#1 0x7f10b451a94f in CMakePreferences::buildDirChanged(int)
/home/kfunk/devel/src/kf5/kdevelop-stable/projectmanagers/cmake/settings/cmakepreferences.cpp:231:5
#2 0x7f10b454f049 in
QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<int>,
void, void (CMakePreferences::*)(int)>::call(void
(CMakePreferences::*)(int), CMakePreferences*, void**)
/usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:501:13
#3 0x7f10b454eb5d in void QtPrivate::FunctionPointer<void
(CMakePreferences::*)(int)>::call<QtPrivate::List<int>, void>(void
(CMakePreferences::*)(int), CMakePreferences*, void**)
/usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:520:13
#4 0x7f10b454e5ff in QtPrivate::QSlotObject<void
(CMakePreferences::*)(int), QtPrivate::List<int>, void>::impl(int,
QtPrivate::QSlotObjectBase*, QObject*, void**, bool*)
/usr/include/x86_64-linux-gnu/qt5/QtCore/qobject_impl.h:143:17
#5 0x7f10fb4b8e4e in QMetaObject::activate(QObject*, int, int,
void**) (/usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2b4e4e)
#6 0x7f10fbe8f380 in QComboBox::currentIndexChanged(int)
(/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x26d380)
#7 0x7f10fbe917e0
(/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x26f7e0)
#8 0x7f10fbe93e0c
(/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x271e0c)
#9 0x7f10fbe9403e in QComboBox::setCurrentIndex(int)
(/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x27203e)
#10 0x7f10fbe99678
(/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x277678)
#11 0x7f10fb4b8fc9 in QMetaObject::activate(QObject*, int, int,
void**) (/usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2b4fc9)
#12 0x7f10fb535323 in QAbstractItemModel::rowsInserted(QModelIndex
const&, int, int, QAbstractItemModel::QPrivateSignal)
(/usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x331323)
#13 0x7f10fb432775 in QAbstractItemModel::endInsertRows()
(/usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x22e775)
#14 0x7f10fbb38f32
(/usr/lib/x86_64-linux-gnu/libQt5Gui.so.5+0x45ef32)
#15 0x7f10fbe965bb in QComboBox::insertItems(int, QStringList
const&) (/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x2745bb)
#16 0x7f10b454148e in QComboBox::addItems(QStringList const&)
/usr/include/x86_64-linux-gnu/qt5/QtWidgets/qcombobox.h:174:11
#17 0x7f10b4526a23 in CMakePreferences::reset()
/home/kfunk/devel/src/kf5/kdevelop-stable/projectmanagers/cmake/settings/cmakepreferences.cpp:108:5
#18 0x7f10b4519e3d in
CMakePreferences::CMakePreferences(KDevelop::IPlugin*,
KDevelop::ProjectConfigOptions const&, QWidget*)
/home/kfunk/devel/src/kf5/kdevelop-stable/projectmanagers/cmake/settings/cmakepreferences.cpp:95:5
#19 0x7f10b4479bd7 in CMakeManager::perProjectConfigPage(int,
KDevelop::ProjectConfigOptions const&, QWidget*)
/home/kfunk/devel/src/kf5/kdevelop-stable/projectmanagers/cmake/cmakemanager.cpp:886:20
#20 0x7f11021ecfdc in
KDevelop::ProjectControllerPrivate::projectConfig(QObject*)
/home/kfunk/devel/src/kf5/kdevplatform-stable/shell/projectcontroller.cpp:143:36
#21 0x7f11021c380f in
KDevelop::ProjectController::configureProject(KDevelop::IProject*)
/home/kfunk/devel/src/kf5/kdevplatform-stable/shell/projectcontroller.cpp:976:5
#22 0x7f10afe80e42 in
DefinesAndIncludesManager::openConfigurationDialog(QString const&)
/home/kfunk/devel/src/kf5/kdevelop-stable/languages/plugins/custom-definesandincludes/definesandincludesmanager.cpp:224:9
...