Bug 466442

Summary: Searching terms like "video", "audio", "game", "torrent", etc crashes discover in AggregatedResultsStream::emitResults()
Product: [Applications] Discover Reporter: rosh2060an
Component: discoverAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: aleixpol, madLyfe, nate, p.r.worrall, sitter
Priority: NOR    
Version First Reported In: 5.27.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.27.2
Sentry Crash Report:

Description rosh2060an 2023-02-26 01:41:48 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***
Searching for certain application name doesn't crash discover. I tired by searching "firefox", "telegram", "ktorrent" and "video downloader" and these don't crash discover. And same goes for when searching some random words, searching random words doesn't crash discover either. So, I guess when using search terms that have many related applications, Discover crashes.

STEPS TO REPRODUCE
1. Open discover.
2. Search using terms like "video", "audio", "game", "torrent", "download" etc
3. 

OBSERVED RESULT
Discover closes, and I get a notification that says "Discover closed unexpectedly".
 
EXPECTED RESULT
Show apps related to those search terms.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Fedora Linux 37
(available in About System)
KDE Plasma Version: 5.27.1
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
Comment 1 Paul Worrall 2023-02-26 13:09:29 UTC
I can't reproduce on Neon User with the same plasma version etc. Can you attach a backtrace as described in the document linked in the summary section?
Comment 2 rosh2060an 2023-02-26 14:09:14 UTC
(In reply to Paul Worrall from comment #1)
> I can't reproduce on Neon User with the same plasma version etc. Can you
> attach a backtrace as described in the document linked in the summary
> section?

This can be reproduced on my system and  when I tried to create backtrace using Dr Konqi, I get this message: 
The generated crash information is not useful.
"The crash information could not be generated."

It's my first time reporting bugs so I don't know anything. Since, backtrace couldn't be generated, are there any other methods? like sharing log file or something? If I can share some log files or anything please tell me how can I do that.
Comment 3 Paul Worrall 2023-02-28 08:33:12 UTC
Sorry, I don't know how to create backtraces on Fedora.  Setting the status back to REPORTED, maybe someone else can help.
Comment 4 rosh2060an 2023-02-28 10:21:09 UTC
(In reply to Paul Worrall from comment #3)
> Sorry, I don't know how to create backtraces on Fedora.  Setting the status
> back to REPORTED, maybe someone else can help.

Launching from terminal gives this error:
https://pastebin.com/3PNeCb8u
maybe this is helpful??

I also made a post on reddit and tried this(https://www.reddit.com/r/Fedora/comments/11cztzf/comment/jabhj2k/?context=3) but I got nothing.
Comment 5 rosh2060an 2023-02-28 10:45:58 UTC
I just checked this in live desktop of fedora and I didn't experience any issues so maybe this is the problem specific to my system?
Comment 6 Nate Graham 2023-02-28 22:15:04 UTC
Hmm, fedora should have debuginfod set up so that debug packages are automatically downloaded as needed. This is working for me FWIW.

We can try to do it manually. See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports#Retrieving_a_backtrace_using_coredumpctl.

Once you get to the step where you type, "bt", let me know if you get clear and obvious output in your terminal window that it's downloading debug packages. If this works, it's a sign that automatic debug package downloading isn't working in the GUI crash reporting wizard for you. Thanks!
Comment 7 rosh2060an 2023-03-01 05:07:27 UTC
(In reply to Nate Graham from comment #6)
> Hmm, fedora should have debuginfod set up so that debug packages are
> automatically downloaded as needed. This is working for me FWIW.
> 
> We can try to do it manually. See
> https://community.kde.org/Guidelines_and_HOWTOs/Debugging/
> How_to_create_useful_crash_reports#Retrieving_a_backtrace_using_coredumpctl.
> 
> Once you get to the step where you type, "bt", let me know if you get clear
> and obvious output in your terminal window that it's downloading debug
> packages. If this works, it's a sign that automatic debug package
> downloading isn't working in the GUI crash reporting wizard for you. Thanks!

I used this gdb thing, downloaded some stuffs it told me to download and its(https://pastebin.com/eDGg46n9) the output. It's everything I got in terminal. It's (https://pastebin.com/8TJJ7BzQ) the "bt" part. This time when I launched discover using gdb plasma-discover and searched "firefox" everything was fine as expected but when I searched those crashing term like "game" or "video" instead of closing discover like it used to, it froze discover. 

I hope it is useful. I don't know about these things so it's confusing for me. I will try my best to make a proper bug report. Thanks.
Comment 8 Nate Graham 2023-03-01 15:25:10 UTC
Ok, we're getting somewhere now! Thanks.

#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007ffff54afec3 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007ffff545fa76 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007ffff54497fc in __GI_abort () at abort.c:79
#4  0x00007ffff7e90d3c in std::__throw_bad_variant_access (__what=<synthetic pointer>) at /usr/include/c++/12/variant:1324
#5  std::__throw_bad_variant_access (__valueless=<optimized out>) at /usr/include/c++/12/variant:1330
#6  0x00007ffff7e90dc9 in std::get<0ul, QString, QVector<CategoryFilter> > (__v=..., __v=...) at /usr/include/c++/12/variant:1711
#7  std::get<QString, QString, QVector<CategoryFilter> > (__v=..., __v=...) at /usr/include/c++/12/variant:1149
#8  shouldFilter (res=0x7fffffffd150, filter=...) at /usr/src/debug/plasma-discover-5.27.1-2.fc37.x86_64/libdiscover/resources/AbstractResource.cpp:159
#9  0x00005555587e2140 in ?? ()
#10 0x000055555ac00640 in ?? ()
#11 0x00007ffff5cedf05 in qt_clock_gettime (ts=0x7fffffffd160, clock=1) at kernel/qelapsedtimer_unix.cpp:111
#12 do_gettime (frac=<synthetic pointer>, sec=<synthetic pointer>) at kernel/qelapsedtimer_unix.cpp:166
#13 qt_gettime () at kernel/qelapsedtimer_unix.cpp:175
#14 0x00007ffff7ede70f in ?? () from /usr/lib64/plasma-discover/libDiscoverCommon.so
#15 0x0000000000000064 in ?? ()
#16 0x17df1a1b0518aa00 in ?? ()
#17 0x0000555559d3efa0 in ?? ()
#18 0x00007fffffffd208 in ?? ()
#19 0x0000555556585d60 in ?? ()
#20 0x0000000000000003 in ?? ()
#21 0x000055555946f970 in ?? ()
#22 0x00007fffffffd280 in ?? ()
#23 0x000055555946f940 in ?? ()
#24 0x00007ffff7eb831b in ResourcesProxyModel::sortedInsertion (this=0x555555a2d650, this@entry=0x555556585d60, _res=...)
    at /usr/src/debug/plasma-discover-5.27.1-2.fc37.x86_64/libdiscover/resources/ResourcesProxyModel.cpp:572
#25 0x00007ffff7eba213 in ResourcesProxyModel::addResources (this=0x555556585d60, _res=...)
    at /usr/src/debug/plasma-discover-5.27.1-2.fc37.x86_64/libdiscover/resources/ResourcesProxyModel.cpp:233
#26 0x00007ffff5cd0e96 in QtPrivate::QSlotObjectBase::call (a=0x7fffffffd3a0, r=<optimized out>, this=0x55555946f940)
    at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#27 doActivate<false> (sender=0x555559d3ef80, signal_index=3, argv=0x7fffffffd3a0) at kernel/qobject.cpp:3923
#28 0x00007ffff5ccbe27 in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7ffff7ef2b60 <ResultsStream::staticMetaObject>, local_signal_index=local_signal_index@entry=0, 
    argv=argv@entry=0x7fffffffd3a0) at kernel/qobject.cpp:3983
#29 0x00007ffff7e92806 in ResultsStream::resourcesFound (this=<optimized out>, _t1=...)
    at /usr/src/debug/plasma-discover-5.27.1-2.fc37.x86_64/redhat-linux-build/libdiscover/DiscoverCommon_autogen/3YJK5W5UP7/moc_AbstractResourcesBackend.cpp:159
#30 0x00007ffff7eb1bbc in AggregatedResultsStream::emitResults (this=0x555559d3ef80) at /usr/src/debug/plasma-discover-5.27.1-2.fc37.x86_64/libdiscover/resources/ResourcesModel.cpp:339
#31 0x00007ffff5cd0e96 in QtPrivate::QSlotObjectBase::call (a=0x7fffffffd4d0, r=<optimized out>, this=0x55555946f4c0)
    at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#32 doActivate<false> (sender=0x555559d3efa0, signal_index=3, argv=0x7fffffffd4d0) at kernel/qobject.cpp:3923

Unfortunately it's still missing a lot for some reason, but we can work with this for a start.
Comment 9 rosh2060an 2023-03-01 15:46:26 UTC
(In reply to Nate Graham from comment #8)
> Ok, we're getting somewhere now! Thanks.
> 
> #0  __pthread_kill_implementation (threadid=<optimized out>,
> signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
> #1  0x00007ffff54afec3 in __pthread_kill_internal (signo=6,
> threadid=<optimized out>) at pthread_kill.c:78
> #2  0x00007ffff545fa76 in __GI_raise (sig=sig@entry=6) at
> ../sysdeps/posix/raise.c:26
> #3  0x00007ffff54497fc in __GI_abort () at abort.c:79
> #4  0x00007ffff7e90d3c in std::__throw_bad_variant_access (__what=<synthetic
> pointer>) at /usr/include/c++/12/variant:1324
> #5  std::__throw_bad_variant_access (__valueless=<optimized out>) at
> /usr/include/c++/12/variant:1330
> #6  0x00007ffff7e90dc9 in std::get<0ul, QString, QVector<CategoryFilter> >
> (__v=..., __v=...) at /usr/include/c++/12/variant:1711
> #7  std::get<QString, QString, QVector<CategoryFilter> > (__v=..., __v=...)
> at /usr/include/c++/12/variant:1149
> #8  shouldFilter (res=0x7fffffffd150, filter=...) at
> /usr/src/debug/plasma-discover-5.27.1-2.fc37.x86_64/libdiscover/resources/
> AbstractResource.cpp:159
> #9  0x00005555587e2140 in ?? ()
> #10 0x000055555ac00640 in ?? ()
> #11 0x00007ffff5cedf05 in qt_clock_gettime (ts=0x7fffffffd160, clock=1) at
> kernel/qelapsedtimer_unix.cpp:111
> #12 do_gettime (frac=<synthetic pointer>, sec=<synthetic pointer>) at
> kernel/qelapsedtimer_unix.cpp:166
> #13 qt_gettime () at kernel/qelapsedtimer_unix.cpp:175
> #14 0x00007ffff7ede70f in ?? () from
> /usr/lib64/plasma-discover/libDiscoverCommon.so
> #15 0x0000000000000064 in ?? ()
> #16 0x17df1a1b0518aa00 in ?? ()
> #17 0x0000555559d3efa0 in ?? ()
> #18 0x00007fffffffd208 in ?? ()
> #19 0x0000555556585d60 in ?? ()
> #20 0x0000000000000003 in ?? ()
> #21 0x000055555946f970 in ?? ()
> #22 0x00007fffffffd280 in ?? ()
> #23 0x000055555946f940 in ?? ()
> #24 0x00007ffff7eb831b in ResourcesProxyModel::sortedInsertion
> (this=0x555555a2d650, this@entry=0x555556585d60, _res=...)
>     at
> /usr/src/debug/plasma-discover-5.27.1-2.fc37.x86_64/libdiscover/resources/
> ResourcesProxyModel.cpp:572
> #25 0x00007ffff7eba213 in ResourcesProxyModel::addResources
> (this=0x555556585d60, _res=...)
>     at
> /usr/src/debug/plasma-discover-5.27.1-2.fc37.x86_64/libdiscover/resources/
> ResourcesProxyModel.cpp:233
> #26 0x00007ffff5cd0e96 in QtPrivate::QSlotObjectBase::call
> (a=0x7fffffffd3a0, r=<optimized out>, this=0x55555946f940)
>     at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
> #27 doActivate<false> (sender=0x555559d3ef80, signal_index=3,
> argv=0x7fffffffd3a0) at kernel/qobject.cpp:3923
> #28 0x00007ffff5ccbe27 in QMetaObject::activate (sender=<optimized out>,
> m=m@entry=0x7ffff7ef2b60 <ResultsStream::staticMetaObject>,
> local_signal_index=local_signal_index@entry=0, 
>     argv=argv@entry=0x7fffffffd3a0) at kernel/qobject.cpp:3983
> #29 0x00007ffff7e92806 in ResultsStream::resourcesFound (this=<optimized
> out>, _t1=...)
>     at
> /usr/src/debug/plasma-discover-5.27.1-2.fc37.x86_64/redhat-linux-build/
> libdiscover/DiscoverCommon_autogen/3YJK5W5UP7/moc_AbstractResourcesBackend.
> cpp:159
> #30 0x00007ffff7eb1bbc in AggregatedResultsStream::emitResults
> (this=0x555559d3ef80) at
> /usr/src/debug/plasma-discover-5.27.1-2.fc37.x86_64/libdiscover/resources/
> ResourcesModel.cpp:339
> #31 0x00007ffff5cd0e96 in QtPrivate::QSlotObjectBase::call
> (a=0x7fffffffd4d0, r=<optimized out>, this=0x55555946f4c0)
>     at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
> #32 doActivate<false> (sender=0x555559d3efa0, signal_index=3,
> argv=0x7fffffffd4d0) at kernel/qobject.cpp:3923
> 
> Unfortunately it's still missing a lot for some reason, but we can work with
> this for a start.

