Bug 442974

Summary: KDevelop crash when I filtering a class though the Class Browser ToolView
Product: [Applications] kdevelop Reporter: Petros <petross404>
Component: generalAssignee: Jonathan Verner <jonathan.verner>
Status: REPORTED ---    
Severity: crash CC: jonathan.verner
Priority: NOR Keywords: drkonqi
Version First Reported In: 5.6.2   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Petros 2021-09-26 11:10:48 UTC
Application: kdevelop (5.6.2)
 (Compiled from sources)
Qt Version: 5.15.2
Frameworks Version: 5.86.0
Operating System: Linux 5.13.7-gentoo x86_64
Windowing System: X11
Drkonqi Version: 5.22.5
Distribution: "Gentoo Base System release 2.7"

-- Information about the crash:
- What I was doing when the application crashed:

KDevelop crashed when I filtered a class though the Class Browser ToolView.

The reporter is unsure if this crash is reproducible.

-- Backtrace:
Application: KDevelop (kdevelop), signal: Segmentation fault

[KCrash Handler]
#4  0x00007f211fd5675d in ClassModelNodes::ClassNode::updateClassDeclarations() (this=this@entry=0x55a98ee6fb90) at /tmp/portage/dev-util/kdevelop-5.6.2/work/kdevelop-5.6.2/kdevplatform/language/classmodel/classmodelnode.cpp:163
#5  0x00007f211fd57201 in ClassModelNodes::ClassNode::populateNode() (this=0x55a98ee6fb90) at /tmp/portage/dev-util/kdevelop-5.6.2/work/kdevelop-5.6.2/kdevplatform/language/classmodel/classmodelnode.cpp:139
#6  0x00007f211fd575ed in ClassModelNodes::DynamicNode::performPopulateNode(bool) (this=0x55a98ee6fb90, a_forceRepopulate=<optimized out>) at /tmp/portage/dev-util/kdevelop-5.6.2/work/kdevelop-5.6.2/kdevplatform/language/classmodel/classmodelnode.cpp:555
#7  0x00007f2121254542 in  () at /usr/lib64/libQt5Core.so.5
#8  0x00007f2122140b72 in QTreeView::expanded(QModelIndex const&) () at /usr/lib64/libQt5Widgets.so.5
#9  0x00007f212214d016 in QTreeViewPrivate::expand(int, bool) () at /usr/lib64/libQt5Widgets.so.5
#10 0x00007f212214d228 in QTreeView::expand(QModelIndex const&) () at /usr/lib64/libQt5Widgets.so.5
#11 0x00007f20fc403965 in ClassTree::itemActivated(QModelIndex const&) (this=0x55a9838884d0, index=...) at /tmp/portage/dev-util/kdevelop-5.6.2/work/kdevelop-5.6.2/plugins/classbrowser/classtree.cpp:145
#12 0x00007f2121254542 in  () at /usr/lib64/libQt5Core.so.5
#13 0x00007f21220d0765 in QAbstractItemView::activated(QModelIndex const&) () at /usr/lib64/libQt5Widgets.so.5
#14 0x00007f21220d483b in QAbstractItemView::mouseReleaseEvent(QMouseEvent*) () at /usr/lib64/libQt5Widgets.so.5
#15 0x00007f2121e9e6ac in QWidget::event(QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#16 0x00007f2121f4ddee in QFrame::event(QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#17 0x00007f212121fa8b in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () at /usr/lib64/libQt5Core.so.5
#18 0x00007f2121e5b8ce in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#19 0x00007f2121e6318b in QApplication::notify(QObject*, QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#20 0x00007f212121fcc3 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib64/libQt5Core.so.5
#21 0x00007f2121e61fbd in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) () at /usr/lib64/libQt5Widgets.so.5
#22 0x00007f2121eb7d7c in  () at /usr/lib64/libQt5Widgets.so.5
#23 0x00007f2121ebaf9c in  () at /usr/lib64/libQt5Widgets.so.5
#24 0x00007f2121e5b8e5 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#25 0x00007f212121fcc3 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib64/libQt5Core.so.5
#26 0x00007f2121731e80 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () at /usr/lib64/libQt5Gui.so.5
#27 0x00007f2121711e73 in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Gui.so.5
#28 0x00007f210da2621a in  () at /usr/lib64/libQt5XcbQpa.so.5
#29 0x00007f211d8ca4f0 in g_main_context_dispatch () at /usr/lib64/libglib-2.0.so.0
#30 0x00007f211d8ca9c0 in  () at /usr/lib64/libglib-2.0.so.0
#31 0x00007f211d8caa6f in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0
#32 0x00007f2121273bb4 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
#33 0x00007f212121e713 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
#34 0x00007f2121226acd in QCoreApplication::exec() () at /usr/lib64/libQt5Core.so.5
#35 0x000055a98127484a in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /tmp/portage/dev-util/kdevelop-5.6.2/work/kdevelop-5.6.2/app/main.cpp:850
[Inferior 1 (process 6165) detached]

Possible duplicates by query: bug 425618, bug 406931, bug 273355.

Reported using DrKonqi
Comment 1 Jonathan Verner 2021-11-03 22:27:56 UTC
I don't quite follow the code (its late here :-)), but perhaps we should test that `klass->internalContext()` does not return null at
`kdevplatform/language/classmodel/classmodelnode.cpp:163` like we do on line 110? Will try to look into this...