Bug 409195 - Discover crashes on launch with AppStream 0.12.7
Summary: Discover crashes on launch with AppStream 0.12.7
Status: RESOLVED UPSTREAM
Alias: None
Product: Discover
Classification: Applications
Component: PackageKit (show other bugs)
Version: 5.16.2
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Dan Leinir Turthra Jensen
URL:
Keywords:
: 410325 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-06-26 05:28 UTC by Jacob
Modified: 2019-07-30 09:19 UTC (History)
14 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
terminal printout (12.23 KB, application/pdf)
2019-06-26 05:28 UTC, Jacob
Details
Crash report (12.00 KB, text/plain)
2019-06-28 05:42 UTC, Jacob
Details
GDB trace of the crash (5.48 KB, text/plain)
2019-07-03 07:20 UTC, Wolfgang Bauer
Details
attachment-3887-0.html (1.60 KB, text/html)
2019-07-10 17:36 UTC, salvian211
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jacob 2019-06-26 05:28:44 UTC
Created attachment 121147 [details]
terminal printout

SUMMARY
Whenever Discover is launched it crashes. When launched from Konsole, I am hit with the error: 

invalid kns backend! "/usr/share/knsrcfiles/ksysguard.knsrc" because: "Config group not found! Check your KNS3 installation."

STEPS TO REPRODUCE
1. Launch Discover
2. Wait for it to crash
3. Launch from Konsole: ~> plasma-discover

OBSERVED RESULT
Icon theme "gnome" not found.
Icon theme "ubuntu-mono-dark" not found.
Icon theme "Mint-X" not found.
Icon theme "elementary" not found.
Icon theme "gnome" not found.
Icon theme "gnome" not found.
Icon theme "ubuntu-mono-dark" not found.
Icon theme "Mint-X" not found.
Icon theme "elementary" not found.
Icon theme "gnome" not found.
file:///usr/lib64/qt5/qml/QtQuick/Controls.2/org.kde.desktop/private/MobileTextActionsToolBar.qml:62: TypeError: Cannot read property 'selectedText' of null
file:///usr/lib64/qt5/qml/QtQuick/Controls.2/org.kde.desktop/private/MobileTextActionsToolBar.qml:70: TypeError: Cannot read property 'selectedText' of null
file:///usr/lib64/qt5/qml/QtQuick/Controls.2/org.kde.desktop/private/MobileTextActionsToolBar.qml:78: TypeError: Cannot read property 'canPaste' of null
invalid kns backend! "/usr/share/knsrcfiles/ksysguard.knsrc" because: "Config group not found! Check your KNS3 installation."
adding empty sources model QStandardItemModel(0x55695ba58850)
Segmentation fault (core dumped)


EXPECTED RESULT
Discover launches

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: openSUSE Tumbleweed 20190623
KDE Plasma Version: 5.16.1
KDE Frameworks Version: 5.59.0
Qt Version: 5.12.3

ADDITIONAL INFORMATION
I've included a pdf printout of my Konsole
Comment 1 Alois Wohlschlager 2019-06-26 06:43:18 UTC
Can you reproduce this bug and post a stacktrace, please? This can be copied from Dr. Konqui (the "discover has crashed" notification).
Comment 2 mshmm 2019-06-27 10:00:16 UTC
Same issue here on openSUSE Tumbleweed 20190623 and Discover 5.16.1. No Dr. Konqi notification window appears - the Discover window shows briefly and then disappears.

Output from Konsole on attempting to launch plasma-discover:
file:///usr/lib64/qt5/qml/QtQuick/Controls.2/org.kde.desktop/private/MobileTextActionsToolBar.qml:62: TypeError: Cannot read property 'selectedText' of null
file:///usr/lib64/qt5/qml/QtQuick/Controls.2/org.kde.desktop/private/MobileTextActionsToolBar.qml:70: TypeError: Cannot read property 'selectedText' of null
file:///usr/lib64/qt5/qml/QtQuick/Controls.2/org.kde.desktop/private/MobileTextActionsToolBar.qml:78: TypeError: Cannot read property 'canPaste' of null
invalid kns backend! "/usr/share/knsrcfiles/ksysguard.knsrc" because: "Config group not found! Check your KNS3 installation."
adding empty sources model QStandardItemModel(0x55f1e1644e00)
Segmentation fault (core dumped)
Comment 3 Jacob 2019-06-28 00:02:09 UTC
Sorry for the delay. This is my first go around with KDE Plasma so I've been reading a lot of documentation. Unfortunately, I do not have drkonqi crash handler working on my system (not sure if openSUSE disables this in favor of their own crash handler) but was able to get some more detailed information within the crash logs openSUSE has provided.

