Bug 474402 - drkonqi-pk-debug-installer crashes in libappstreamqt
Summary: drkonqi-pk-debug-installer crashes in libappstreamqt
Status: REPORTED
Alias: None
Product: neon
Classification: KDE Neon
Component: general (show other bugs)
Version: unspecified
Platform: Neon Linux
: NOR crash
Target Milestone: ---
Assignee: Neon Bugs
URL: https://github.com/ximion/appstream/i...
Keywords:
: 490627 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-09-11 11:28 UTC by Malte S. Stretz
Modified: 2024-09-13 07:55 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Malte S. Stretz 2023-09-11 11:28:31 UTC
SUMMARY

I tried to report a crash in the Calamares installer from the Neon Live ISO 20230907-0716 which resulted in some yak shaving because pulling the debug symbols didn't work either. After some debugging (see also 474295) I found out that /usr/bin/drkonqi-pk-debug-installer crashes.

I first thought the root cause was 473017 but that one is tagged qt6 and the backtrace (cf. below) looks different (after I manually installed all the required dbgsyms).

STEPS TO REPRODUCE
1. Start Neon Live ISO
2. Open Konsole
3. Execute sudo /usr/bin/drkonqi-pk-debug-installer /usr/bin/drkonqi-pk-debug-installer # yes, twice, it also fails to pull its own debug symbols

This is still reproducible after an apt full-upgrade which installed some rebuilt Qt and Appstream libraries.


OBSERVED RESULT
"An error was encountered during the installation of the debug symbol packages"

EXPECTED RESULT
Installed debug symbols.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Neon User Live 20230907-0716
(available in About System)
KDE Plasma Version: 5.27.7
KDE Frameworks Version: 5.109.0
Qt Version: 5.15.10

ADDITIONAL INFORMATION

Application: drkonqi-pk-debug-installer (drkonqi-pk-debug-installer), signal: Segmentation fault

