Bug 170043 - [PATCH] KConfigGroupPrivate::expandString causes kdeinit crash with Fedora configuration
Summary: [PATCH] KConfigGroupPrivate::expandString causes kdeinit crash with Fedora co...
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: kdecore (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-29 17:20 UTC by Kevin Kofler
Modified: 2008-08-31 12:03 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch for kde#170043 / rh#455130 (829 bytes, patch)
2008-08-29 17:22 UTC, Kevin Kofler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Kofler 2008-08-29 17:20:46 UTC
Version:           >= 4.0.98 (using KDE 4.1.1)
OS:                Linux
Installed from:    Fedora RPMs

Since revision 829259, i.e. in KDE >= 4.0.98, kinit.cpp uses KConfig without a KComponentData to read the "Documents" path, because initializing a KComponentData at that place was breaking kioslave translations.

Unfortunately, if the setting for Documents contains a shell command, as it does in the Fedora configuration:
Documents[$e]=$(xdg-user-dir DOCUMENTS)
KConfigGroupPrivate::expandString gets called and tries to unconditionally access the KComponentData which has not been initialized yet. This causes either an assertion failure or a NULL pointer dereference, depending on whether NDEBUG is defined or not.

See: https://bugzilla.redhat.com/show_bug.cgi?id=455130 for the Fedora bug report.

The change triggering the regression (plus followup fix):
http://websvn.kde.org/?view=rev&revision=829259
http://websvn.kde.org/?view=rev&revision=829264
At first, we "fixed" this in Fedora by reverting those changes, but we have a proper fix now, which I'm about to attach.
Comment 1 Kevin Kofler 2008-08-29 17:22:50 UTC
Created attachment 27127 [details]
Patch for kde#170043 / rh#455130

This one-line patch fixes KConfigGroupPrivate::expandString not to try accessing the "exe" path from KComponentData before it has been initialized. When called in that situation, it falls back to only searching the system PATH for the command to run.
Comment 2 Oswald Buddenhagen 2008-08-31 12:03:35 UTC
fixed for kde 4.2 and 4.1.2