Bug 307775

Summary: Application crash with older plugins installed
Product: [Applications] digikam Reporter: Marcel Wiesweg <marcel.wiesweg>
Component: Portability-RuntimeAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: cabster724, caulier.gilles, hirvard, kde, swarfega
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 5.0.0

Description Marcel Wiesweg 2012-10-03 14:44:17 UTC
Application: ksnapshot (0.8.2)
KDE Platform Version: 4.9.1 "release 561"
Qt Version: 4.8.2
Operating System: Linux 3.4.6-2.10-desktop x86_64
Distribution: "openSUSE 12.2 (x86_64)"

-- Information about the crash:
- What I was doing when the application crashed:

Install current libkipi2+kipi-plugins
Open KSnapshot (from KDE 4.9), press Send To.

The crash can be reproduced every time.

-- Backtrace:
Application: KSnapshot (ksnapshot), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[KCrash Handler]
#5  QString::operator= (this=0x72006500730097, other=...) at tools/qstring.cpp:1411
#6  0x00007f817bc7cc09 in KIPI::Plugin::setUiBaseName (this=0x12f3580, name=<optimized out>) at /home/marcel/freshmeat/multimedia/kde4/src/extragear/graphics/digikam/extra/libkipi/libkipi/plugin.cpp:309
#7  0x00007f817c94e6af in KIPIIpodExportPlugin::Plugin_iPodExport::Plugin_iPodExport (this=0x12f3580, parent=0x1326af0) at /home/marcel/freshmeat/multimedia/kde4/src/extragear/graphics/digikam/extra/kipi-plugins/ipodexport/plugin_ipodexport.cpp:66
#8  0x00007f817c94eba7 in KPluginFactory::createInstance<KIPIIpodExportPlugin::Plugin_iPodExport, QObject> (parentWidget=<optimized out>, parent=<optimized out>, args=...) at /usr/include/kpluginfactory.h:477
#9  0x00007f818ae94b55 in KPluginFactory::create(char const*, QWidget*, QObject*, QList<QVariant> const&, QString const&) () from /usr/lib64/libkdecore.so.5
#10 0x00007f818b7b9636 in KIPI::PluginLoader::Info::plugin() const () from /usr/lib64/libkipi.so.9
#11 0x0000000000418a08 in _start ()

Possible duplicates by query: bug 307114.

Reported using DrKonqi
Comment 1 Marcel Wiesweg 2012-10-03 14:46:12 UTC
Dear ksnapshot guys, this is not your fault!
Comment 2 Marcel Wiesweg 2012-10-03 14:50:10 UTC
This crash is the inverse to the problems we had with libkipi1 plugins being loaded into a libkipi2 app.

1) A libkipi1 app loads a libkipi2 plugin
2) The plugin's constructor is combined with the KIPI::Plugin constructor from libkipi1, as the symbol name does not differ
3) The plugin's constructor calls setUIBaseName. This symbol does not exist in libkipi1, so the code from libkipi1 is called
4) KIPI::Plugin::setUIBaseName accesses d->uiBaseName. As the constructor of KIPI::Plugin libkipi1 was used, Plugin::Private does not contain this field.
5) Invalid memory is accessed.

Ideas?
Comment 3 caulier.gilles 2012-10-03 15:47:40 UTC
Marcel,

This problem is fixed for me since current code from git/master (libkipi and kipi-plugins).

libkipi 2.0.0 will only load kipi-plugins 3.0.0. Older version of plugins will be ignored. We use a version id in all plugins desktop file to see which libkipi SO id have been used to compile tools.

Gilles Caulier
Comment 4 Marcel Wiesweg 2012-10-03 16:11:55 UTC
The case of libkipi 2.x loading kipi-plugins <3.0 is fixed.
This is about libkipi 1.x loading kipi-plugins 3.0.
And libkipi 1.x is out there on users' systems with KDE 4.9, which means we cannot fix it by updating libkipi 1.x anymore. Assuming libkipi 2.x will come with KDE 4.10, there is a time span during which installing digikam 3.0 & associated libraries will, unfriendly, make KDE 4.9 apps crash, not digikam, but KSnapshot etc.

I dont have a good idea how to fix it atm.
Comment 5 Jekyll Wu 2012-11-07 06:53:17 UTC
*** Bug 309677 has been marked as a duplicate of this bug. ***
Comment 6 caulier.gilles 2013-01-21 06:57:40 UTC
*** Bug 313577 has been marked as a duplicate of this bug. ***
Comment 7 caulier.gilles 2013-02-13 06:04:54 UTC
*** Bug 315033 has been marked as a duplicate of this bug. ***
Comment 8 caulier.gilles 2013-10-31 07:52:43 UTC
digiKam 3.5.0 is out.

Can you give a fresh feedback about your report ? Crash still reproducible ?

Thanks in advance

Gilles Caulier
Comment 9 caulier.gilles 2014-05-16 07:29:23 UTC
digiKam 4.0.0 is out :

http://www.digikam.org/node/713

Please check if this entry still valid with this new version.

Thanks in advance

Gilles Caulier
Comment 10 caulier.gilles 2014-09-05 20:55:23 UTC
This file still valid using last digiKam 4.2.0 ?

Gilles Caulier
Comment 11 caulier.gilles 2015-06-25 13:11:54 UTC
New digiKam 4.11.0 is available with official PKG installer for OSX.

https://www.digikam.org/node/740

Can you reproduce the problem with this release ?
Comment 12 caulier.gilles 2015-08-20 06:48:08 UTC
digiKam 4.12.0 is out :

https://www.digikam.org/node/741

We need a fresh feedback using this release please...
Thanks in advance.

Gilles Caulier
Comment 13 caulier.gilles 2016-07-02 19:43:16 UTC
With digiKam 5.0.0, this problem is not reproducible.

I close this file now. Re-open it if necessary.

Gilles Caulier