KDE malloc SIGSEGV with PerlQt bindings + KDE themes

Lubos Lunak l.lunak at suse.cz
Tue Nov 19 17:27:25 GMT 2002


On Tuesday 19 November 2002 15:40, Karol Szwed wrote:
> On Tuesday 19 November 2002 13:27, Germain Garand wrote:
> > Hi,
> > I'm investigating a segfault that happens when using some KDE themes
> > (namely : riscos, marble, system, systemalt).
> > It happens consistently when KDE's malloc attempts to free
> > KStandardDirs::addKDEDefaults's QStringList.
> >
> > Would someone have a hint about what is going wrong ?
>
> If the apps segfault on exit, it is most likely kthemestyle's linking to
> kdecore that is causing the problem (KStaticDeleter again most
> likely). You should not have any problems with all other style plugins
> that do not link to kdecore.
>
> If you grep for "__GLIBC__" in kthemestyle.cpp you'll see a workaround:
>
> dlopen("kthemestyle.so",RTLD_LAZY);
>
> This helps to ensure that apps don't crash on exit by preventing
> the "dlclose" in Qt from having any effect on the plugin. This prevents
> the plugin from being unloaded and avoids the segfault. This is probably
> why valgrind is giving the all clear. Are you using libc on FreeBSD by
> any chance in which case this workaround isn't enabled?
>
> Please give more info on your platform and exactly how to reproduce
> the crash if its not on exit.

 The linking to libkdecore is the problem, but the explanation is incorrect. 
It is an interaction between dlopen and the malloc in libkdecore, it's not 
your fault. If you use styles that don't link to libkdecore it will work 
fine. I'll have to investigate this problem a bit more.

-- 
Lubos Lunak
KDE developer
---------------------------------------------------------------------
SuSE CR, s.r.o.  e-mail: l.lunak at suse.cz , l.lunak at kde.org
Drahobejlova 27  tel: +420 2 9654 2373
190 00 Praha 9   fax: +420 2 9654 2374
Czech Republic   http://www.suse.cz/




More information about the kde-core-devel mailing list