Bug 465315 - Discover crashed at idForComponent
Summary: Discover crashed at idForComponent
Status: RESOLVED WORKSFORME
Alias: None
Product: Discover
Classification: Applications
Component: Flatpak Backend (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2023-02-05 13:20 UTC by Fushan Wen
Modified: 2023-03-17 15:11 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fushan Wen 2023-02-05 13:20:55 UTC
Application: plasma-discover (5.27.80)

Qt Version: 5.15.8
Frameworks Version: 5.103.0
Operating System: Linux 6.1.8-1-default x86_64
Windowing System: X11
Distribution: "openSUSE Tumbleweed"
DrKonqi: 5.27.80 [KCrashBackend]

-- Information about the crash:
Open Discover and it crashes. I am using a 3rd-party Flatpak repositiory to accelerate downloads. Could it be related?

The crash can be reproduced every time.

-- Backtrace:
Application: Discover (plasma-discover), signal: Segmentation fault
Content of s_kcrashErrorMessage: std::unique_ptr<char []> = {get() = <optimized out>}
[KCrash Handler]
#6  QArrayData::data() (this=<optimized out>) at ../../include/QtCore/../../src/corelib/tools/qarraydata.h:62
#7  QTypedArrayData<unsigned short>::data() (this=<optimized out>) at ../../include/QtCore/../../src/corelib/tools/qarraydata.h:209
#8  QString::unicode() const (this=<optimized out>) at ../../include/QtCore/../../src/corelib/text/qstring.h:1080
#9  QStringRef::toString() const (this=0x558be0775158) at text/qstring.cpp:10773
#10 0x00007fbcb3f21374 in idForComponent(AppStream::Component const&) (component=...) at /usr/src/debug/discover-5.27.80git.20230130T011240~4293453/libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp:235
#11 0x00007fbcb3f28e23 in FlatpakBackend::getAppForInstalledRef(_FlatpakInstallation*, _FlatpakInstalledRef*, bool*) const (this=0x558bdf4f26d0, installation=<optimized out>, ref=0x558bdf56b980 [FlatpakInstalledRef], freshResource=0x7ffd6fc19c2f) at /usr/src/debug/discover-5.27.80git.20230130T011240~4293453/libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp:504
#12 0x00007fbcb3f36bbb in operator() (__closure=0x558bdf565600) at /usr/src/debug/discover-5.27.80git.20230130T011240~4293453/libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp:1421
#13 QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, FlatpakBackend::search(const AbstractResourcesBackend::Filters&)::<lambda()>::<lambda()> >::call (arg=<optimized out>, f=...) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:146
#14 QtPrivate::Functor<FlatpakBackend::search(const AbstractResourcesBackend::Filters&)::<lambda()>::<lambda()>, 0>::call<QtPrivate::List<>, void> (arg=<optimized out>, f=...) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:256
#15 QtPrivate::QFunctorSlotObject<FlatpakBackend::search(const AbstractResourcesBackend::Filters&)::<lambda()>::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=0x558bdf5655f0, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:443
#16 0x00007fbcf051338d in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffd6fc19d00, r=0x558bdf4f26d0, this=0x558bdf5655f0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#17 doActivate<false>(QObject*, int, void**) (sender=0x558bdf565650, signal_index=4, argv=0x7ffd6fc19d00) at kernel/qobject.cpp:3923
#18 0x00007fbcf050c80f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=<optimized out>, m=<optimized out>, local_signal_index=<optimized out>, argv=<optimized out>) at kernel/qobject.cpp:3983
#19 0x00007fbcf02ff8d5 in QFutureWatcherBase::event(QEvent*) (this=<optimized out>, event=0x7fbc9c013320) at thread/qfuturewatcher.cpp:334
#20 0x00007fbcf1fa544e in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x558bdf565650, e=0x7fbc9c013320) at kernel/qapplication.cpp:3640
#21 0x00007fbcf04dc1e8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x558bdf565650, event=0x7fbc9c013320) at kernel/qcoreapplication.cpp:1064
#22 0x00007fbcf04df181 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=0x0, event_type=0, data=0x558bdef7fbd0) at kernel/qcoreapplication.cpp:1821
#23 0x00007fbcf0534413 in postEventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x558bdf0740a0) at kernel/qeventdispatcher_glib.cpp:277
#24 0x00007fbceed1ba90 in g_main_dispatch (context=0x7fbce4005010) at ../glib/gmain.c:3454
#25 g_main_context_dispatch (context=context@entry=0x7fbce4005010) at ../glib/gmain.c:4172
#26 0x00007fbceed1be48 in g_main_context_iterate (context=context@entry=0x7fbce4005010, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4248
#27 0x00007fbceed1bedc in g_main_context_iteration (context=0x7fbce4005010, may_block=1) at ../glib/gmain.c:4313
#28 0x00007fbcf0533c16 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x558bdf07b530, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#29 0x00007fbcf04dac5b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffd6fc1a0b0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#30 0x00007fbcf04e2dc6 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#31 0x00007fbcf096ed3c in QGuiApplication::exec() () at kernel/qguiapplication.cpp:1870
#32 0x00007fbcf1fa53c5 in QApplication::exec() () at kernel/qapplication.cpp:2832
#33 0x0000558bdd4122a0 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/discover-5.27.80git.20230130T011240~4293453/discover/main.cpp:224
[Inferior 1 (process 20694) detached]

Reported using DrKonqi
Comment 1 Fushan Wen 2023-02-06 07:10:44 UTC
Changing the repository doesn't help
Comment 2 Aleix Pol 2023-03-16 15:53:02 UTC
Can you try adding this debug info? it could help me understand what could be going on there:

diff --git a/libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp b/libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp
index d6345e559..e98f992b0 100644
--- a/libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp
+++ b/libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp
@@ -229,6 +229,7 @@ static FlatpakResource::Id idForComponent(const AppStream::Component &component)
     // app/app.getspace.Space/x86_64/stable
     const auto bundleId = component.bundle(AppStream::Bundle::KindFlatpak).id();
     auto parts = bundleId.splitRef('/');
+    qDebug() << "helloooo" << bundleId << parts;
     Q_ASSERT(parts.size() == 4);
 
     return {
Comment 3 Fushan Wen 2023-03-17 15:11:39 UTC
After I updated apps manually using commands, the crash is gone. Will report again if Discover crashes again.