Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
Qt Creator 4.1.0-beta1
-
None
-
fb137ade7d93955a930ca9ba21f55dfd6b599f08
Description
When opening a .pro file, Qt Creator shows the dialog to configure it. After configuring the paths and clicking the Configure button, Creator crashes with segmentation fault.
The valgrind trace proves that there was a recursion and access to an uninitialised pointer:
==104757== Use of uninitialised value of size 8 ==104757== at 0x55D6128: QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::data() const (qscopedpointer.h:135) ==104757== by 0x57B56AB: QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::pointer qGetPtrHelper<QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> > >(QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> > const&) (qglobal.h:1013) ==104757== by 0x57B5AD9: QLabel::d_func() (qlabel.h:143) ==104757== by 0x57B0008: QLabel::setText(QString const&) (qlabel.cpp:290) ==104757== by 0x14DF9B94: Core::Internal::VariableChooserPrivate::updateDescription(QModelIndex const&) (variablechooser.cpp:406) ==104757== by 0x14DF8A9E: Core::Internal::VariableTreeView::currentChanged(QModelIndex const&, QModelIndex const&) (variablechooser.cpp:235) ==104757== by 0x5926597: QAbstractItemView::setSelectionModel(QItemSelectionModel*) (qabstractitemview.cpp:790) ==104757== by 0x59758F7: QTreeView::setSelectionModel(QItemSelectionModel*) (qtreeview.cpp:278) ==104757== by 0x5926115: QAbstractItemView::setModel(QAbstractItemModel*) (qabstractitemview.cpp:727) ==104757== by 0x5975625: QTreeView::setModel(QAbstractItemModel*) (qtreeview.cpp:236) ==104757== by 0x14DF8C71: Core::Internal::VariableChooserPrivate::VariableChooserPrivate(Core::VariableChooser*) (variablechooser.cpp:248) ==104757== by 0x14DF94F4: Core::VariableChooser::VariableChooser(QWidget*) (variablechooser.cpp:352) ==104757== Uninitialised value was created by a heap allocation ==104757== at 0x4C2A6CF: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==104757== by 0x14DF94DF: Core::VariableChooser::VariableChooser(QWidget*) (variablechooser.cpp:352)
variablechooser.cpp:239-248
VariableChooserPrivate::VariableChooserPrivate(VariableChooser *parent) : q(parent), m_lineEdit(0), m_textEdit(0), m_plainTextEdit(0) { m_defaultDescription = VariableChooser::tr("Select a variable to insert."); m_variableTree = new VariableTreeView(q, this); m_variableTree->setModel(&m_model); /*** CRASHES HERE ***/
variablechooser.cpp:404-407
void VariableChooserPrivate::updateDescription(const QModelIndex &index)
{
m_variableDescription->setText(m_model.data(index, Qt::ToolTipRole).toString());
}
The m_variableDescription variable is not yet initialised by the constructor.