Bug 468596

Summary: adding new qml item crashes [KDevelop::NormalDeclarationCompletionItem::data]
Product: [Applications] kdevelop Reporter: Rolf Eike Beer <kde>
Component: Language Support: QML/JavaScriptAssignee: kdevelop-bugs-null
Status: RESOLVED FIXED    
Severity: crash CC: igorkuo
Priority: NOR    
Version: git master   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Rolf Eike Beer 2023-04-17 05:20:20 UTC
git master at commit 5283f6ab4e3d4b6e21327eadf74b5ec9276e5dee

STEPS TO REPRODUCE
1. Open an existing QML file
2. add a new item at a proper place like a Rectangle

OBSERVED RESULT

I can only type 1-2 chars, then I hit this:

ASSERT: "nav" in file /home/ebeer/repos/upstream/KDE/kdevelop/kdevplatform/language/codecompletion/normaldeclarationcompletionitem.cpp, line 192

Thread 1 "kdevelop" received signal SIGABRT, Aborted.
0x00007ffff2694d7c in __pthread_kill_implementation () from /lib64/libc.so.6
(gdb) bt
#0  0x00007ffff2694d7c in __pthread_kill_implementation () at /lib64/libc.so.6
#1  0x00007ffff2643356 in raise () at /lib64/libc.so.6
#2  0x00007ffff262b897 in abort () at /lib64/libc.so.6
#3  0x00007ffff2cbb4e9 in  () at /lib64/libQt5Core.so.5
#4  0x00007ffff2cba720 in qt_assert_x(char const*, char const*, char const*, int) () at /lib64/libQt5Core.so.5
#5  0x00007ffff6234381 in KDevelop::NormalDeclarationCompletionItem::data(QModelIndex const&, int, KDevelop::CodeCompletionModel const*) const (this=0x7ffe81de09e0, index=..., role=264, model=0x2b002b0)
    at /home/ebeer/repos/upstream/KDE/kdevelop/kdevplatform/language/codecompletion/normaldeclarationcompletionitem.cpp:192
#6  0x00007ffee529bc9a in QmlJS::CompletionItem::data(QModelIndex const&, int, KDevelop::CodeCompletionModel const*) const (this=0x7ffe81de09e0, index=..., role=264, model=0x2b002b0) at /home/ebeer/repos/upstream/KDE/kdevelop/plugins/qmljs/codecompletion/items/completionitem.cpp:139
#7  0x00007ffff622e654 in KDevelop::CodeCompletionModel::data(QModelIndex const&, int) const (this=0x2b002b0, index=..., role=264) at /home/ebeer/repos/upstream/KDE/kdevelop/kdevplatform/language/codecompletion/codecompletionmodel.cpp:363
#8  0x00007ffff5ade171 in  () at /lib64/libKF5TextEditor.so.5
#9  0x00007ffff5aeca9d in KateCompletionModel::data(QModelIndex const&, int) const () at /lib64/libKF5TextEditor.so.5
#10 0x00007ffff5adf8c7 in KateCompletionWidget::showDocTip(QModelIndex const&) () at /lib64/libKF5TextEditor.so.5
#11 0x00007ffff5af74b8 in  () at /lib64/libKF5TextEditor.so.5
#12 0x00007ffff2f253a3 in  () at /lib64/libQt5Core.so.5
#13 0x00007ffff2e963ea in QItemSelectionModel::currentChanged(QModelIndex const&, QModelIndex const&) () at /lib64/libQt5Core.so.5
#14 0x00007ffff2e99e79 in QItemSelectionModel::setCurrentIndex(QModelIndex const&, QFlags<QItemSelectionModel::SelectionFlag>) () at /lib64/libQt5Core.so.5
#15 0x00007ffff4011c6f in QAbstractItemView::setCurrentIndex(QModelIndex const&) () at /lib64/libQt5Widgets.so.5
#16 0x00007ffff5aea4aa in  () at /lib64/libKF5TextEditor.so.5
#17 0x00007ffff2f25402 in  () at /lib64/libQt5Core.so.5
#18 0x00007ffff2e85ecd in QAbstractItemModel::modelReset(QAbstractItemModel::QPrivateSignal) () at /lib64/libQt5Core.so.5
#19 0x00007ffff5aee9c5 in  () at /lib64/libKF5TextEditor.so.5
#20 0x00007ffff2f25402 in  () at /lib64/libQt5Core.so.5
#21 0x00007ffff2e85ecd in QAbstractItemModel::modelReset(QAbstractItemModel::QPrivateSignal) () at /lib64/libQt5Core.so.5
#22 0x00007ffff622dd94 in KDevelop::CodeCompletionModel::foundDeclarations(QList<QExplicitlySharedDataPointer<KDevelop::CompletionTreeElement> > const&, QExplicitlySharedDataPointer<KDevelop::CodeCompletionContext> const&)
    (this=0x2b002b0, items=QList<QExplicitlySharedDataPointer<KDevelop::CompletionTreeElement>> (size = 1) = {...}, completionContext=...) at /home/ebeer/repos/upstream/KDE/kdevelop/kdevplatform/language/codecompletion/codecompletionmodel.cpp:251
