Bug 473613 - Crash when clicking on checkbox in "update" tab of Discover
Summary: Crash when clicking on checkbox in "update" tab of Discover
Status: RESOLVED FIXED
Alias: None
Product: Discover
Classification: Applications
Component: discover (show other bugs)
Version: unspecified
Platform: Neon Linux
: NOR crash
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: drkonqi, qt6
: 485007 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-08-21 21:40 UTC by Henning
Modified: 2024-07-09 18:37 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
New crash information added by DrKonqi (102.01 KB, text/plain)
2023-08-21 21:40 UTC, Henning
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Henning 2023-08-21 21:40:54 UTC
Application: plasma-discover (5.27.80)

Qt Version: 6.6.0
Frameworks Version: 5.240.0
Operating System: Linux 6.2.0-26-generic x86_64
Windowing System: X11
Distribution: KDE neon Unstable Edition
DrKonqi: 5.27.80 [CoredumpBackend]

-- Information about the crash:
Trying the Qt6 Version in Neon unstable. Discover seems to be the most unstable.

I go to the updates tab and its empty sometimes. But if there are the updates shown and I check the checkbox of the system updates, it crashes immediately.

The crash can be reproduced every time.

-- Backtrace (Reduced):
#6  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140354553180608) at ./nptl/pthread_kill.c:44
#7  __pthread_kill_internal (signo=6, threadid=140354553180608) at ./nptl/pthread_kill.c:78
#8  __GI___pthread_kill (threadid=140354553180608, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#9  0x00007fa6dba42476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#10 0x00007fa6dba287f3 in __GI_abort () at ./stdlib/abort.c:79


Reported using DrKonqi
Comment 1 Henning 2023-08-21 21:40:56 UTC
Created attachment 161097 [details]
New crash information added by DrKonqi

