Bug 189156

Summary: digikam crashes on importing directories with some (cyrillic?) file names
Product: [Applications] digikam Reporter: Konstantin <b.m.kast>
Component: Import-UMSAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: andresbajotierra, armarac, marcel.wiesweg
Priority: NOR    
Version: 0.10.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 1.0.0
Sentry Crash Report:
Attachments: A crash log (stack trace etc.)
A stack trace
A log of messages appeared on the console just before the crash.

Description Konstantin 2009-04-08 21:51:17 UTC
Version:            (using KDE 4.2.2)
OS:                Linux
Installed from:    SuSE RPMs

digiKam crashes sometimes when I try importing a directory with some names.
What I've figured out is that the crash happens on one particular name (namely "Мои рисунки", which stands for "My Pictures" and is used as the default photo storage folder in Russian version of Windows Mobile 5). The folder can be exported after renaming it manually. Renaming it to the original name brings the crash back.
Comment 1 Konstantin 2009-04-08 21:52:14 UTC
Created attachment 32707 [details]
A crash log (stack trace etc.)
Comment 2 Dario Andres 2009-04-08 22:30:52 UTC
Pasted part of the backtrace of comment 1:
-----

Thread 2 (Thread 0xa94ffb90 (LWP 30365)):
[KCrash Handler]
#6  0xb57d67e1 in memcpy () from /lib/libc.so.6
#7  0xb5ad887e in QIODevice::read(char*, long long) () from /usr/lib/libQtCore.so.4
#8  0xb5ac36e0 in QDataStream::readRawData(char*, int) () from /usr/lib/libQtCore.so.4
#9  0xb5aa0539 in operator>>(QDataStream&, QString&) () from /usr/lib/libQtCore.so.4
#10 0xb5da0fdb in operator>> (s=@0x85a9730, st=@0xa94fec6c) at /usr/src/debug/kdelibs-4.2.2/kdecore/services/kservice.cpp:52
#11 0xb5da8f2a in operator>><KService::ServiceTypeAndPreference> (s=@0x85a9730, v=@0xa950de7c) at /usr/include/QtCore/qdatastream.h:286
#12 0xb5da2734 in KServicePrivate::load (this=0xa950de40, s=@0x85a9730) at /usr/src/debug/kdelibs-4.2.2/kdecore/services/kservice.cpp:351
#13 0xb5da29bb in KService (this=0xa95013b0, _str=@0x85a9730, _offset=1460571) at /usr/src/debug/kdelibs-4.2.2/kdecore/services/kservice_p.h:41
#14 0xb5dab1a1 in KServiceFactory::createEntry (this=0x85bc1a8, offset=1460571) at /usr/src/debug/kdelibs-4.2.2/kdecore/services/kservicefactory.cpp:181
#15 0xb5daab71 in KServiceFactory::serviceOffers (this=0x85bc1a8, serviceTypeOffset=11456, serviceOffersOffset=<value optimized out>)
    at /usr/src/debug/kdelibs-4.2.2/kdecore/services/kservicefactory.cpp:266
#16 0xb5db8d1a in KServiceTypeTrader::defaultOffers (this=0x85ad2f8, serviceType=@0xa94feeac, constraint=@0xa94feea8) at /usr/src/debug/kdelibs-4.2.2/kdecore/services/kservicetypetrader.cpp:125
#17 0xb5db9605 in KServiceTypeTrader::query (this=0x85ad2f8, serviceType=@0xa94feeac, constraint=@0xa94feea8) at /usr/src/debug/kdelibs-4.2.2/kdecore/services/kservicetypetrader.cpp:141
#18 0x0810533f in Digikam::UMSCamera::loadKDEThumbCreator (this=0xb2ab0120, folder=@0xa94ff284, itemName=@0xa94ff27c, thumbnail=@0xa94ff140)
    at /usr/src/debug/digikam-0.10.0/utilities/cameragui/umscamera.cpp:290
#19 0x08106d1d in Digikam::UMSCamera::getThumbnail (this=0xb2ab0120, folder=@0xa94ff284, itemName=@0xa94ff27c, thumbnail=@0xa94ff140)
    at /usr/src/debug/digikam-0.10.0/utilities/cameragui/umscamera.cpp:270
