Bug 473332 - Discover crashes in KNSCore::ResultsStream::fetch when searching
Summary: Discover crashes in KNSCore::ResultsStream::fetch when searching
Status: RESOLVED FIXED
Alias: None
Product: Discover
Classification: Applications
Component: KNewStuff Backend (show other bugs)
Version: master
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: qt6, regression
: 483177 484658 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-08-13 13:30 UTC by Nicolas Fella
Modified: 2024-04-09 15:48 UTC (History)
12 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0.3


Attachments
crash when searching for libreoffice (57.29 KB, text/vnd.kde.kcrash-report)
2023-12-23 10:59 UTC, ichweissnix
Details
GDB Backtrace - KNSCore::ResultStream::fetch SIGSEGV (205.82 KB, text/plain)
2024-02-12 17:55 UTC, Arazil
Details
crash when searching for libreoffice 2024 02 21 (63.60 KB, text/plain)
2024-02-21 14:59 UTC, ichweissnix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Fella 2023-08-13 13:30:45 UTC
STEPS TO REPRODUCE
1. Open Discover 
2. Search for something

OBSERVED RESULT
#0  0x00007fff8053e84e in KNSCore::ResultsStream::fetch() (this=0x3d07b80) at /home/nico/kde6/src/knewstuff/src/core/resultsstream.cpp:62
#1  0x00007ffff4fde394 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7fffffffcf68, r=0x3d07b80, this=0x11e4c10)
    at /usr/src/debug/qt6-qtbase-6.5.2-1.fc38.x86_64/src/corelib/kernel/qobjectdefs_impl.h:363
#2  doActivate<false>(QObject*, int, void**) (sender=0x6089750, signal_index=4, argv=0x7fffffffcf68) at /usr/src/debug/qt6-qtbase-6.5.2-1.fc38.x86_64/src/corelib/kernel/qobject.cpp:3992
#3  0x00007ffff4fde394 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7fffffffd048, r=0x6089750, this=0x6092a00)
    at /usr/src/debug/qt6-qtbase-6.5.2-1.fc38.x86_64/src/corelib/kernel/qobjectdefs_impl.h:363
#4  doActivate<false>(QObject*, int, void**) (sender=0x608fc10, signal_index=4, argv=0x7fffffffd048) at /usr/src/debug/qt6-qtbase-6.5.2-1.fc38.x86_64/src/corelib/kernel/qobject.cpp:3992
#5  0x00007ffff73a3ceb in non-virtual thunk to VDMAbstractItemModelDataType::fetchMore(QQmlAdaptorModel&) const () at /usr/src/debug/qt6-qtdeclarative-6.5.2-1.fc38.x86_64/src/qmlmodels/qqmladaptormodel.cpp:474
#6  0x00007ffff73acd5b in QQmlAdaptorModel::fetchMore() (this=0x60391b0)
    at /usr/src/debug/qt6-qtdeclarative-6.5.2-1.fc38.x86_64/redhat-linux-build/include/QtQmlModels/6.5.2/QtQmlModels/private/../../../../../../src/qmlmodels/qqmladaptormodel_p.h:135
#7  QQmlDelegateModel::event(QEvent*) (this=0x6039010, e=0x6098320) at /usr/src/debug/qt6-qtdeclarative-6.5.2-1.fc38.x86_64/src/qmlmodels/qqmldelegatemodel.cpp:1413
#8  0x00007ffff75c0af8 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x6039010, e=0x6098320)
    at /usr/src/debug/qt6-qtbase-6.5.2-1.fc38.x86_64/src/widgets/kernel/qapplication.cpp:3287
#9  0x00007ffff4f7cdb8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x6039010, event=0x6098320) at /usr/src/debug/qt6-qtbase-6.5.2-1.fc38.x86_64/src/corelib/kernel/qcoreapplication.cpp:1118
#10 0x00007ffff4f7cfbd in QCoreApplication::sendEvent(QObject*, QEvent*) (receiver=<optimized out>, event=<optimized out>)
    at /usr/src/debug/qt6-qtbase-6.5.2-1.fc38.x86_64/src/corelib/kernel/qcoreapplication.cpp:1536
