Review Request 127571: [taskmanager] Stop parsing executables as .desktop files
Rob Wu
rob at robwu.nl
Sat Apr 30 16:21:27 UTC 2016
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/127571/
-----------------------------------------------------------
(Updated April 30, 2016, 6:21 p.m.)
Status
------
This change has been marked as submitted.
Review request for Plasma.
Changes
-------
Submitted with commit 71055e2b725fbb65e16055588f86a57c373d8b47 by Kai Uwe Broulik on behalf of Rob Wu to branch Plasma/5.6.
Repository: plasma-desktop
Description
-------
When a binary is launched via an absolute path, then launcherUrl is not
empty because of [1], even though it is not a .desktop file.
Consequently, when a user right-clicks on the task item, plasmashell
attempts to parse the executable as a .desktop configuration file.
Since this file is obviously not a .desktop file, parsing it as such
will fail, and KConfig floods ~/.xsession-errors with lots of errors.
This can quickly add hundreds of megabytes per right-click...
This patch resolves the problem by not constructing a KDesktopFile if
the launcherUrl is not a .desktop file.
An alternative (and more general) way to get rid of the symptoms is to
modify KDesktopFile / KConfig to stop parsing on the first error and
write the launcherUrl to the error log (or at the very least limit the
number of displayed errors). However, it can be argued that you should
not pass a non-.desktop file to KDesktopFile.
[1] https://quickgit.kde.org/?p=kde-workspace.git&a=commit&h=3a4b9c85fc21d14838ceac04bb0a70656ee7c701
Diffs
-----
applets/taskmanager/plugin/backend.cpp 07ddfbe
Diff: https://git.reviewboard.kde.org/r/127571/diff/
Testing
-------
The following steps demonstrate the issue, and confirms that the patch fixes the bug.
1. Create a simple GUI program, as follows:
```
// Compile: clang++ `pkg-config --cflags --libs Qt5Widgets` app.cpp -o app -g -fPIE
#include <QApplication>
#include <QLabel>
int main(int argc, char **argv) {
QApplication app(argc, argv);
QLabel label("Some GUI app");
label.show();
return app.exec();
}
```
2. Run the program via an absolute path: $PWD/app.sh
3. Right-click on the task item in the task bar (i.e. the program that you just launched).
4. Look at ~/.xsession-errors and observe that the following lines were added.
>
"KConfigIni: In file /tmp/some-qt-app/app, line 1: " Invalid entry (missing '=')
"KConfigIni: In file /tmp/some-qt-app/app, line 2: " Invalid entry (missing '=')
"KConfigIni: In file /tmp/some-qt-app/app, line 3: " Invalid entry (missing '=')
"KConfigIni: In file /tmp/some-qt-app/app, line 4: " Invalid entry (missing '=')
"KConfigIni: In file /tmp/some-qt-app/app, line 5: " Invalid entry (missing ']')
"KConfigIni: In file /tmp/some-qt-app/app, line 6: " "Invalid escape sequence \"\\A\"."
"KConfigIni: In file /tmp/some-qt-app/app, line 6: " "Invalid escape sequence \"\\\u0001\"."
... hundreds of similar lines
5. Compile plasma-desktop with this patch and restart plasmashell.
6. Repeat step 2 and 3.
7. Look at ~/.xsession-errors and observe that the errors are gone.
Thanks,
Rob Wu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20160430/b24b4105/attachment.html>
More information about the Plasma-devel
mailing list