<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://git.reviewboard.kde.org/r/112069/">http://git.reviewboard.kde.org/r/112069/</a>
</td>
</tr>
</table>
<br />
<table bgcolor="#e0e0e0" width="100%" cellpadding="8" style="border: 1px gray solid;">
<tr>
<td>
<h1 style="margin-right: 0.2em; padding: 0; font-size: 10pt;">This change has been discarded.</h1>
</td>
</tr>
</table>
<br />
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Plasma.</div>
<div>By Hrvoje Senjan.</div>
<p style="color: grey;"><i>Updated Aug. 14, 2013, 10:56 a.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">From the bug report:
"I have analyzed the crashed application in gdb, and I believe this code in Plasma::ThemePrivate::useCache() is the real culprit:
230 if (isRegularTheme) {
231 const QString path = KStandardDirs::locate("data", "desktoptheme/" + themeName + "/metadata.desktop");
232 const KPluginInfo pluginInfo(path);
Note that "path" is a relative path and KPluginInfo::KPluginInfo is called with only one argument. However, KPluginInfo constructor is declared as:
* @param filename The filename of the .desktop file.
* @param resource If filename is relative, you need to specify a resource type
* (e.g. "service", "apps"... KStandardDirs). Otherwise,
* resource isn't used.
*/
explicit KPluginInfo( const QString & filename, const char* resource = 0 );
So, if you call it without the "resource" argument, the default value is used, which is NULL. This is invalid for a relative path, and indeed causes the crash further down the stack in KStandardDirs::saveLocation():
1499 if (dirs.isEmpty() && (
1500 (strcmp(type, "socket") == 0) ||
1501 (strcmp(type, "tmp") == 0) ||
1502 (strcmp(type, "cache") == 0) ))
Unsurprisingly, calling strcmp(NULL, something) will cause a SIGSEGV."
Note that it's not my patch, but i feel it's a waste it's just sitting there in the report, and not here ;-)
Issue is triggered very easily by explcitly definining a plasma theme which does not exist (with e.g. adding
[Theme]
name=fake-non-existant-theme
in plasmarc)</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Tried the above example with the patch, plasma doesn't crash</pre>
</td>
</tr>
</table>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="http://bugs.kde.org/show_bug.cgi?id=320855">320855</a>,
<a href="http://bugs.kde.org/show_bug.cgi?id=322446">322446</a>
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>plasma/theme.cpp <span style="color: grey">(4554de7)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/112069/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>