#11 0x00007ffff4f808d5 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=0x0, event_type=0, data=0x49f970)
    at /usr/src/debug/qt6-qtbase-6.5.2-1.fc38.x86_64/src/corelib/kernel/qcoreapplication.cpp:1898
#12 0x00007ffff4f80c0d in QCoreApplication::sendPostedEvents(QObject*, int) (receiver=<optimized out>, event_type=<optimized out>)
    at /usr/src/debug/qt6-qtbase-6.5.2-1.fc38.x86_64/src/corelib/kernel/qcoreapplication.cpp:1757
#13 0x00007ffff522108f in postEventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x7480d0) at /usr/src/debug/qt6-qtbase-6.5.2-1.fc38.x86_64/src/corelib/kernel/qeventdispatcher_glib.cpp:243
#14 0x00007ffff44a548c in g_main_dispatch (context=0x7fffdc000f10) at ../glib/gmain.c:3460
#15 g_main_context_dispatch (context=0x7fffdc000f10) at ../glib/gmain.c:4200
#16 0x00007ffff4503648 in g_main_context_iterate.isra.0 (context=0x7fffdc000f10, block=1, dispatch=1, self=<optimized out>) at ../glib/gmain.c:4276
#17 0x00007ffff44a2b13 in g_main_context_iteration (context=0x7fffdc000f10, may_block=1) at ../glib/gmain.c:4343
#18 0x00007ffff522092f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x4a1280, flags=...)
    at /usr/src/debug/qt6-qtbase-6.5.2-1.fc38.x86_64/src/corelib/kernel/qeventdispatcher_glib.cpp:393
#19 0x00007ffff4f899f3 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fffffffd500, flags=..., flags@entry=...)
    at /usr/src/debug/qt6-qtbase-6.5.2-1.fc38.x86_64/src/corelib/global/qflags.h:34
#20 0x00007ffff4f8569d in QCoreApplication::exec() () at /usr/src/debug/qt6-qtbase-6.5.2-1.fc38.x86_64/src/corelib/global/qflags.h:74
#21 0x00007ffff59f917d in QGuiApplication::exec() () at /usr/src/debug/qt6-qtbase-6.5.2-1.fc38.x86_64/src/gui/kernel/qguiapplication.cpp:1908
#22 0x00007ffff75c0a69 in QApplication::exec() () at /usr/src/debug/qt6-qtbase-6.5.2-1.fc38.x86_64/src/widgets/kernel/qapplication.cpp:2566
#23 0x0000000000416ca3 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /home/nico/kde6/src/discover/discover/main.cpp:225

SOFTWARE/OS VERSIONS
KDE Plasma Version: master
KDE Frameworks Version: master
Qt Version: 6.5.2
Comment 1 Nate Graham 2023-08-13 15:17:14 UTC
Can't reproduce. Possible regression from https://invent.kde.org/plasma/discover/-/merge_requests/516.
Comment 2 Nicolas Fella 2023-11-14 00:59:03 UTC
Happens any time I want to search something in Discover
Comment 3 Jonathan Isom 2023-12-13 13:01:51 UTC
I am seeing this on 6.0 beta 1.  Happens every time and additionally clicking Installed also crashes it instantly.  Not sure if related.