When attempting to run Discover from the terminal with root privilege, I get the following printout:

~>sudo plasma-discover
qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
error: XDG_RUNTIME_DIR not set in the environment.
Failed to create wl_display (No such file or directory)
qt.qpa.plugin: Could not load the Qt platform plugin "wayland" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: wayland-org.kde.kwin.qpa, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

Aborted

In the warn log built in to openSUSE:

2019-06-27T17:00:07.285213-07:00 linux-71jo plasmashell[2054]: file:///usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/ui/Task.qml:347: Unable to assign [undefined] to int
2019-06-27T17:00:07.286416-07:00 linux-71jo plasmashell[2054]: file:///usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/ui/Task.qml:375: TypeError: Type error
2019-06-27T17:00:07.298193-07:00 linux-71jo plasmashell[2054]: file:///usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/ui/Task.qml:347: Unable to assign [undefined] to int
2019-06-27T17:00:07.298433-07:00 linux-71jo plasmashell[2054]: file:///usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/ui/Task.qml:375: TypeError: Type error
2019-06-27T17:00:07.342155-07:00 linux-71jo plasmashell[2054]: file:///usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/ui/Task.qml:347: Unable to assign [undefined] to int
2019-06-27T17:00:07.342540-07:00 linux-71jo plasmashell[2054]: file:///usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/ui/Task.qml:375: TypeError: Type error
2019-06-27T17:00:07.360158-07:00 linux-71jo plasmashell[2054]: file:///usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/ui/Task.qml:347: Unable to assign [undefined] to int
2019-06-27T17:00:07.360448-07:00 linux-71jo plasmashell[2054]: file:///usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/ui/Task.qml:375: TypeError: Type error
2019-06-27T17:00:08.016838-07:00 linux-71jo kwin_x11[2044]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 5803, resource id: 94371863, major code: 15 (QueryTree), minor code: 0
2019-06-27T17:00:08.019993-07:00 linux-71jo kwin_x11[2044]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 5808, resource id: 94371863, major code: 18 (ChangeProperty), minor code: 0

Hope this helps
Comment 4 adamska156 2019-06-28 04:04:20 UTC
I have the same bug in opensuse as well. I submitted this bug report about it here. https://bugs.kde.org/show_bug.cgi?id=409020

Drkonqi doesn't pop up for me here either. But if any other program crashes, it works fine. Just not in this case. There's also this opensuse bug report since it seems to only be affecting opensuse users. https://bugzilla.opensuse.org/show_bug.cgi?id=1139463
Comment 5 Jacob 2019-06-28 05:42:42 UTC
Created attachment 121197 [details]
Crash report

Okay so I've had some developments on my end. After changing my window manager from default to plasma5, I was able to get Discover "working". The unfortunate part is that Discover is unable to update the repos; it's essentially useless in this state. 

I was however able to get the crash report working. This happened after disabling some repos. Not exactly sure whats happening but I feel like the repos are messing with Discover.
Comment 6 Frank Kruger 2019-06-28 06:11:01 UTC
FYI: With current openSUSE Tumbleweed (TW20190626) and after a reboot Discover is working again for me.
Comment 7 mshmm 2019-06-29 09:41:39 UTC
Still a problem here on Discover 5.16.2-1.1 on openSUSE Tumbleweed 20190627. Discover now stays open on launch, but gives the message "Please make sure that Appstream is properly set up on your system".