[KCrash Handler]
#4  0x00007fb701fc640e in AppStream::Component::toString (this=this@entry=0x0) at ../qt/component.cpp:731
#5  0x0000556d4755054e in DebugRepoEnabler::run (this=0x7ffd007f12e0) at ./src/DebugRepoEnabler.cpp:43
#6  0x0000556d475519a3 in DebugRepoEnabler::qt_metacall (this=0x7ffd007f12e0, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0x7ffd007eee20) at ./obj-x86_64-linux-gnu/src/drkonqi-pk-debug-installer_autogen/EWIEGA46WW/moc_DebugRepoEnabler.cpp:212
#7  0x00007fb701702cd5 in QQmlObjectOrGadget::metacall (this=this@entry=0x7ffd007ef060, type=type@entry=QMetaObject::InvokeMetaMethod, index=<optimized out>, argv=argv@entry=0x7ffd007eee20) at qml/qqmlobjectorgadget.cpp:51
#8  0x00007fb7015db86e in CallMethod (callType=QMetaObject::InvokeMetaMethod, callArgs=0x7fb6e41bf580, engine=0x556d490d48e0, argTypes=0x0, argCount=0, returnType=43, index=<optimized out>, object=...) at jsruntime/qv4qobjectwrapper.cpp:1303
#9  CallPrecise (object=..., data=..., engine=engine@entry=0x556d490d48e0, callArgs=callArgs@entry=0x7fb6e41bf580, callType=callType@entry=QMetaObject::InvokeMetaMethod) at jsruntime/qv4qobjectwrapper.cpp:1557
#10 0x00007fb7015dec0a in CallOverloaded (callType=<optimized out>, propertyCache=<optimized out>, callArgs=<optimized out>, engine=<optimized out>, data=..., object=...) at jsruntime/qv4qobjectwrapper.cpp:1629
#11 QV4::QObjectMethod::callInternal (this=<optimized out>, thisObject=<optimized out>, argv=<optimized out>, argc=<optimized out>) at jsruntime/qv4qobjectwrapper.cpp:2117
#12 0x00007fb7015fc253 in QV4::FunctionObject::call (argc=<optimized out>, argv=<optimized out>, thisObject=<optimized out>, this=<optimized out>) at ../../include/QtQml/5.15.10/QtQml/private/../../../../../src/qml/jsruntime/qv4functionobject_p.h:202
#13 QV4::Moth::VME::interpret (frame=0x7ffd007ef320, engine=0x556d490d48e0, code=0x7fb6e41bf538 "@\336\311\317\266\177") at jsruntime/qv4vme_moth.cpp:757
#14 0x00007fb7015fef5f in QV4::Moth::VME::exec (frame=frame@entry=0x7ffd007ef320, engine=engine@entry=0x556d490d48e0) at jsruntime/qv4vme_moth.cpp:466
#15 0x00007fb701590e3e in QV4::Function::call (this=this@entry=0x556d4920e050, thisObject=<optimized out>, argv=argv@entry=0x7fb6e41bf500, argc=<optimized out>, context=<optimized out>) at jsruntime/qv4function.cpp:69
#16 0x00007fb70171db15 in QQmlJavaScriptExpression::evaluate (this=this@entry=0x556d4932fd90, callData=callData@entry=0x7fb6e41bf4d0, isUndefined=isUndefined@entry=0x0) at qml/qqmljavascriptexpression.cpp:212
#17 0x00007fb7016ce55b in QQmlBoundSignalExpression::evaluate (this=<optimized out>, a=<optimized out>) at ../../include/QtQml/5.15.10/QtQml/private/../../../../../src/qml/jsruntime/qv4jscall_p.h:95
#18 0x00007fb7016cfc98 in QQmlBoundSignal_callback (e=0x556d4938bb20, a=0x0) at ../../include/QtQml/5.15.10/QtQml/private/../../../../../src/qml/qml/qqmlboundsignalexpressionpointer_p.h:69
#19 0x00007fb701702785 in QQmlNotifier::emitNotify (endpoint=<optimized out>, a=0x0) at qml/qqmlnotifier.cpp:104
#20 0x00007fb7010b84ab in doActivate<false> (sender=0x556d49304970, signal_index=3, argv=0x0) at kernel/qobject.cpp:3817
#21 0x00007fb7010b19f7 in QMetaObject::activate (sender=sender@entry=0x556d49304970, m=m@entry=0x7fb7018b4cc0 <QQmlComponentAttached::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x0) at kernel/qobject.cpp:3985
#22 0x00007fb7016c0f84 in QQmlComponentAttached::completed (this=this@entry=0x556d49304970) at .moc/moc_qqmlcomponentattached_p.cpp:148
#23 0x00007fb701733cfc in QQmlObjectCreator::finalize (this=0x556d490cfaa0, interrupt=...) at qml/qqmlobjectcreator.cpp:1441
#24 0x00007fb7016c212c in QQmlComponentPrivate::complete (state=0x556d490c4eb8, enginePriv=0x556d490ae180) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qscopedpointer.h:116
#25 QQmlComponentPrivate::complete (enginePriv=0x556d490ae180, state=0x556d490c4eb8) at qml/qqmlcomponent.cpp:996
#26 0x00007fb7016c46d9 in QQmlComponentPrivate::completeCreate (this=0x556d490c4e30) at qml/qqmlcomponent.cpp:1092
#27 0x00007fb7016c4873 in QQmlComponent::completeCreate (this=0x556d4920df10) at qml/qqmlcomponent.cpp:1079
#28 QQmlComponent::create (this=0x556d4920df10, context=<optimized out>) at qml/qqmlcomponent.cpp:825
#29 0x00007fb7017296c9 in QQmlApplicationEnginePrivate::finishLoad (this=0x556d490ae180, c=0x556d4920df10) at qml/qqmlapplicationengine.cpp:148
#30 0x00007fb701729d4c in QQmlApplicationEnginePrivate::startLoad (this=<optimized out>, url=..., data=..., dataFlag=<optimized out>) at qml/qqmlapplicationengine.cpp:132
#31 0x00007fb701729de1 in QQmlApplicationEngine::load (this=this@entry=0x7ffd007f12a0, url=...) at qml/qqmlapplicationengine.cpp:287
#32 0x0000556d47547489 in main (argc=<optimized out>, argv=<optimized out>) at ./src/main.cpp:81
[Inferior 1 (process 4097) detached]
Comment 1 Malte S. Stretz 2023-09-11 11:31:31 UTC
root@neon:~# apt show drkonqi-pk-debug-installer libappstreamqt2 libqt5core5a
Package: drkonqi-pk-debug-installer
Version: 0.1+p22.04+vrelease+git20230906.2256-0
Priority: optional
Section: kde
Maintainer: Neon CI <neon@kde.org>
Installed-Size: 304 kB
Depends: packagekit, libappstreamqt2 (>= 0.16.2), libc6 (>= 2.34), libkf5coreaddons5, libkf5declarative5, libkf5i18n5, libpackagekitqt5-1 (>= 1.0.2), libqt5core5a (>= 5.15.10+p22.04+vrelease+git20230830.0028), libqt5gui5 (>= 5.15.10+p22.04+vrelease+git20230830.0028), libqt5qml5 (>= 5.15.10+p22.04+vrelease+git20230830.0107), libqt5widgets5 (>= 5.15.10+p22.04+vrelease+git20230830.0028), libstdc++6 (>= 5)
Conflicts: kubuntu-debug-installer
Replaces: kubuntu-debug-installer
Homepage: https://www.kde.org
Download-Size: 54.0 kB
APT-Manual-Installed: no
APT-Sources: http://archive.neon.kde.org/user jammy/main amd64 Packages
Description: Debug package installer for DrKonqi crash reporting
 This installer permits drkonqi, KDE's automatic backtrace and bug report
 utility, to find and install missing debug symbols, so that backtraces
 become more useful.

