Bug 404240 - plasmashell crashes on launch somewhere in KArchive
Summary: plasmashell crashes on launch somewhere in KArchive
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: master
Platform: Neon Linux
: NOR crash
Target Milestone: 1.0
Assignee: David Edmundson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-12 14:44 UTC by Nate Graham
Modified: 2019-02-15 15:41 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.56


Attachments
kpluginindex.json (991 bytes, application/json)
2019-02-12 14:55 UTC, Nate Graham
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2019-02-12 14:44:14 UTC
Neon Dev Unstable, everything from git master, updated today

plasmashell crashes on launch somewhere in KArchive:

Temporary breakpoint 1, 0x0000555555578740 in main ()
(gdb) c
Continuing.
[New Thread 0x7fffe2d1d700 (LWP 10811)]
[New Thread 0x7fffe0b09700 (LWP 10812)]

Thread 1 "plasmashell" received signal SIGSEGV, Segmentation fault.
0x00007fffeedf5154 in KFilterBase::device() ()
   from /usr/lib/x86_64-linux-gnu/libKF5Archive.so.5
(gdb) bt
#0  0x00007fffeedf5154 in KFilterBase::device() ()
   from /usr/lib/x86_64-linux-gnu/libKF5Archive.so.5
#1  0x00007fffeedf422c in KCompressionDevice::open(QFlags<QIODevice::OpenModeFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libKF5Archive.so.5
#2  0x00007ffff4d9cd1b in KPackage::PackageLoader::listPackages(QString const&, QString const&) () from /usr/lib/x86_64-linux-gnu/libKF5Package.so.5
#3  0x00007ffff4d9e4d7 in KPackage::PackageLoader::findPackages(QString const&, QString const&, std::function<bool (KPluginMetaData const&)>) ()
   from /usr/lib/x86_64-linux-gnu/libKF5Package.so.5
#4  0x00007ffff64697c0 in Plasma::PluginLoader::listContainmentsOfType(QString const&, QString const&, QString const&) () from /usr/lib/x86_64-linux-gnu/libKF5Plasma.so.5
#5  0x00005555555aa104 in ShellCorona::checkAddPanelAction(QStringList const&) ()
#6  0x000055555559d8f7 in ShellCorona::ShellCorona(QObject*) ()
#7  0x00005555555c0d13 in ShellManager::loadHandlers() ()
#8  0x00005555555eabda in ShellManager::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) ()
#9  0x00007ffff1b16992 in QObject::event (this=0x5555558bec10, e=<optimized out>)
    at kernel/qobject.cpp:1249
#10 0x00007ffff348b83c in QApplicationPrivate::notify_helper (
    this=this@entry=0x55555584db50, receiver=receiver@entry=0x5555558bec10, 
    e=e@entry=0x5555558bf150) at kernel/qapplication.cpp:3752
#11 0x00007ffff3492dd0 in QApplication::notify (this=0x7fffffffdc10, 
    receiver=0x5555558bec10, e=0x5555558bf150) at kernel/qapplication.cpp:3499
#12 0x00007ffff1ae6328 in QCoreApplication::notifyInternal2 (receiver=0x5555558bec10, 
    event=0x5555558bf150) at kernel/qcoreapplication.cpp:1061
#13 0x00007ffff1ae64fe in QCoreApplication::sendEvent (receiver=<optimized out>, 
    event=event@entry=0x5555558bf150) at kernel/qcoreapplication.cpp:1451
#14 0x00007ffff1ae8e87 in QCoreApplicationPrivate::sendPostedEvents (
    receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0x5555558426e0)
    at kernel/qcoreapplication.cpp:1800
#15 0x00007ffff1ae9428 in QCoreApplication::sendPostedEvents (
    receiver=receiver@entry=0x0, event_type=event_type@entry=0)
    at kernel/qcoreapplication.cpp:1654
#16 0x00007ffff1b43b23 in postEventSourceDispatch (s=0x5555558a3830)
    at kernel/qeventdispatcher_glib.cpp:276
#17 0x00007fffeb1df387 in g_main_context_dispatch ()
   from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#18 0x00007fffeb1df5c0 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#19 0x00007fffeb1df64c in g_main_context_iteration ()
   from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#20 0x00007ffff1b4313f in QEventDispatcherGlib::processEvents (this=0x5555558b3220, 
    flags=...) at kernel/qeventdispatcher_glib.cpp:422