Launching from Konsole gives the following:
file:///usr/lib64/qt5/qml/QtQuick/Controls.2/org.kde.desktop/private/MobileTextActionsToolBar.qml:62: TypeError: Cannot read property 'selectedText' of null
file:///usr/lib64/qt5/qml/QtQuick/Controls.2/org.kde.desktop/private/MobileTextActionsToolBar.qml:70: TypeError: Cannot read property 'selectedText' of null
file:///usr/lib64/qt5/qml/QtQuick/Controls.2/org.kde.desktop/private/MobileTextActionsToolBar.qml:78: TypeError: Cannot read property 'canPaste' of null
invalid kns backend! "/usr/share/knsrcfiles/ksysguard.knsrc" because: "Config group not found! Check your KNS3 installation."
adding empty sources model QStandardItemModel(0x55a1cf1ed880)
Could not open the AppStream metadata pool "Some components have been ignored: Metadata files have errors: /var/cache/app-info/xmls/repo-oss.xml.gz, /var/cache/app-info/xmls/repo-non-oss.xml.gz"
no packages for "org.kde.okular-md"
no packages for "org.kde.okular-ooo"
no packages for "org.kde.plasma.quicklaunch"
no packages for "org.kde.plasma.weather"
no packages for "org.kde.plasma.systemmonitor.memory"
no packages for "org.kde.desktopcontainment"
no packages for "org.kde.plasma.networkmanagement"
no packages for "org.kde.plasma.systemloadviewer"
no packages for "org.kde.plasma.webbrowser"
no packages for "org.kde.plasma.clipboard"
no packages for "org.kde.okular-tiff"
no packages for "org.kde.plasma.pager"
no packages for "org.kde.okular-plucker"
no packages for "org.kde.plasma.showActivityManager"
no packages for "org.kde.plasma.notes"
no packages for "org.kde.okular-dvi"
no packages for "org.kde.okular-comicbook"
no packages for "org.kde.plasma.trash"
no packages for "org.kde.plasma.comic"
no packages for "org.kde.plasma.windowlist"
no packages for "org.kde.plasma.battery"
no packages for "org.kde.hunyango"
no packages for "org.kde.haenau"
no packages for "org.kde.okular-poppler"
no packages for "org.kde.plasma.lock_logout"
no packages for "org.kde.plasma.keyboardindicator"
no packages for "org.kde.paneltoolbox"
no packages for "org.kde.plasma.printmanager"
no packages for "de.linrunner.tlp"
no packages for "org.kde.okular-xps"
no packages for "org.kde.plasma.grouping"
no packages for "org.kde.plasma.analogclock"
no packages for "org.kde.plasma.folder"
no packages for "org.kde.color"
no packages for "org.kde.image"
no packages for "org.kde.okular-epub"
no packages for "org.kde.okular-fax"
no packages for "org.kde.plasma.bluetooth"
no packages for "org.kde.plasma.systemmonitor.diskusage"
no packages for "org.kde.plasma.wacomtablet"
no packages for "org.kde.plasma.showdesktop"
no packages for "org.kde.okular-mobipocket"
no packages for "org.kde.plasma.diskquota"
no packages for "org.kde.plasma.systemtray"
no packages for "org.kde.plasma.calendar"
no packages for "org.gnome.cantarell"
no packages for "org.kde.plasma.systemmonitor.diskactivity"
no packages for "org.freedesktop.appstream.cli"
no packages for "org.kde.breezedark.desktop"
no packages for "org.kde.plasma.userswitcher"
no packages for "org.kde.plasma.systemmonitor.net"
no packages for "org.kde.plasma.desktop.emptyPanel"
no packages for "org.kde.desktoptoolbox"
no packages for "org.kde.okular-kimgio"
no packages for "org.kde.plasma.fuzzyclock"
no packages for "org.kde.plasma.kicker"
no packages for "org.kde.plasma_applet_dict"
no packages for "org.kde.plasma.activitypager"
no packages for "org.kde.kio_audiocd"
no packages for "org.kde.plasma.colorpicker"
no packages for "org.kde.plasma.pkupdates"
no packages for "org.kde.plasmashell"
no packages for "org.kde.plasma.fifteenpuzzle"
no packages for "org.kde.plasma.timer"
no packages for "org.kde.kscreen"
no packages for "org.kde.milou"
no packages for "org.kde.plasma.mediacontroller"
no packages for "org.kde.plasma.konsoleprofiles"
no packages for "org.kde.discover.packagekit"
no packages for "org.kde.breeze.desktop"
no packages for "org.kde.plasma.quickshare"
no packages for "org.kde.plasma.mediaframe"
no packages for "org.kde.plasma.systemmonitor.cpu"
no packages for "org.kde.plasma.katesessions"
no packages for "org.kde.plasma.activitybar"
no packages for "org.kde.potd"
no packages for "org.kde.slideshow"
no packages for "org.kde.plasma.icontasks"
no packages for "org.kde.okular-fb"
no packages for "org.torproject.torbrowser.desktop"
no packages for "org.kde.kinfocenter"
no packages for "org.kde.plasma.taskmanager"
no packages for "owncloud_kaccounts_ui"
no packages for "org.kde.okular-chm"
no packages for "org.kde.plasma.digitalclock"
no packages for "org.kde.plasma.desktop.appmenubar"
no packages for "org.kde.okular-txt"
no packages for "org.kde.plasma.volume"
no packages for "org.kde.plasma.desktop.defaultPanel"
no packages for "org.kde.plasma.kickerdash"
no packages for "org.kde.plasma.calculator"
no packages for "org.kde.plasma.appmenu"
no packages for "org.kde.plasma.notifications"
no packages for "org.kde.plasma.devicenotifier"
no packages for "org.kde.plasma.binaryclock"
no packages for "org.kde.plasma.desktop"
no packages for "org.kde.plasma.kimpanel"
no packages for "org.kde.okular-djvu"
no packages for "org.kde.wacomtablet"
no packages for "org.kde.plasma.kickoff"
no packages for "org.kde.plasma.minimizeall"
empty appstream db
qml: message: Please make sure that Appstream is properly set up on your system
no org.freedesktop.Platform.VAAPI.Intel
Failed to parse appstream metadata: AppStream::Metadata::MetadataErrorParse "/var/lib/flatpak/exports/share/applications/org.freedesktop.Platform.VAAPI.Intel.desktop"
no org.freedesktop.Platform.html5-codecs
Failed to parse appstream metadata: AppStream::Metadata::MetadataErrorParse "/var/lib/flatpak/exports/share/applications/org.freedesktop.Platform.html5-codecs.desktop"
took really long to fetch PackageKitBackend(0x55a1cf1e1580)
Comment 8 Wolfgang Bauer 2019-07-01 09:13:18 UTC
I think enough information has been provided to switch this back from NEEDINFO.