#20 0x0812bc13 in Digikam::CameraController::executeCommand (this=0xb2ae9498, cmd=0x90d19a0) at /usr/src/debug/digikam-0.10.0/utilities/cameragui/cameracontroller.cpp:439
#21 0x0812cf5c in Digikam::CameraController::run (this=0xb2ae9498) at /usr/src/debug/digikam-0.10.0/utilities/cameragui/cameracontroller.cpp:333
#22 0xb5a5285e in ?? () from /usr/lib/libQtCore.so.4
#23 0xb59ef1b5 in start_thread () from /lib/libpthread.so.0
#24 0xb58323be in clone () from /lib/libc.so.6
Comment 3 Dario Andres 2009-04-08 22:33:17 UTC
The backtrace seems to be related to bug 181428
Thanks
Comment 4 Marcel Wiesweg 2009-04-12 21:44:38 UTC
*** Bug 181428 has been marked as a duplicate of this bug. ***
Comment 5 caulier.gilles 2009-05-12 11:26:51 UTC
Konstantin,

I have implemented some hack in digiKam camera interface to try to clean up this entry. Can you reproduce the crash using current code from svn (0.11.0) ?

Gilles Caulier
Comment 6 Konstantin 2009-05-12 13:24:10 UTC
Gilles, I will check it later today.
Comment 7 Konstantin 2009-05-12 23:05:47 UTC
Gilles,

Sorry for the delay.
Now it allowed me to import all the files once from the source directory on SD card, but the second attempt has failed.
The stack trace and the latest console messages are attached.
Comment 8 Konstantin 2009-05-12 23:08:07 UTC
Created attachment 33595 [details]
A stack trace

A stack trace generated by KDE crash analyzer
Comment 9 Konstantin 2009-05-12 23:09:41 UTC
Created attachment 33596 [details]
A log of messages appeared on the console just before the crash.
Comment 10 Konstantin 2009-05-13 00:29:09 UTC
I've just figured out that it crashes now only when I'm dragging the dialog window with thumbnails inside across the screen while it is loading. It works correctly if I just wait patiently and do not touch that window until it is completely loaded.
Again, no such behavior on folders with Latin-only names.
Comment 11 Marcel Wiesweg 2009-06-14 16:13:00 UTC
digikam(6315)/digikam (core) Digikam::UMSCamera::loadKDEThumbCreator: Mimetype :  "image/jpeg"
digikam(6315)/digikam (core) Digikam::UMSCamera::loadKDEThumbCreator: plugin :  "jpegthumbnail"
KCrash: Application 'digikam' crashing...

These lines give me a hint that the crash comes from loadKDEThumbCreator in UMSCamera. This code has been removed already. Please try again with beta1 or current SVN version.
Comment 12 caulier.gilles 2009-06-14 17:56:25 UTC
Yes, definitively. Code removed and fixed with 1.0.0-beta1.

In fact, you have a video file in your media...

Gilles Caulier
Comment 13 Konstantin 2009-06-14 21:40:28 UTC
Tested that with the latest SVN revision.
Now it works with no crashes, but when I try importing photos
from the same (cursed and damned) folder, the thumbnails are not
shown.
Although everything is imported correctly.

> In fact, you have a video file in your media...

Actually I've tested it both on the whole My Documents folder on an SD card
(containing videos somewhere inside) and on its My Pictures (in Russian)
subfolder containing JPEGs only. Both tests gave the same result.

BTW, if I point it to the My Documents folder (named in English), it displays
thumbnails for all the images from an English-named subfolder, but it shows
default image icons instead for images in the Russian-named directory.
Comment 14 Konstantin 2009-06-14 21:52:47 UTC
Should I post stderr logs for 'correct' and 'incorrect' import here?
Those logs seem to be useless because the differences between the
outputs are in the times elapsed only.
Comment 15 Marcel Wiesweg 2009-06-29 19:20:55 UTC
This is only about the Camera dialog?
Do normal folders in your collection with cyrillic filenames work?
Comment 16 Marcel Wiesweg 2009-07-16 22:47:23 UTC
SVN commit 998017 by mwiesweg:

Remove QFile::encodeName when passing QString

BUG: 189156

 M  +3 -1      NEWS  
 M  +3 -3      utilities/cameragui/umscamera.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=998017