#21 0x00007ffff1ae464a in QEventLoop::exec (this=this@entry=0x7fffffffdae0, flags=...,
Comment 1 Nate Graham 2019-02-12 14:51:37 UTC
$  strace plasmashell |& grep kpluginindex.json
access("/usr/lib/x86_64-linux-gnu/qt5/plugins/kpackage/packagestructure/kpluginindex.json", F_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/x86_64-linux-gnu/qt5/plugins/kpackage/packagestructure/kpluginindex.json", F_OK) = -1 ENOENT (No such file or directory)
access("/home/dev/.local/share/plasma/plasmoids/kpluginindex.json", F_OK) = 0
Comment 2 Nate Graham 2019-02-12 14:55:07 UTC
Created attachment 118005 [details]
kpluginindex.json
Comment 3 Nate Graham 2019-02-12 15:05:30 UTC
Backtrace with KArchive debug symbols:



(gdb) bt
#0  0x00007fffeedf3316 in KFilterBase::device (this=0x0)
    at /home/dev/repos/karchive/src/kfilterbase.cpp:58
#1  0x00007fffeedf2310 in KCompressionDevice::open (this=0x7fffffffce50, mode=...)
    at /home/dev/repos/karchive/src/kcompressiondevice.cpp:161
#2  0x00007ffff4d9cd1b in KPackage::PackageLoader::listPackages(QString const&, QString const&) () from /usr/lib/x86_64-linux-gnu/libKF5Package.so.5
#3  0x00007ffff4d9e4d7 in KPackage::PackageLoader::findPackages(QString const&, QString const&, std::function<bool (KPluginMetaData const&)>) ()
   from /usr/lib/x86_64-linux-gnu/libKF5Package.so.5
#4  0x00007ffff64697c0 in Plasma::PluginLoader::listContainmentsOfType(QString const&, QString const&, QString const&) () from /usr/lib/x86_64-linux-gnu/libKF5Plasma.so.5
#5  0x00005555555aa104 in ShellCorona::checkAddPanelAction(QStringList const&) ()
#6  0x000055555559d8f7 in ShellCorona::ShellCorona(QObject*) ()
#7  0x00005555555c0d13 in ShellManager::loadHandlers() ()
#8  0x00005555555eabda in ShellManager::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) ()
#9  0x00007ffff1b16992 in QObject::event (this=0x5555558c07d0, e=<optimized out>)
    at kernel/qobject.cpp:1249
#10 0x00007ffff348b83c in QApplicationPrivate::notify_helper (
    this=this@entry=0x55555584db50, receiver=receiver@entry=0x5555558c07d0, 
    e=e@entry=0x5555558c41a0) at kernel/qapplication.cpp:3752
#11 0x00007ffff3492dd0 in QApplication::notify (this=0x7fffffffdbf0, 
    receiver=0x5555558c07d0, e=0x5555558c41a0) at kernel/qapplication.cpp:3499
#12 0x00007ffff1ae6328 in QCoreApplication::notifyInternal2 (receiver=0x5555558c07d0, 
    event=0x5555558c41a0) at kernel/qcoreapplication.cpp:1061
#13 0x00007ffff1ae64fe in QCoreApplication::sendEvent (receiver=<optimized out>, 
    event=event@entry=0x5555558c41a0) at kernel/qcoreapplication.cpp:1451
#14 0x00007ffff1ae8e87 in QCoreApplicationPrivate::sendPostedEvents (
    receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0x5555558426e0)
    at kernel/qcoreapplication.cpp:1800
#15 0x00007ffff1ae9428 in QCoreApplication::sendPostedEvents (
    receiver=receiver@entry=0x0, event_type=event_type@entry=0)
    at kernel/qcoreapplication.cpp:1654
#16 0x00007ffff1b43b23 in postEventSourceDispatch (s=0x5555558a25e0)
    at kernel/qeventdispatcher_glib.cpp:276
#17 0x00007fffeb1dc387 in g_main_context_dispatch ()
Comment 4 Nate Graham 2019-02-12 15:11:39 UTC
With the attached kpluginindex.json file located in ~/.local/share/plasma/plasmoids, plasmashell reproducibly crashes with this backtrace. If I delete it and generate a new file using `kpackagetool5 --generate-index`, the crash stops reproducing.
Comment 5 Nate Graham 2019-02-12 15:40:32 UTC
This turned out to have been caused by a packaging bug: after a Neon upgrade, libbz2-dev got uninstalled, so Plasma crashed trying to read my kpluginindex.json file that had previously been bzip2-compressed. Reinstalling libbz2-dev fixed it.

That said, it would be nice to not have this condition cause a crash. David Edmundson has a patch that should fix this, I believe.
Comment 7 David Edmundson 2019-02-15 15:10:37 UTC
Git commit 3d5713ba37609c5b0a05c1819310338e8643a3b6 by David Edmundson.
Committed on 15/02/2019 at 15:10.
Pushed by davidedmundson into branch 'master'.

Guard KCompressionDevice::open being called with no backend available

Summary:
If KArchive is built without support for a compression type, such as
bzip2, d->filter ends up as null.

It is then used in the open call and will crash.

Other calls can still crash, but they shouldn't be being called if open
fails.

Reviewers: #plasma, #frameworks, ngraham

Reviewed By: ngraham

Subscribers: ngraham, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D18965

M  +3    -0    src/kcompressiondevice.cpp

https://commits.kde.org/karchive/3d5713ba37609c5b0a05c1819310338e8643a3b6