Package: libappstreamqt2
Version: 0.16.2-0xneon+22.04+jammy+release+build18
Priority: optional
Section: libs
Source: appstream-qt5
Maintainer: Neon CI <neon@kde.org>
Installed-Size: 324 kB
Depends: libappstream4 (>= 0.16.2), libc6 (>= 2.14), libgcc-s1 (>= 3.3.1), libglib2.0-0 (>= 2.62), libqt5core5a (>= 5.15.10+p22.04+vrelease+git20230830.0028), libstdc++6 (>= 5)
Homepage: https://www.freedesktop.org/wiki/Distributions/AppStream/
Download-Size: 73.7 kB
APT-Manual-Installed: no
APT-Sources: http://archive.neon.kde.org/user jammy/main amd64 Packages
Description: Qt5 library to access AppStream services

Package: libqt5core5a
Version: 5.15.10+p22.04+vrelease+git20230906.2346-0
Priority: optional
Section: libs
Source: qtbase-opensource-src
Maintainer: Neon CI <neon@kde.org>
Installed-Size: 5828 kB
Provides: qtbase-abi-5-15-5
Depends: shared-mime-info, libc6 (>= 2.35), libdouble-conversion3 (>= 2.0.0), libgcc-s1 (>= 3.4), libglib2.0-0 (>= 2.22.0), libicu70 (>= 70.1-1~), libpcre2-16-0 (>= 10.22), libstdc++6 (>= 11), libsystemd0, libzstd1 (>= 1.4.0), zlib1g (>= 1:1.1.4)
Recommends: qttranslations5-l10n
Suggests: libthai0
Breaks: libqt5scintilla2-12v5 (<< 2.9.2+dfsg-2~), libqtcore4 (<< 4:4.8.7+dfsg-20~)
Replaces: libqtcore4 (<< 4:4.8.7+dfsg-20~)
Homepage: https://www.qt.io/developers/
Download-Size: 1801 kB
APT-Manual-Installed: no
APT-Sources: http://archive.neon.kde.org/user jammy/main amd64 Packages
Description: Qt 5 core module
Comment 2 Malte S. Stretz 2023-09-11 11:45:26 UTC
This commit seems related https://invent.kde.org/system/drkonqi-pk-debug-installer/-/commit/2a0fe5e364b0ae1c7f8acf2b45f0ff66050df325

"it is unclear why the component would be invalid" -- I can reproduce this reliably with the current Live ISO, maybe that will clear this up.
Comment 3 Malte S. Stretz 2023-09-14 10:15:08 UTC
I filed an upstream bug at https://github.com/ximion/appstream/issues/528
Comment 4 Malte S. Stretz 2023-09-14 10:40:46 UTC
@Harald: Sorry for adding you to the CC list but I think I found the root cause and I found something odd in the existing code.

The cause seems to be that no component org.kde.neon.com.ubuntu.ddebs exists:

# appstreamcli get org.kde.neon.com.ubuntu.ddebs
Unable to find component with ID 'org.kde.neon.com.ubuntu.ddebs'!

I have no idea why the pool returns items nevertheless and te lib shouldn't crash but I filed that upstream.

The odd thing I noticed is in the code blow where it says "ensure distros use valid ids". Why is it checking the length of components when in the line above components is extended by matchedComponents? Shouldn't the Q_ASSERT look at matchedComponents just after it was retrieved instead? Or if this is really intended should it be moved after the loop?

>     QList<AppStream::Component> components;
>     for (const auto &id : ids) {
>         const auto matchedComponents = pool.componentsById(id);
>         components += matchedComponents;
> 
>         Q_ASSERT(components.count() == 1); // ensure distros use valid ids
>         const auto &component = matchedComponents.at(0);
>         Q_ASSERT(component.isValid()); // we've seen crash reports that indicated invalid components, unclear why. verify them for now.
>         qWarning() << component.toString();
>         qWarning() << component.packageNames();
>         Q_ASSERT(component.kind() == AppStream::Component::KindRepository);
>     }
>
Comment 5 Malte S. Stretz 2023-09-14 14:01:41 UTC
I think I shouldn't have filed that upstream bug since I think this is the bug in this code (quoted from my comment on the upstream bug report):

> This is release code so the Q_ASSERTs are probably not doing anything. So the components.count() == 1 isn't catching a zero element list being added before. And matchedComponents.at(0) would violate the requirement that the index must exist in the list, ie. it could return anything which wouldn't be caught by the next Q_ASSERT either. So the next line would be the first actual request to that invalid value.
Comment 6 Malte S. Stretz 2023-09-15 08:47:50 UTC
I also found out why the component is not found and opened bug 474402 for that issue.
Comment 7 Malte S. Stretz 2023-09-15 08:48:26 UTC
(In reply to Malte S. Stretz from comment #6)
> I also found out why the component is not found and opened bug 474402 for
> that issue.

Sorry, copy and paste error, that should have been bug 474540.
Comment 8 cwo 2024-09-13 07:55:06 UTC
*** Bug 490627 has been marked as a duplicate of this bug. ***