[Digikam-devel] [Bug 163602] Race condition during image download from Camera/ USB device: image corruption and/or loss (patch attached)

Roger Larsson roger.larsson at e-gatan.se
Tue Aug 19 21:10:15 BST 2008


http://bugs.kde.org/show_bug.cgi?id=163602





--- Comment #5 from Roger Larsson <roger larsson e-gatan se>  2008-08-19 22:10:14 ---
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.


-- 
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Digikam-devel mailing list