Operating System: Arch Linux 
KDE Plasma Version: 5.90.0
KDE Frameworks Version: 5.246.0
Qt Version: 6.6.1
Kernel Version: 6.6.6-273-tkg-linux-tkg (64-bit)
Graphics Platform: Wayland
Processors: 24 × AMD Ryzen 9 5900X 12-Core Processor
Memory: 62.7 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 4080/PCIe/SSE2
Product Name: X570M Pro4
Comment 4 ichweissnix 2023-12-18 15:01:14 UTC
For me Discover crashes when searching only for some packages (libreoffice, plasma, paint,...).
Others just work fine.

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.90.90
KDE Frameworks Version: 5.247.0
Qt Version: 6.6.1
Kernel Version: 6.2.0-39-generic (64-bit)
Graphics Platform: Wayland
Processors: 8 × 11th Gen Intel® Core™ i7-1165G7 @ 2.80GHz
Memory: 15.4 GiB of RAM
Graphics Processor: Mesa Intel® Xe Graphics
Manufacturer: LENOVO
Product Name: 82BJ
System Version: Yoga 7 15ITL5
Comment 5 ichweissnix 2023-12-23 10:59:06 UTC
Created attachment 164401 [details]
crash when searching for libreoffice

Still the same, crashes when searching for some packages. 
Right now my system is basically a clean install on hardware.

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.91.90
KDE Frameworks Version: 5.248.0
Qt Version: 6.6.1
Kernel Version: 6.2.0-39-generic (64-bit)
Graphics Platform: Wayland
Comment 6 Nicolas Fella 2023-12-23 12:34:05 UTC
==4220==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f7c26b74a28 bp 0x7ffc022d0090 sp 0x7ffc022cff10 T0)
==4220==The signal is caused by a READ memory access.
==4220==Hint: address points to the zero page.
    #0 0x7f7c26b74a28 in KNSCore::ResultsStream::fetch() /home/nico/kde6/src/knewstuff/src/core/resultsstream.cpp:68
    #1 0x7f7c26b74daa in KNSCore::ResultsStream::fetchMore() /home/nico/kde6/src/knewstuff/src/core/resultsstream.cpp:82
    #2 0x7f7c27ea2e70 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (KNSCore::ResultsStream::*)()>::call(void (KNSCore::ResultsStream::*)(), KNSCore::ResultsStream*, void**) /usr/include/qt6/QtCore/qobjectdefs_impl.h:145
    #3 0x7f7c27e9daad in void QtPrivate::FunctionPointer<void (KNSCore::ResultsStream::*)()>::call<QtPrivate::List<>, void>(void (KNSCore::ResultsStream::*)(), KNSCore::ResultsStream*, void**) /usr/include/qt6/QtCore/qobjectdefs_impl.h:182
    #4 0x7f7c27e9873d in QtPrivate::QCallableObject<void (KNSCore::ResultsStream::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/qt6/QtCore/qobjectdefs_impl.h:520
    #5 0x7f7c55fdafb2 in void doActivate<false>(QObject*, int, void**) /usr/src/debug/qtbase-everywhere-src-6.6.1/build/include/QtCore/../../../src/corelib/kernel/qobjectdefs_impl.h:433
    #6 0x7f7c59c75962 in ResultsStream::fetchMore() /home/nico/kde6/build/discover/libdiscover/DiscoverCommon_autogen/3YJK5W5UP7/moc_AbstractResourcesBackend.cpp:193
    #7 0x7f7c59d59b24 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (ResultsStream::*)()>::call(void (ResultsStream::*)(), ResultsStream*, void**) (/home/nico/kde6/usr/lib64/plasma-discover/libDiscoverCommon.so+0x159b24) (BuildId: 6434677a9161946212fa3049b2acbb26912a48a6)
    #8 0x7f7c59d545ed in void QtPrivate::FunctionPointer<void (ResultsStream::*)()>::call<QtPrivate::List<>, void>(void (ResultsStream::*)(), ResultsStream*, void**) /usr/include/qt6/QtCore/qobjectdefs_impl.h:182
    #9 0x7f7c59d50813 in QtPrivate::QCallableObject<void (ResultsStream::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/qt6/QtCore/qobjectdefs_impl.h:520
    #10 0x7f7c55fdafb2 in void doActivate<false>(QObject*, int, void**) /usr/src/debug/qtbase-everywhere-src-6.6.1/build/include/QtCore/../../../src/corelib/kernel/qobjectdefs_impl.h:433
    #11 0x7f7c59c75962 in ResultsStream::fetchMore() /home/nico/kde6/build/discover/libdiscover/DiscoverCommon_autogen/3YJK5W5UP7/moc_AbstractResourcesBackend.cpp:193
    #12 0x7f7c59d6aedc in ResourcesProxyModel::fetchMore(QModelIndex const&) /home/nico/kde6/src/discover/libdiscover/resources/ResourcesProxyModel.cpp:765
    #13 0x7f7c595dc211  (/lib64/libQt6QmlModels.so.6+0x65211) (BuildId: 35c736bc4cef801135dfdfb0ea353bc1244d57b4)
    #14 0x7f7c595e52d3 in QQmlDelegateModel::event(QEvent*) (/lib64/libQt6QmlModels.so.6+0x6e2d3) (BuildId: 35c736bc4cef801135dfdfb0ea353bc1244d57b4)
    #15 0x7f7c58fc094d in QApplicationPrivate::notify_helper(QObject*, QEvent*) /usr/src/debug/qtbase-everywhere-src-6.6.1/src/widgets/kernel/qapplication.cpp:3296
    #16 0x7f7c55f878b7 in QCoreApplication::notifyInternal2(QObject*, QEvent*) /usr/src/debug/qtbase-everywhere-src-6.6.1/src/corelib/kernel/qcoreapplication.cpp:1121
    #17 0x7f7c55f87c16 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) /usr/src/debug/qtbase-everywhere-src-6.6.1/src/corelib/kernel/qcoreapplication.cpp:1901
    #18 0x7f7c561ad9e2 in postEventSourceDispatch /usr/src/debug/qtbase-everywhere-src-6.6.1/src/corelib/kernel/qeventdispatcher_glib.cpp:243
    #19 0x7f7c55872f2f in g_main_dispatch ../glib/gmain.c:3476
    #20 0x7f7c55872f2f in g_main_context_dispatch_unlocked ../glib/gmain.c:4284
    #21 0x7f7c55874b57 in g_main_context_iterate_unlocked ../glib/gmain.c:4349
    #22 0x7f7c5587520b in g_main_context_iteration ../glib/gmain.c:4414
    #23 0x7f7c561abc6b in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (/lib64/libQt6Core.so.6+0x3abc6b) (BuildId: da7667e446842b4ec5e606c6775afb0da17fb3fa)
    #24 0x7f7c55f9211a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (/lib64/libQt6Core.so.6+0x19211a) (BuildId: da7667e446842b4ec5e606c6775afb0da17fb3fa)
    #25 0x7f7c55f8bd45 in QCoreApplication::exec() (/lib64/libQt6Core.so.6+0x18bd45) (BuildId: da7667e446842b4ec5e606c6775afb0da17fb3fa)
    #26 0x4414b3 in main /home/nico/kde6/src/discover/discover/main.cpp:218
    #27 0x7f7c556281af in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #28 0x7f7c55628278 in __libc_start_main_impl ../csu/libc-start.c:360
    #29 0x418b44 in _start ../sysdeps/x86_64/start.S:115

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/nico/kde6/src/knewstuff/src/core/resultsstream.cpp:68 in KNSCore::ResultsStream::fetch()
Comment 7 Nicolas Fella 2023-12-23 12:35:16 UTC
(In reply to ichweissnix from comment #5)
> Created attachment 164401 [details]
> crash when searching for libreoffice
> 
> Still the same, crashes when searching for some packages. 
> Right now my system is basically a clean install on hardware.
> 
> Operating System: KDE neon Unstable Edition
> KDE Plasma Version: 5.91.90
> KDE Frameworks Version: 5.248.0
> Qt Version: 6.6.1
> Kernel Version: 6.2.0-39-generic (64-bit)
> Graphics Platform: Wayland

This looks more like https://bugs.kde.org/show_bug.cgi?id=477202
Comment 8 Nate Graham 2024-01-09 23:53:18 UTC
Alex, is this something we can expect https://invent.kde.org/frameworks/knewstuff/-/commit/b67f0c0bf8df59e3b7ed4f98ab2abcf2befe55ee to have fixed?
Comment 9 Alexander Lohnau 2024-01-10 05:54:32 UTC
That is at lease not what I had on mind when making the patch - did you notice any change due to the patch?
Comment 10 Nate Graham 2024-01-10 21:50:32 UTC
I can't reproduce the issue myself, so I'm not sure. Nicolas, would you be able to test this out again to see if that patch helped?
Comment 11 Nicolas Fella 2024-01-10 22:59:08 UTC
Still crashes
Comment 12 Arazil 2024-02-12 17:55:04 UTC
Created attachment 165784 [details]
GDB Backtrace - KNSCore::ResultStream::fetch SIGSEGV

I am able to reproduce this bug on Arch Linux with their packaging of KDE Plasma 6.0 RC2. This version of KDE is running on a configuration migrated from the latest 5.X Debian branch (e.g. we copied ".local" and ".config" from the old home directory to the new home directory).

To reproduce, I open "plasma-discover" and use the top left search box of Discover to search for anything. Discover will attempt to search for a few seconds before crashing.

This bug is not impacted by the presence of "PackageKit" or "fwupd" on the system (I tried it with and without the packages installed).
Comment 13 ichweissnix 2024-02-21 14:59:44 UTC
Created attachment 165975 [details]
crash when searching for libreoffice 2024 02 21

Still crashing...
I uploaded a new Log

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 6.0.80
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.5.0-18-generic (64-bit)
Graphics Platform: Wayland
Processors: 8 × 11th Gen Intel® Core™ i7-1165G7 @ 2.80GHz
Memory: 15.4 GiB of RAM
Graphics Processor: Mesa Intel® Xe Graphics
Manufacturer: LENOVO
Product Name: 82BJ
System Version: Yoga 7 15ITL5
Comment 14 Peter 2024-03-06 16:15:54 UTC
Happens for me when searching in Discover 6.0.0 for "Ada" , as well as for "Libreoffice", but not for most other search terms.
Comment 15 Nicolas Fella 2024-03-11 20:38:02 UTC
*** Bug 483177 has been marked as a duplicate of this bug. ***
Comment 16 Harald Sitter 2024-03-28 12:00:32 UTC
*** Bug 484658 has been marked as a duplicate of this bug. ***
Comment 17 Anthony Fieroni 2024-04-01 13:00:09 UTC
There are 2 different issues, one issue from ichweissnix@gmx.at is hitting assert
https://invent.kde.org/plasma/discover/-/blob/master/libdiscover/resources/ResourcesProxyModel.cpp#L639
Arazil issue is in KNSCore::ResultsStream::fetch d pointer is null
Comment 18 Waleed Hamra 2024-04-08 17:43:57 UTC
Is this crash still happening to other reporters?

I had a bug marked as a duplicate of this and for me, in 6.0.3 of Discover, my initial reproducible crashes are no longer happening.
Comment 19 Jonathan Isom 2024-04-08 23:15:38 UTC
(In reply to Waleed Hamra from comment #18)
> Is this crash still happening to other reporters?
> 
> I had a bug marked as a duplicate of this and for me, in 6.0.3 of Discover,
> my initial reproducible crashes are no longer happening.


I tested a week or 2 ago and it was crashing then. 

I just did a little test and it didn't crash now.  Definitely an improvement.
Comment 20 Arazil 2024-04-09 11:30:44 UTC
(In reply to Waleed Hamra from comment #18)
> Is this crash still happening to other reporters?
> 
> I had a bug marked as a duplicate of this and for me, in 6.0.3 of Discover,
> my initial reproducible crashes are no longer happening.

I am no longer able to reproduce the bug on Discover 6.0.3. It appears that the problem has been resolved.
Comment 21 Nate Graham 2024-04-09 15:48:28 UTC
Thanks for following up, everyone!