Bug 210969 - crash when saving images in editor
Summary: crash when saving images in editor
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Portability-Runtime (show other bugs)
Version: 1.0.0
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-18 14:34 UTC by Paolo Masulli
Modified: 2017-08-08 09:50 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 1.0.0


Attachments
gdb output (7.48 KB, text/plain)
2009-10-22 20:44 UTC, Paolo Masulli
Details
Debugview output (8.76 KB, text/plain)
2009-10-22 20:45 UTC, Paolo Masulli
Details
Patch with KUrl (801 bytes, patch)
2009-12-17 23:18 UTC, David Eriksson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paolo Masulli 2009-10-18 14:34:06 UTC
Version:           1.0.0-beta5 (using 4.3.2 (KDE 4.3.2), MS Visual Studio 2008 SP1)
Compiler:          cl.exe
OS:                Microsoft Windows (i686) release 6.0 (Vista Professional)

I experience problems when saving images in the editor. 

1) When saving an exiting image overwriting it (i.e. i press the "Save" button), I get the following error:

Could not open a temporary file in the folder "/E:/my/photo/directory/": The filename, directory name, or volume label syntax is incorrect. (5)

Notice the initial slash in the file path: maybe related with https://bugs.kde.org/show_bug.cgi?id=205341 ?
If I click OK, Digikam freezes and I have to terminate it via Task Manager.


2) If I save the image with "Save as...", choosing a new filename, Digikam just crashes and a Windows' popup says "digikam.exe has stopped working".

Please ask if more details are needed.
Comment 1 caulier.gilles 2009-10-18 17:34:03 UTC
Yes, we need a backtrace.

Gilles
Comment 2 Dario Andres 2009-10-21 16:09:19 UTC
This link could help you: http://techbase.kde.org/Development/Tutorials/Debugging/Debugging_on_MS_Windows

Regards
Comment 3 Marcel Wiesweg 2009-10-22 19:04:17 UTC
Tried to test this here, but the code path hitting the error condition in EditorWindow::setupTempSaveFile does not lead to a freeze here. So I can't reproduce.
Comment 4 Paolo Masulli 2009-10-22 20:44:30 UTC
Created attachment 37743 [details]
gdb output
Comment 5 Paolo Masulli 2009-10-22 20:45:29 UTC
Created attachment 37745 [details]
Debugview output
Comment 6 Paolo Masulli 2009-10-22 20:46:44 UTC
(In reply to comment #2)
> This link could help you:
> http://techbase.kde.org/Development/Tutorials/Debugging/Debugging_on_MS_Windows
> 
> Regards

I tried to follow these instructions.
I attached the files NABUCCO.LOG from Debugview and gdb.txt from gdb.
Comment 7 Marcel Wiesweg 2009-10-23 18:54:51 UTC
Unfortunately this backtrace is not helpful, looks broken. I'm sorry I have never debugged on Windows.
Comment 8 David Eriksson 2009-10-27 15:06:24 UTC
I can confirm both problems.
I think the first is related to bug #205341. KUrl:directory() uses path() and not toLocalFile so it gives a starting / with KDE 4.3. This can be seen in otrher places to, like in image information in right sidebar where Directory is given and it also starts with a /.

The second problem may not be just a Digikam problem since for me Kate also crashes the same way on Save as. When run under gdb I get the following:

Program received signal SIGSEGV, Segmentation fault.
0x09afc659 in KFileDialog (this=0x2479cc90, startDir=@0x23bb4c, filter=@0x23bc74, 

parent=0x22f74490,
    customWidget=0x22431a30)
    at 

C:\kde\kde-mingw4-stable\build\kde-4.3\kdelibs-20080202\work\kdelibs-4.3.2\kio\kfile\kfiledialog.cpp:238
238     in 

C:\kde\kde-mingw4-stable\build\kde-4.3\kdelibs-20080202\work\kdelibs-4.3.2\kio\kfile\kfiledialog.cpp

I am running KDE 4.3.2 mingw4 from installer with self-compiled Digikam.
Comment 9 caulier.gilles 2009-10-27 15:12:21 UTC
Yes: under windows, KDE 4.3.2, I can reproduce the crash with kate and showfoto when File/Open is used...

Gilles Caulier
Comment 10 Marcel Wiesweg 2009-11-27 20:49:14 UTC
Gilles, is this a kdelibs crash? Any improvement after the coding sprint work on Windows?
Comment 11 David Eriksson 2009-12-09 22:46:18 UTC
No more crash with KDE 4.3.4 and digikam from svn. However both Save and Save As gives problem 1. This is since KUrl::directory() uses KUrl::path().
Is it possible to change it to toLocalFile() and use the whole filename as start for the temporaryfile?
Comment 12 caulier.gilles 2009-12-09 23:28:58 UTC
Marcel,

As David said, ye i think it's solved now in kdelibs

Gilles
Comment 13 Marcel Wiesweg 2009-12-10 20:32:11 UTC
It seems to me now that KUrl::directory() is pretty useless for local files, there is no proper replacement method (like "toLocalDirectory")
What should we use to emulate this?

KUrl parent(url.directory()); parent.toLocalFile();

QFileInfo info(url.toLocalFile()); info.dir().path();
Comment 14 David Eriksson 2009-12-17 23:18:10 UTC
Created attachment 39131 [details]
Patch with KUrl

This must be fixed before release. The attached patch uses Marcels first suggestion. It works for me with both Save and Save As.
Comment 15 caulier.gilles 2009-12-18 15:16:29 UTC
SVN commit 1063417 by cgilles:

apply patch #39131
BUGS: 210969


 M  +6 -0      editorwindow.cpp  


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