Bug 127634 - communication between digikam and its kioslaves broken if size_t != off_t
Summary: communication between digikam and its kioslaves broken if size_t != off_t
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Albums (show other bugs)
Version: 0.8.1
Platform: NetBSD pkgsrc NetBSD
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-19 02:34 UTC by Mark Davies
Modified: 2017-07-25 10:41 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.7.0


Attachments
Fix wrong type (383 bytes, patch)
2006-05-19 02:36 UTC, Mark Davies
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Davies 2006-05-19 02:34:29 UTC
Version:           0.8.1 (using KDE KDE 3.5.2)
Installed from:    NetBSD pkgsrc
Compiler:          gcc 3.3.3 
OS:                NetBSD

On systems where  size_t != off_t communication between digikam and its kioslaves (eg digikamsearch) breaks because the kioslaves try to pass a different sized object from what digikam expects.

Specifically they pass stbuf.st_size which is of type off_t while digikam is expecting a size_t object at that point.  My fix is to change digikam to expect an off_t (I'll attach a patch shortly), alternatively you could cast all the st_size's to size_t but that seems ugly.

This appears to still be a problem with 0.8.2-rc1.

cheers
mark
Comment 1 Mark Davies 2006-05-19 02:36:14 UTC
Created attachment 16166 [details]
Fix wrong type

Patch that fixes type mismatch between digikam and its kioslaves.
Comment 2 caulier.gilles 2006-05-19 07:34:28 UTC
SVN commit 542353 by cgilles:

digikam from stable: fix wrong cast between digikam album lister and kio slave
CCBUGS: 127634

 M  +1 -1      albumlister.cpp  


--- branches/stable/extragear/graphics/digikam/digikam/albumlister.cpp #542352:542353
@@ -313,7 +313,7 @@
     int     albumID;
     QString name;
     QString date;
-    size_t  size;
+    off_t   size;
     QSize   dims;
 
     ImageInfoList newItemsList;
Comment 3 caulier.gilles 2006-05-19 07:35:01 UTC
SVN commit 542354 by cgilles:

digikam from trunk: fix wrong cast between digikam album lister and kio slave
BUG: 127634

 M  +1 -1      albumlister.cpp  


--- trunk/extragear/graphics/digikam/digikam/albumlister.cpp #542353:542354
@@ -323,7 +323,7 @@
     int     albumID;
     QString name;
     QString date;
-    size_t  size;
+    off_t   size;
     QSize   dims;
 
     ImageInfoList newItemsList;
Comment 4 Mark Davies 2006-07-27 03:29:52 UTC
On Friday 19 May 2006 17:35, Gilles Caulier wrote:
[bugs.kde.org quoted mail]

Unfortunately this is still broken in 0.8.2, but now for the reverse reason.
You fixed the above so that albumlister.cpp was expecting an off_t but someone 
also fixed the other end so that they now pass a size_t:

eg. kioslaves/digikamalbums.cpp now has:

	*os << static_cast<size_t>(stbuf.st_size);

so there is still a mismatch in the size of the argument that each side is 
sending/expecting.

cheers
mark
Comment 5 caulier.gilles 2017-07-25 10:41:07 UTC
This problem is relevant of digiKam KIO slaves which are dropped since version 5.0.0 in favor of a multithreaded interface to query the database. It will not reproducible.