This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Applets written in Python crash Plasma

Tags: None
(comma "," separated)
nielsgm
Registered Member
Posts
3
Karma
0
Hi.

I've been trying to create a simple plasma applet using Python by copying the example from here: https://projects.kde.org/projects/kde/k ... ts/pyhello

However, this (and all other examples i've tried) crashes plasma and makes it reload all panels and widgets. If i load the applet using plasmoidviewer it also crashes with the following backtrace:

Code: Select all
Application: Plasma Widget Viewer (plasmoidviewer), signal: Segmentation fault
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[KCrash Handler]
#5  0x00007f32524ef200 in QMetaObject::cast(QObject*) const () from /usr/lib/libQtCore.so.4
#6  0x00007f3253d9414f in ?? () from /usr/lib/libplasma.so.3
#7  0x00007f3253d94716 in Plasma::loadScriptEngine(QString const&, Plasma::Applet*) () from /usr/lib/libplasma.so.3
#8  0x00007f3253ce89cd in ?? () from /usr/lib/libplasma.so.3
#9  0x00007f3253ceda03 in Plasma::Applet::Applet(QObject*, QList<QVariant> const&) () from /usr/lib/libplasma.so.3
#10 0x00007f3253d2af92 in Plasma::PluginLoader::loadApplet(QString const&, unsigned int, QList<QVariant> const&) () from /usr/lib/libplasma.so.3
#11 0x00007f3253cfd3dc in ?? () from /usr/lib/libplasma.so.3
#12 0x000000000040b20b in _start ()


I'm running an Arch system with kde 4.11.0 (including python bindings) and python 2.7.5 and 3.3.2. Switching the default python environment doesn't seem to help.

The only related bug i can find is https://bugs.kde.org/show_bug.cgi?id=323899 but that seems to be a build problem rather.

Any help would be appreciated.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Is anything written to the terminal explaining why the script engine might be failing to load?
You may need to enable all debug output for this to work, which can be done using "kdebugdialog".

Also, have you got both PyKDE4 and PyQt4 installed on your system?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
nielsgm
Registered Member
Posts
3
Karma
0
With debugging enabled i get the following:

Code: Select all
plasmoidviewer(2462) main: setting applet to "pyhello"
plasmoidviewer(2462)/kdecore (KSycoca) KSycocaPrivate::openDatabase: Trying to open ksycoca from "/var/tmp/kdecache-niels/ksycoca4"
plasmoidviewer(2462) main: setting FormFactor to "planar"
plasmoidviewer(2462) main: setting Location to "floating"
plasmoidviewer(2462) main: setting auth policy
plasmoidviewer(2462)/libplasma Plasma::Corona::Corona: !!{} STARTUP TIME 69512863 Corona ctor start
plasmoidviewer(2462) main: just load applet
plasmoidviewer(2462) FullView::addApplet: adding applet "pyhello" in "null"
plasmoidviewer(2462)/libplasma Plasma::AppletPrivate::init: Check your constructor!  You probably want to be passing in a Service::Ptr  or a QVariantList with a valid storageid as arg[0].
plasmoidviewer(2462)/libplasma Plasma::PluginLoader::loadApplet: we have a script using the "python" API
plasmoidviewer(2462)/python (plugin) KPythonPluginFactory::KPythonPluginFactory: KPythonPluginFactory::KPythonPluginFactory()
plasmoidviewer(2462)/python (plugin) KPythonPluginFactory::initialize: Initializing Python interpreter.
plasmoidviewer(2462)/python (plugin) KPythonPluginFactory::initialize: Succesfully initialized Python interpreter.
plasmoidviewer(2462)/python (plugin) KPythonPluginFactory::create: KPythonPluginFactory::create iface:  Plasma::AppletScript
plasmoidviewer(2462)/python (plugin) KPythonPluginFactory::create: keyword to be used for finding the plugin code:  "plasma_scriptengine_python/pyappletscript.py"
plasmoidviewer(2462)/python (plugin) KPythonPluginFactory::create: Path to plugin code is:  "/usr/share/apps/plasma_scriptengine_python/pyappletscript.py"
plasmoidviewer(2462)/python (plugin) KPythonPluginFactory::create: Returning result qobject
KCrash: Application 'plasmoidviewer' crashing...
KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi from kdeinit
sock_file=/home/niels/.kde4/socket-localhost/kdeinit4__0
zsh: suspended (signal)  plasmoidviewer pyhello


I can't see anything wrong up to the point where plasmoidviewer crashes.
I have python2-pyqt4 and kdebindings-python(2) installed.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
This would appear to be a regression, or distribution specific issue in the Python bindings for Plasma. Can you please report this to your distribution, complete with the backtrace you have posted here?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
einar
Administrator
Posts
3402
Karma
7
OS
It may also be that one of the applet is throwing a Python exception, which can't be handled in Plasma and thus results in a crash. If you can, install "plasmoidviewer" then try to run the offending plasmoids from the command line (plasmoidviewer --list gives a list of all installed plasmoids) and report here.


"Violence is the last refuge of the incompetent."
Image
Plasma FAQ maintainer - Plasma programming with Python
nielsgm
Registered Member
Posts
3
Karma
0
I actually did use Plasmoidviewer :-)
Regardless, after updating to KDE 4.11.1, the problem has gone away.
Cazou
Registered Member
Posts
1
Karma
0
Looks like I have the exact same problem with KDE 4.11.1 (Gentoo Linux x86_64) :/
What else did you upgrade with KDE ?


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]