#23 0x00007ffff62310f0 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1>, QtPrivate::List<QList<QExplicitlySharedDataPointer<KDevelop::CompletionTreeElement> > const&, QExplicitlySharedDataPointer<KDevelop::CodeCompletionContext> const&>, void, void (KDevelop::CodeCompletionModel::*)(QList<QExplicitlySharedDataPointer<KDevelop::CompletionTreeElement> > const&, QExplicitlySharedDataPointer<KDevelop::CodeCompletionContext> const&)>::call(void (KDevelop::CodeCompletionModel::*)(QList<QExplicitlySharedDataPointer<KDevelop::CompletionTreeElement> > const&, QExplicitlySharedDataPointer<KDevelop::CodeCompletionContext> const&), KDevelop::CodeCompletionModel*, void**) (f=&virtual KDevelop::CodeCompletionModel::foundDeclarations(QList<QExplicitlySharedDataPointer<KDevelop::CompletionTreeElement> > const&, QExplicitlySharedDataPointer<KDevelop::CodeCompletionContext> const&), o=0x2b002b0, arg=0x7ffe745bbb18)
    at /usr/include/qt5/QtCore/qobjectdefs_impl.h:152
#24 0x00007ffff6230e45 in QtPrivate::FunctionPointer<void (KDevelop::CodeCompletionModel::*)(QList<QExplicitlySharedDataPointer<KDevelop::CompletionTreeElement> > const&, QExplicitlySharedDataPointer<KDevelop::CodeCompletionContext> const&)>::call<QtPrivate::List<QList<QExplicitlySharedDataPointer<KDevelop::CompletionTreeElement> > const&, QExplicitlySharedDataPointer<KDevelop::CodeCompletionContext> const&>, void>(void (KDevelop::CodeCompletionModel::*)(QList<QExplicitlySharedDataPointer<KDevelop::CompletionTreeElement> > const&, QExplicitlySharedDataPointer<KDevelop::CodeCompletionContext> const&), KDevelop::CodeCompletionModel*, void**) (f=&virtual KDevelop::CodeCompletionModel::foundDeclarations(QList<QExplicitlySharedDataPointer<KDevelop::CompletionTreeElement> > const&, QExplicitlySharedDataPointer<KDevelop::CodeCompletionContext> const&), o=0x2b002b0, arg=0x7ffe745bbb18)
    at /usr/include/qt5/QtCore/qobjectdefs_impl.h:185
#25 0x00007ffff623094d in QtPrivate::QSlotObject<void (KDevelop::CodeCompletionModel::*)(QList<QExplicitlySharedDataPointer<KDevelop::CompletionTreeElement> > const&, QExplicitlySharedDataPointer<KDevelop::CodeCompletionContext> const&), QtPrivate::List<QList<QExplicitlySharedDataPointer<KDevelop::CompletionTreeElement> > const&, QExplicitlySharedDataPointer<KDevelop::CodeCompletionContext> const&>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x7ffe83569370, r=0x2b002b0, a=0x7ffe745bbb18, ret=0x0) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:418
#26 0x00007ffff2f18e20 in QObject::event(QEvent*) () at /lib64/libQt5Core.so.5
#27 0x00007ffff3da52ce in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#28 0x00007ffff2eecb28 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib64/libQt5Core.so.5
#29 0x00007ffff2ef0121 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /lib64/libQt5Core.so.5
#30 0x00007ffff2f468a3 in  () at /lib64/libQt5Core.so.5
#31 0x00007ffff0f16f96 in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#32 0x00007ffff0f17358 in  () at /lib64/libglib-2.0.so.0
#33 0x00007ffff0f173ec in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#34 0x00007ffff2f460b6 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#35 0x00007ffff2eeb5cb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#36 0x00007ffff2ef3a50 in QCoreApplication::exec() () at /lib64/libQt5Core.so.5
#37 0x0000000000413e2a in main(int, char**) (argc=1, argv=0x7fffffffd748) at /home/ebeer/repos/upstream/KDE/kdevelop/app/main.cpp:841

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: openSUSE Tumbleweed, currently at KDE Gear 22.12.3
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.105.0
Qt Version: 5.15.8+kde8
Comment 1 Igor Kushnir 2023-04-17 09:16:58 UTC
The qmljs plugin lacks a maintainer and may have to be disabled during porting to Qt 6. See https://mail.kde.org/pipermail/kdevelop-devel/2022-August/063726.html