[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [kactivities] [Bug 305529] kactivitymanagerd crashes on startup [ActivityRankingPlugin]
From:       Andriy Gapon <avg () icyb ! net ! ua>
Date:       2013-04-09 17:20:32
Message-ID: bug-305529-17878-kVRgAZ6xfk () http ! bugs ! kde ! org/
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=305529

Andriy Gapon <avg@icyb.net.ua> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |avg@icyb.net.ua

--- Comment #9 from Andriy Gapon <avg@icyb.net.ua> ---
About this piece:
#11 0x00000008029e8fc2 in QThread::d_func (this=0x0) at
../../include/QtCore/../../../../qt-4.8/src/corelib/thread/qthread.h:130
#12 0x00000008029f25f6 in QThread::exit (this=0x0, returnCode=0) at
/usr/home/rakuco/kde4/src/qt-4.8/src/corelib/thread/qthread.cpp:532
#13 0x00000008128c554d in ActivityRankingPlugin::~ActivityRankingPlugin
(this=0x80c6eb7c0, __in_chrg=<optimized out>) at
/home/rakuco/kde4/src/kde/kdelibs/kactivities/src/service/plugins/activityranking/activityrankingplugin.cpp:71
 #14 0x00000008128c55be in ActivityRankingPlugin::~ActivityRankingPlugin
(this=0x80c6eb7c0, __in_chrg=<optimized out>) at
/home/rakuco/kde4/src/kde/kdelibs/kactivities/src/service/plugins/activityranking/activityrankingplugin.cpp:73
 #15 0x00000000004123e9 in KPluginFactory::create<Plugin> (this=0x80bc70fa0,
parent=0x80be04dc0, args=...) at /home/rakuco/kde4/include/kpluginfactory.h:511
#16 0x0000000000410712 in Application::loadPlugins (this=0x80be04dc0) at
/home/rakuco/kde4/src/kde/kdelibs/kactivities/src/service/Application.cpp:165

I was able to reproduce this in a debugger and analyze it a little bit.
What happens in frame 15 (KPluginFactory::create<Plugin>) is that qobject_cast
doesn't recognize an ActivityRankingPlugin object created by the code in DSO
(activitymanager_plugin_activityranking.so) as a Plugin object. I am not sure
if this problem is 100% FreeBSD-specific or if other platforms are affected
too.

Basically it seems like a variation of this more general C++ vs dlopen issue:
http://gcc.gnu.org/faq.html#dso

There is one instance of Plugin::staticMetatData in kactivitymanagerd
executable and there are other instances of it in all the plugin .so files.
When a .so is dlopen-ed the runtime linker does not merge these
definitions/instances.
So, the instances of Plugin subclasses instantiated in DSOs point to the local
copy while qobject_cast compares (by pointer comparison) them with the "main"
copy.

This mismatch leads to inability to properly load any plugin and also to the
above crash.
I have not investigated the details of the crash, but I suspect that it is also
caused by the same kind of a mismatch.
Because the destructor does not seem to have any bugs and should properly work
on a constructed object.

Final note, I was able to work-around this issue by using the advice from the
gcc faq to pass -Wl,-E linker flag.
I am not why/how things work with that flag on other platforms or for other KDE
/ Qt programs that make use of plugins.

-- 
You are receiving this mail because:
You are watching all bug changes.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic