Summary: | Race condition during image download from Camera/ USB device: image corruption and/or loss (patch attached) | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Chris Drexler <kde> |
Component: | Import-UMS | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | critical | CC: | caulier.gilles, roger.larsson |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 0.9.5 | |
Sentry Crash Report: | |||
Attachments: | patch for removing race condition in cameraGUI for downloading images |
Description
Chris Drexler
2008-06-09 13:36:25 UTC
Created attachment 25224 [details]
patch for removing race condition in cameraGUI for downloading images
I can confirm this, both from Compact flash and DVD. This is a new bug for me - recently upgraded to SuSE 11.0 (64 bit) and even more recently to dual core. Severity 'critical' since it can cause loss of data. Roger, The patch from this report is already applied to svn since a long time (I don't know why it have not been closed). digiKam 0.9.4 include it. Please update to this version. Gilles Caulier digicam 0.9.4 was released 2008-07-16, and since the release notes does not contain information about this critical fix - SuSE for one has not picked it up, they still offer 0.9.3-70.1 There is a real chance of data loss with this bug! Let me describe what happens for me. In the download window I note red X on several images. This file names are not imported properly to digikam. Marking them and downloading again succeeds. But what is worse is that it was not really that image that is missing. It overwrote the one before! And you have seemingly correct file names but you lost one file (it will be gone when deleting that image from the memory card) instead you got a duplicate. This can not be seen in the download applet - but check the files in digikam main window. I have reviewed the patch/change. The race was between 'CameraCommand::gp_download' and 'CameraEvent::gp_downloaded' Normally the messages/events arrive 'CameraCommand::gp_download' emits a gp_downloaded("file-PID") 'CameraEvent::gp_downloaded(temp)' 'CameraCommand::gp_download' emits a gp_downloaded("file-PID") 'CameraEvent::gp_downloaded(temp)' And the temp parameter will be the same but it wont matter since processing keeps the sequence. If the message queue becomes 'CameraCommand::gp_download' emits a gp_downloaded("file-PID") 'CameraCommand::gp_download' emits a gp_downloaded("file-PID") 'CameraEvent::gp_downloaded(temp)' 'CameraEvent::gp_downloaded(temp)' But in this case the second gp_download will overwrite the same file as used earlier. Final processing, 'gp_downloaded', will be done with the wrong file contents. And the last 'gp_downloaded' will fail since the file has either been renamed or removed. => this matches the observed behavior. The patch looks OK to me. |