DrKonqi auto-attaching complete backtrace.
Comment 2 Nicolas Fella 2023-09-29 20:28:02 UTC
#6  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140354553180608) at ./nptl/pthread_kill.c:44
#7  __pthread_kill_internal (signo=6, threadid=140354553180608) at ./nptl/pthread_kill.c:78
#8  __GI___pthread_kill (threadid=140354553180608, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#9  0x00007fa6dba42476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#10 0x00007fa6dba287f3 in __GI_abort () at ./stdlib/abort.c:79
#11 0x00007fa6dc2b9172 in qAbort() () from /lib/x86_64-linux-gnu/libQt6Core.so.6
#12 0x00007fa6dc2ba0f7 in QMessageLogger::fatal(char const*, ...) const () from /lib/x86_64-linux-gnu/libQt6Core.so.6
#13 0x00007fa6dc2b90c3 in qt_assert(char const*, char const*, int) () from /lib/x86_64-linux-gnu/libQt6Core.so.6
#14 0x00007fa6de95e100 in ?? () from /usr/lib/x86_64-linux-gnu/plasma-discover/libDiscoverCommon.so
#15 0x00007fa6dc58e396 in QSortFilterProxyModel::setData(QModelIndex const&, QVariant const&, int) () from /lib/x86_64-linux-gnu/libQt6Core.so.6
#16 0x00007fa6db7915af in ?? () from /lib/x86_64-linux-gnu/libQt6QmlModels.so.6
#17 0x00007fa6db795f06 in ?? () from /lib/x86_64-linux-gnu/libQt6QmlModels.so.6
#18 0x00007fa6dd26d51b in ?? () from /lib/x86_64-linux-gnu/libQt6Qml.so.6
#19 0x00007fa6dd328813 in QQmlPropertyPrivate::write(QObject*, QQmlPropertyData const&, QVariant const&, QQmlRefPointer<QQmlContextData> const&, QFlags<QQmlPropertyData::WriteFlag>) () from /lib/x86_64-linux-gnu/libQt6Qml.so.6
#20 0x00007fa6dd1eb884 in QV4::QObjectWrapper::setProperty(QV4::ExecutionEngine*, QObject*, QQmlPropertyData const*, QV4::Value const&) () from /lib/x86_64-linux-gnu/libQt6Qml.so.6
#21 0x00007fa6dd1ebf5e in QV4::QObjectWrapper::setQmlProperty(QV4::ExecutionEngine*, QQmlRefPointer<QQmlContextData> const&, QObject*, QV4::String*, QFlags<QV4::QObjectWrapper::Flag>, QV4::Value const&) () from /lib/x86_64-linux-gnu/libQt6Qml.so.6
#22 0x00007fa6dd1ec198 in QV4::QObjectWrapper::virtualPut(QV4::Managed*, QV4::PropertyKey, QV4::Value const&, QV4::Value*) () from /lib/x86_64-linux-gnu/libQt6Qml.so.6
#23 0x00007fa6dd1d1a41 in QV4::Object::virtualResolveLookupSetter(QV4::Object*, QV4::ExecutionEngine*, QV4::Lookup*, QV4::Value const&) () from /lib/x86_64-linux-gnu/libQt6Qml.so.6
#24 0x00007fa6dd23cc60 in ?? () from /lib/x86_64-linux-gnu/libQt6Qml.so.6
#25 0x00007fa6dd23fb05 in ?? () from /lib/x86_64-linux-gnu/libQt6Qml.so.6
#26 0x00007fa6dd1b101a in ?? () from /lib/x86_64-linux-gnu/libQt6Qml.so.6
#27 0x00007fa6dd1b3edb in QV4::Function::call(QObject*, void**, QMetaType const*, int, QV4::ExecutionContext*) () from /lib/x86_64-linux-gnu/libQt6Qml.so.6
#28 0x00007fa6dd2f296e in QQmlJavaScriptExpression::evaluate(void**, QMetaType const*, int) () from /lib/x86_64-linux-gnu/libQt6Qml.so.6
#29 0x00007fa6dd28477b in QQmlBoundSignalExpression::evaluate(void**) () from /lib/x86_64-linux-gnu/libQt6Qml.so.6
#30 0x00007fa6dd289a5b in ?? () from /lib/x86_64-linux-gnu/libQt6Qml.so.6
#31 0x00007fa6dd30f085 in QQmlNotifier::emitNotify(QQmlNotifierEndpoint*, void**) () from /lib/x86_64-linux-gnu/libQt6Qml.so.6
#32 0x00007fa6dc3b0478 in ?? () from /lib/x86_64-linux-gnu/libQt6Core.so.6
#33 0x00007fa6d50d8849 in QQuickAbstractButtonPrivate::handleRelease(QPointF const&, unsigned long) () from /lib/x86_64-linux-gnu/libQt6QuickTemplates2.so.6
#34 0x00007fa6d50f0edd in QQuickControl::mouseReleaseEvent(QMouseEvent*) () from /lib/x86_64-linux-gnu/libQt6QuickTemplates2.so.6
#35 0x00007fa6dd9ebca1 in QQuickItem::event(QEvent*) () from /lib/x86_64-linux-gnu/libQt6Quick.so.6
#36 0x00007fa6de189596 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt6Widgets.so.6
#37 0x00007fa6dc35a128 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt6Core.so.6
#38 0x00007fa6ddb4956b in QQuickDeliveryAgentPrivate::deliverMatchingPointsToItem(QQuickItem*, bool, QPointerEvent*, bool) () from /lib/x86_64-linux-gnu/libQt6Quick.so.6
#39 0x00007fa6ddb49c26 in QQuickDeliveryAgentPrivate::deliverUpdatedPoints(QPointerEvent*) () from /lib/x86_64-linux-gnu/libQt6Quick.so.6
#40 0x00007fa6ddb4b44b in QQuickDeliveryAgentPrivate::deliverPointerEvent(QPointerEvent*) () from /lib/x86_64-linux-gnu/libQt6Quick.so.6
#41 0x00007fa6ddb4b804 in QQuickDeliveryAgentPrivate::handleMouseEvent(QMouseEvent*) () from /lib/x86_64-linux-gnu/libQt6Quick.so.6
#42 0x00007fa6ddb40cde in QQuickDeliveryAgent::event(QEvent*) () from /lib/x86_64-linux-gnu/libQt6Quick.so.6
#43 0x00007fa6dda85254 in QQuickWindow::event(QEvent*) () from /lib/x86_64-linux-gnu/libQt6Quick.so.6
#44 0x00007fa6de189596 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt6Widgets.so.6
#45 0x00007fa6dc35a128 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt6Core.so.6
#46 0x00007fa6dc9b85e0 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () from /lib/x86_64-linux-gnu/libQt6Gui.so.6
#47 0x00007fa6dca0ef5c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt6Gui.so.6
#48 0x00007fa6d6da05ae in ?? () from /lib/x86_64-linux-gnu/libQt6XcbQpa.so.6
#49 0x00007fa6db444d3b in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#50 0x00007fa6db49a258 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#51 0x00007fa6db4423e3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#52 0x00007fa6dc5b57fe in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt6Core.so.6
#53 0x00007fa6dc366df3 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt6Core.so.6
#54 0x00007fa6dc362d06 in QCoreApplication::exec() () from /lib/x86_64-linux-gnu/libQt6Core.so.6
#55 0x0000561a03b1f575 in ?? ()
#56 0x00007fa6dba29d90 in __libc_start_call_main (main=main@entry=0x561a03b1d630, argc=argc@entry=1, argv=argv@entry=0x7ffc9c009cf8) at ../sysdeps/nptl/libc_start_call_main.h:58
#57 0x00007fa6dba29e40 in __libc_start_main_impl (main=0x561a03b1d630, argc=1, argv=0x7ffc9c009cf8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffc9c009ce8) at ../csu/libc-start.c:392
#58 0x0000561a03b20815 in ?? ()
Comment 3 Nate Graham 2023-10-19 18:16:20 UTC
I can't reproduce this. Are you still able to with today's git master from Neon Unstable?
Comment 4 Henning 2023-10-19 20:24:49 UTC
not able to reproduce this, a lot has changed.
Comment 5 Henning 2023-10-19 21:28:50 UTC
uhm, its not crashing in that case, but crashing nonetheless. Using CLI worked again, Discover crashed.