I will try my best to help you guys. If there is any other way to find more info please inform me. And also I forgot to mention that, discover crashes for me if I open it when there is no internet connection. Should I make a different bug report for that one?
Comment 10 Nate Graham 2023-03-01 15:57:05 UTC
Yes please.
Comment 11 kinghat 2023-03-01 18:09:34 UTC
adding what ive found. lmk if there is anything else you will like me to do:

$ gdb plasma-discover
GNU gdb (GDB) Fedora Linux 12.1-7.fc37
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.
 
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from plasma-discover...
Reading symbols from /usr/lib/debug/usr/bin/plasma-discover-5.27.1-2.fc37.x86_64.debug...
(gdb) r
Starting program: /usr/bin/plasma-discover
 
This GDB supports auto-downloading debuginfo from the following URLs:
https://debuginfod.fedoraproject.org/
Enable debuginfod for this session? (y or [n]) y
Debuginfod has been enabled.
To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffe3ca46c0 (LWP 333642)]
QSocketNotifier: Can only be used with threads started with QThread
[New Thread 0x7fffe29f46c0 (LWP 333644)]
[New Thread 0x7fffe21f36c0 (LWP 333645)]
[New Thread 0x7fffe16306c0 (LWP 333653)]
[New Thread 0x7fffe0e2f6c0 (LWP 333654)]
[New Thread 0x7fffcb9ff6c0 (LWP 333655)]
[New Thread 0x7fffcb1fe6c0 (LWP 333656)]
[New Thread 0x7fffca9fd6c0 (LWP 333657)]
[New Thread 0x7fffca1fc6c0 (LWP 333658)]
[Thread 0x7fffca1fc6c0 (LWP 333658) exited]
[Thread 0x7fffca9fd6c0 (LWP 333657) exited]
[New Thread 0x7fffca9fd6c0 (LWP 333660)]
[New Thread 0x7fffca1fc6c0 (LWP 333661)]
[New Thread 0x7fffc89ff6c0 (LWP 333662)]
[New Thread 0x7fffa31ff6c0 (LWP 333670)]
[New Thread 0x7fffa29fe6c0 (LWP 333671)]
[New Thread 0x7fffa21fd6c0 (LWP 333672)]
[New Thread 0x7fffa19fc6c0 (LWP 333673)]
[New Thread 0x7fffa114f6c0 (LWP 333674)]
[New Thread 0x7fff8bfff6c0 (LWP 333675)]
adding empty sources model QStandardItemModel(0x5555559a4f60)
[New Thread 0x7fff8b7fe6c0 (LWP 333676)]
[New Thread 0x7fff891ff6c0 (LWP 333677)]
[New Thread 0x7fff7adff6c0 (LWP 333687)]
[New Thread 0x7fff7a5fe6c0 (LWP 333688)]
[New Thread 0x7fff79dfd6c0 (LWP 333689)]
[Detaching after fork from child process 333699]
[New Thread 0x7fff6afff6c0 (LWP 333701)]
[New Thread 0x7fff6a7fe6c0 (LWP 333703)]
[Thread 0x7fff6a7fe6c0 (LWP 333703) exited]
[New Thread 0x7fff6a7fe6c0 (LWP 333706)]
[New Thread 0x7fff699ff6c0 (LWP 333707)]
[New Thread 0x7fff691fe6c0 (LWP 333708)]
[New Thread 0x7fff578ff6c0 (LWP 333711)]
[New Thread 0x7fff570fe6c0 (LWP 333712)]
[Thread 0x7fff570fe6c0 (LWP 333712) exited]
packagekitqt.transaction: Unknown Transaction property: "Sender" QVariant(QString, ":1.1024")
[New Thread 0x7fff570fe6c0 (LWP 333714)]
file:///usr/lib64/qt5/qml/org/kde/kirigami.2/ScrollablePage.qml:200:9: QML MouseArea: Binding loop detected for property "implicitHeight"
file:///usr/lib64/qt5/qml/org/kde/kirigami.2/ScrollablePage.qml:200:9: QML MouseArea: Binding loop detected for property "implicitHeight"
file:///usr/lib64/qt5/qml/org/kde/kirigami.2/ScrollablePage.qml:200:9: QML MouseArea: Binding loop detected for property "implicitHeight"
file:///usr/lib64/qt5/qml/org/kde/kirigami.2/ScrollablePage.qml:200:9: QML MouseArea: Binding loop detected for property "implicitHeight"
file:///usr/lib64/qt5/qml/org/kde/kirigami.2/ScrollablePage.qml:200:9: QML MouseArea: Binding loop detected for property "implicitHeight"
[Thread 0x7fffa19fc6c0 (LWP 333673) exited]
[New Thread 0x7fffa19fc6c0 (LWP 333716)]
[New Thread 0x7fff568fd6c0 (LWP 333731)]
[Thread 0x7fff568fd6c0 (LWP 333731) exited]
packagekitqt.transaction: Unknown Transaction property: "Sender" QVariant(QString, ":1.1024")
packagekitqt.transaction: Unknown Transaction property: "Sender" QVariant(QString, ":1.1024")
Qt Quick Layouts: Detected recursive rearrange. Aborting after two iterations.
Qt Quick Layouts: Detected recursive rearrange. Aborting after two iterations.
[New Thread 0x7fff568fd6c0 (LWP 333774)]
org.kde.plasma.libdiscover: We should have sanitized the displayed resources. There is a bug
 