IMHO, it seems to be related to the latest update of AppStream, doesn't necessarily mean it's not a "bug" in discover though.
Comment 9 Wolfgang Bauer 2019-07-01 19:33:44 UTC
(In reply to Wolfgang Bauer from comment #8)
> IMHO, it seems to be related to the latest update of AppStream
I can confirm that myself meanwhile.

It works fine with AppStream 0.12.6 here, but crashes on start with AppStream 0.12.7. (no other changes to the system)
Comment 10 Wolfgang Bauer 2019-07-01 19:57:35 UTC
Btw, the posted shell output (in comment#0 e.g.) is rather irrelevant.
I get the same with AppStream 0.12.6 when it works, up to and including "adding empty sources model QStandardItemModel(0x55695ba58850)". So that's not indicating the problem.

In the working case there's some more following of course, while it stops there with "Segmentation fault (core dumped)" with AppStream 0.12.7.
Comment 11 adamska156 2019-07-01 23:08:47 UTC
Hmm, It's still not booting for me even with Appstream 0.12.6 installed. Same problem, window pops up for a moment then closes with no bug report window afterward.

This is what it reads in CLI:
sudo plasma-discover
qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
error: XDG_RUNTIME_DIR not set in the environment.
Failed to create wl_display (No such file or directory)
qt.qpa.plugin: Could not load the Qt platform plugin "wayland" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: wayland-org.kde.kwin.qpa, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

Aborted
Comment 12 Frank Kruger 2019-07-02 05:30:46 UTC
Start it as a normal user (i.e. without sudo).
Comment 13 adamska156 2019-07-02 06:56:57 UTC
(In reply to Frank Kruger from comment #12)
plasma-discover
file:///usr/lib64/qt5/qml/QtQuick/Controls.2/org.kde.desktop/private/MobileTextActionsToolBar.qml:62: TypeError: Cannot read property 'selectedText' of null
file:///usr/lib64/qt5/qml/QtQuick/Controls.2/org.kde.desktop/private/MobileTextActionsToolBar.qml:70: TypeError: Cannot read property 'selectedText' of null
file:///usr/lib64/qt5/qml/QtQuick/Controls.2/org.kde.desktop/private/MobileTextActionsToolBar.qml:78: TypeError: Cannot read property 'canPaste' of null
invalid kns backend! "/usr/share/knsrcfiles/ksysguard.knsrc" because: "Config group not found! Check your KNS3 installation."
adding empty sources model QStandardItemModel(0x5630b43ef5a0)
Segmentation fault (core dumped)
Comment 14 Alois Wohlschlager 2019-07-03 06:05:09 UTC
(In reply to Wolfgang Bauer from comment #10)
> Btw, the posted shell output (in comment#0 e.g.) is rather irrelevant.
> I get the same with AppStream 0.12.6 when it works, up to and including
> "adding empty sources model QStandardItemModel(0x55695ba58850)". So that's
> not indicating the problem.
> 
> In the working case there's some more following of course, while it stops
> there with "Segmentation fault (core dumped)" with AppStream 0.12.7.

Yes, and there is still no backtrace. The bug in Discover (probably) is the segfault.
Comment 15 Wolfgang Bauer 2019-07-03 07:01:41 UTC
(In reply to alois2 from comment #14)
> Yes, and there is still no backtrace. The bug in Discover (probably) is the
> segfault.
There is a backtrace in comment#5.

"Unfortunately", it doesn't crash anymore here as of today. It still crashed yesterday and I didn't install any updates since... :-/

An observation though: setting LANG=C did fix/avoid the crash on my system.

I did some investigation when it still crashed, apparently AppStream tried to add the same line over and over again (in as_xml_dump_node_children()) in an endless loop, and eventually ran out of memory.
Comment 16 Wolfgang Bauer 2019-07-03 07:20:28 UTC
Created attachment 121298 [details]
GDB trace of the crash

I attached another back trace from an openSUSE bug report now.
This is actually the same that I had on my system, and matches my previous comments.
Comment 17 Wolfgang Bauer 2019-07-03 07:20:52 UTC
See comment#16.
Comment 18 Peter Luladjiev 2019-07-03 10:40:43 UTC
(In reply to Wolfgang Bauer from comment #15)
> "Unfortunately", it doesn't crash anymore here as of today. It still crashed
> yesterday and I didn't install any updates since... :-/

To trigger the segmentation fault run 

sudo appstreamcli refresh-cache
Comment 19 Wolfgang Bauer 2019-07-03 17:11:07 UTC
(In reply to luladjiev from comment #18)
> (In reply to Wolfgang Bauer from comment #15)
> > "Unfortunately", it doesn't crash anymore here as of today. It still crashed
> > yesterday and I didn't install any updates since... :-/
> 
> To trigger the segmentation fault run 
> 
> sudo appstreamcli refresh-cache
Yeah, I noticed that myself meanwhile.

Strange enough, running it again fixed the crash again for me (and deleting /var/cache/app-info/ "fixes" it too, but then there is no appstream data of course).
Something seems to be flaky when creating the cache, it seems.

FWIW, I also once got the crash from comment#5 as well now, which is in lmdb... (usually I get the backtrace from comment#16 though)
Comment 20 Nate Graham 2019-07-09 19:23:42 UTC
*** Bug 409220 has been marked as a duplicate of this bug. ***
Comment 21 Wolfgang Bauer 2019-07-10 17:33:14 UTC
As the title says "Discover crashes on launch (invalid kns backend)...", I'd like to note once again that this message also comes here when it is not crashing, so I assume it's unrelated.
Comment 22 salvian211 2019-07-10 17:36:02 UTC
Created attachment 121446 [details]
attachment-3887-0.html

Correct it is not crashing it is only warning us that not all dependencies
are installed. At first I thought it was crashing but I was wrong.

On Wed, Jul 10, 2019, 10:33 AM Wolfgang Bauer <bugzilla_noreply@kde.org>
wrote:

> https://bugs.kde.org/show_bug.cgi?id=409195
>
> Wolfgang Bauer <wbauer@tmo.at> changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>             Summary|Discover crashes on launch  |Discover crashes on launch
>                    |(invalid kns backend) with  |with AppStream 0.12.7
>                    |AppStream 0.12.7            |
>
> --- Comment #21 from Wolfgang Bauer <wbauer@tmo.at> ---
> As the title says "Discover crashes on launch (invalid kns backend)...",
> I'd
> like to note once again that this message also comes here when it is not
> crashing, so I assume it's unrelated.
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
Comment 23 Wolfgang Bauer 2019-07-10 17:46:09 UTC
(In reply to salvian211 from comment #22)
> Correct it is not crashing it is only warning us that not all dependencies
> are installed. At first I thought it was crashing but I was wrong.
Well, it is crashing, but the "invalid kns backend!" warning is irrelevant to the crash AFAICT. ;-)
Comment 24 Karl Ove Hufthammer 2019-07-29 06:46:43 UTC
*** Bug 410325 has been marked as a duplicate of this bug. ***
Comment 25 Fabian Vogt 2019-07-29 13:45:16 UTC
Filed upstream as https://github.com/ximion/appstream/issues/243 with bisect result.
Comment 26 Fabian Vogt 2019-07-30 09:19:39 UTC
(In reply to Fabian Vogt from comment #25)
> Filed upstream as https://github.com/ximion/appstream/issues/243 with bisect
> result.

Got fixed in AppStream by not crashing for weirdly invalid metainfo files.