tracker issue : CF-4200155

select a category, or use search below
(searches all categories and all time range)
Title:

cfimage operation file lock prevents subsequent file deletion

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/Workaround

Reporter/Name(from Bugbase): Charles Robertson / Charles Robertson ()

Created: 11/18/2017

Components: CFIMAGE

Versions: 11.0

Failure Type: Incorrectly functioning

Found In Build/Fixed In Build: CF11,0,3,292866 64bit /

Priority/Frequency: Normal / All users will encounter

Locale/System: English / Windows 10 64 bit

Vote Count: 1

Problem Description:

Whenever a <cfimage> operation is carried out, the file becomes locked and so cannot be deleted, using either <cffile action="delete"> or a manual deletion, until Coldfusion Server is restarted. 

Steps to Reproduce:

Upload file A. Use cfimage to read, crop & then write the file back. Then carry out a cffile delete action

Actual Result:

An exception is thrown: 

ColdFusion could not delete the file C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/cache/file/brand-logo-email/5E797506 -84A6-C828-BCCF23F51DB922B1.png for an unknown reason.

Expected Result:

File A should be deleted

Any Workarounds:

No workarounds

Attachments:

  1. November 20, 2017 00:00:00: cf1103-cfimage-bug.cfm

Comments:

This bug may or may not be dependent on uploading the file first before the cfimage operation & subsequent file deletion. In my test cases, I always uploaded a file using cffile action=upload, but the file deletion exception may not be dependent on this step. I do know that I was able to delete files successfully after a file upload but without the cfimage operation step. A cfimage operation followed by a file deletion always threw an exception. Could you create a patch for this issue rather than an update, because I cannot update beyond CF11 update 3, for various reasons.
190 | November 18, 2017 11:24:37 PM GMT
Interestingly, to prevent an error being thrown after using CF native ImageGetWidth() & ImageGetHeight(), I have found out that if you use java to find out the width & height, an exception is not thrown upon a subsequent deletion: So: Read image width & height, using: <cfset local.imageObj = createObject("java","java.awt.Toolkit")> <cfset local.imagetools = local.imageObj.getDefaultToolkit()> <cfset local.objImage = local.imagetools.getImage(local.filepath)> <cfset result["width"] = local.objImage.getWidth()> <cfset result["height"] = local.objImage.getHeight()> <cfset local.objImage.flush()> Then: Use <cffile action=delete> to delete the image file. No error is thrown. If, however one swaps the java method for reading width & height with CF native ImageGetWidth() & ImageGetHeight(), and then execute <cffile action=delete> to delete the image file, an error is thrown! So maybe you could write a simple patch that releases the file by flushing it at the end of the cfimage operation? Thanks
191 | November 19, 2017 06:14:56 PM GMT
I am going to post a test scenario tomorrow, Tuesday, giving you code & instructions on how to reproduce this bug. Ironically, this same bug occurred in CF8, and a hotfix was issued. It seems that in CF11,0,3, it has leaked back into the code base somehow. So, you may be able to reissue the CF8 hotfix, depending on how specific the hotfix was?
192 | November 20, 2017 10:30:06 AM GMT
I have attached a 'cfml' page which you can use to test this scenario: cf1103-cfimage-bug.cfm
193 | November 20, 2017 08:04:55 PM GMT
The other file, called 'image.jpeg' should be deleted. I uploaded this file by mistake, but your system does not allow owners to delete attachments. Maybe, you could add this feature to your tracker module?
194 | November 21, 2017 05:56:47 PM GMT
Deleted the file as requested.
195 | November 22, 2017 03:31:34 PM GMT
Vamseekrishna. Thanks for deleting the file. Are you going to do something about this bug? It is quite a serious issue, because any type of cfimage operation will prevent any type of cffile operation. I think it requires quite a simple fix. The cfimage file needs to be released. Releasing a patch would be the simplest solution, because it means that developers are not forced to update their version of Coldfusion, which can cause even more problems, depending on which minor version is currently installed. Thanks for your help... Charlie
196 | November 24, 2017 07:01:59 PM GMT
Charlie, we will check and get back to you on this. Thanks!
197 | November 25, 2017 05:50:38 AM GMT
Hi Charles, I am able to delete the file after the image operations. Could you please try on the latest update and let us know if you still see the issue with deletion. Also please do share the complete stack trace of the exception. Thanks!
Comment by S Preethi [X]
198 | December 04, 2017 10:11:07 AM GMT
Hi Charles, Could you please do share the complete stack trace of the exception you are getting. Thanks!
Comment by S Preethi [X]
27263 | April 02, 2018 04:16:24 AM GMT
Hi Charles, I am able to delete the file after the image operations. Could you please try on the latest update and let us know if you still see the issue with deletion. Also please do share the complete stack trace of the exception. Thanks!
Comment by S Preethi [X]
29596 | August 22, 2018 06:36:48 AM GMT
Hi Charles, We do see the issue happening on update 3, but do not see the exception on the latest update, that being 14. Also, we strongly recommend you to update your server to the latest hotfix, considering all the important security fixes that have gone in them in various updates, instead of staying on update 3 which would also fix this issue. Thanks!
Comment by S Preethi [X]
29667 | September 05, 2018 06:59:26 AM GMT
We are closing the bug for now. In case you have any concerns please do write to cfsup@adobe.com  Thanks!
Comment by S Preethi [X]
29690 | September 12, 2018 06:02:59 AM GMT