Thread 1 "plasma-discover" received signal SIGABRT, Aborted.
__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
44            return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0;
(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007ffff54afec3 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007ffff545fa76 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007ffff54497fc in __GI_abort () at abort.c:79
#4  0x00007ffff7e93d3c in std::__throw_bad_variant_access (__what=<synthetic pointer>) at /usr/include/c++/12/variant:1324
#5  std::__throw_bad_variant_access (__valueless=<optimized out>) at /usr/include/c++/12/variant:1330
#6  0x00007ffff7e93dc9 in std::get<0ul, QString, QVector<CategoryFilter> > (__v=..., __v=...) at /usr/include/c++/12/variant:1711
#7  std::get<QString, QString, QVector<CategoryFilter> > (__v=..., __v=...) at /usr/include/c++/12/variant:1149
#8  shouldFilter (res=0x7fffffffd130, filter=...) at /usr/src/debug/plasma-discover-5.27.1-2.fc37.x86_64/libdiscover/resources/AbstractResource.cpp:159
#9  0x000055555900fc50 in ?? ()
#10 0x0000555556160530 in ?? ()
#11 0x00000000000000c8 in ?? ()
#12 0x000055555ab7ce00 in ?? ()
#13 0x7dd9798e1d53d300 in ?? ()
#14 0x0000000000000002 in ?? ()
#15 0x0000000000000000 in ?? ()
(gdb)
Comment 12 Harald Sitter 2024-05-08 06:34:20 UTC
I don't suppose this is reproducible on 6.x?
Comment 13 rosh2060an 2024-05-08 13:39:21 UTC
(In reply to Harald Sitter from comment #12)
> I don't suppose this is reproducible on 6.x?

No it is not reproducible on 6.x. 
Actually it was fixed in 5.27.2. I'm sorry that I forgot to update the status to "fixed".
I update the status to "fixed" now. I'm so sorry  again for wasting your time.
Comment 14 Harald Sitter 2024-05-08 13:41:58 UTC
No worries. Glad it's fixed :)