Poorly I have no log
Comment 6 Nate Graham 2023-10-19 21:33:45 UTC
Please submit new bug reports for new issues, and also attach a backtrace of the crash, or else it's useless and we can't do anything with it.
Comment 7 Nate Graham 2023-10-20 14:04:41 UTC
David Redondo was able to reproduce this; seems like a Qt 6.6 only issue.
Comment 8 David Redondo 2023-10-23 10:53:14 UTC
So we assert on checking the checked item

checkResources(apps, newValue);
Q_ASSERT(idx.data(Qt::CheckStateRole) == value);

checking an Item in packagekitbackend and see the check status are implemented in the PackageKitBackend as

void PackageKitUpdater::addResources(const QList<AbstractResource *> &apps)
{
    const QSet<QString> pkgs = involvedPackages(kToSet(apps));
    m_toUpgrade.unite(packagesForPackageId(pkgs));
}

bool PackageKitUpdater::isMarked(AbstractResource *res) const
{
    return m_toUpgrade.contains(res);
}


the problem is that packagesForPackageId returns empty because it looks through m_allUpgradeable whichis assigned in PackageKitUpdater::prepare()    

 const auto candidates = m_backend->upgradeablePackages();

the problem is 

QSet<AbstractResource *> PackageKitBackend::upgradeablePackages() const
{
    if (isFetching() || !m_packagesToAdd.isEmpty()) {
        return {};
    }

    QSet<AbstractResource *> ret;
    ret.reserve(m_updatesPackageId.size());
    for (const QString &pkgid : std::as_const(m_updatesPackageId)) {
        const QString pkgname = PackageKit::Daemon::packageName(pkgid);
        const auto pkgs = resourcesByPackageName(pkgname);
        if (pkgs.isEmpty()) {
            qWarning() << "PackageKitBackend: Couldn't find resource for" << pkgid;
        }
        ret.unite(pkgs);
    }
    return kFilter<QSet<AbstractResource *>>(ret, [](AbstractResource *res) {
        return !static_cast<PackageKitResource *>(res)->extendsItself();
    });
}


resourcesByPackageName can modify m_packagesToAdd so a second call to it returns an empty set.
Comment 9 Bug Janitor Service 2023-10-27 00:35:57 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/discover/-/merge_requests/681
Comment 10 Aleix Pol 2023-10-27 11:59:04 UTC
Git commit 6a79cfd42842814b85430ca2a72ef57f605b1df3 by Aleix Pol Gonzalez, on behalf of Aleix Pol.
Committed on 27/10/2023 at 13:57.
Pushed by apol into branch 'master'.

packagekit: Don't mark to add packages that are already there

This was a regression from c0dd9fa73744bb2ad02af6daa60c0e5ec230c16a.

M  +0    -1    libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp

https://invent.kde.org/plasma/discover/-/commit/6a79cfd42842814b85430ca2a72ef57f605b1df3
Comment 11 TraceyC 2024-07-09 18:37:13 UTC
*** Bug 485007 has been marked as a duplicate of this bug. ***