tracker issue : CF-3505517

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

Weird transaction issue with implicit struct and array

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Chia Ching Tan / Chia Ching Tan (Chia Ching Tan)

Created: 02/24/2013

Components: Language, CF Component

Versions: 9.0.1

Failure Type: Data Corruption

Found In Build/Fixed In Build: 9.0.1 / 284722

Priority/Frequency: Critical / All users will encounter

Locale/System: English / Windows 7

Vote Count: 4

Duplicate ID:	CF-3482734

Problem Description:
When passing implicit struct and array in to a cffunction from a cfcomponent, we are getting very weird result when execute within a transaction

Steps to Reproduce:
1) Download the zip file
2) extract to your web folder
3) open mycfc.cfm from any browser

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3505517

External Customer Info:
External Company:  
External Customer Name: Jeremy Tan
External Customer Email:  
External Test Config: My Hardware and Environment details:

Windows 7 with IIS 7.5

Coldfusion 9.0.1 and Coldfusion 10

Attachments:

  1. February 25, 2013 00:00:00: 1_myTest.zip
  2. February 27, 2013 00:00:00: 2_myTest.zip
  3. February 27, 2013 00:00:00: 3_myTest_-_with_workaround.zip

Comments:

Tested on both 9.0.1 and 10. Both having the same result
Comment by External U.
16203 | February 24, 2013 06:23:07 PM GMT
I am adding my vote is that is a Parsing/Syntax bug and needs to be corrected.
Vote by External U.
16211 | February 26, 2013 02:36:27 PM GMT
It appears that using inline Arrays or Structures paramaters within a transactions cause unexpected behaviour. I have two situations which cause behaviour that I do not expect. // mycfc.cfc (Same for both case) <cfcomponent output="false"> <cffunction name="print" output="true" returntype="void"> <cfargument name="something" type="any" required="true"> <cfoutput>#something[1]#</cfoutput> </cffunction> </cfcomponent> Case 1 // mycfc.cfm transaction { new mycfc().print(Text1:"hello",something:["Alan"]); new mycfc().print(Text1:"hello",something:["Ben"]); } // Expected Output "Alan Ben" // Acutual Output "Ben Ben" So the first call did not pass Jenny Case 2 // mycfc.cfm transaction { writedump(cgi) new mycfc().print(Text1:"hello",something:["Alan"]); new mycfc().print(Text1:"hello",something:["Ben"]); } // Expected Output "Alan Ben" // Actual Output "Alan Ben Ben" So the writedump is not called but it appears the last line is called twice If you remove the transaction from either case 1 or 2 the expected and actual out are the same. This behaviour does not seem correct to me.
Comment by External U.
16204 | February 26, 2013 02:41:38 PM GMT
Just found a workaround, it is to not use the argument name when calling the function. This is not good if the function have optional arguments.
Comment by External U.
16205 | February 26, 2013 03:08:28 PM GMT
Tested on CF10, same bug.
Comment by External U.
16206 | February 26, 2013 08:24:04 PM GMT
horrible, please fix this
Vote by External U.
16212 | February 27, 2013 01:29:16 PM GMT
The repro is much more simple than so far suggested. One can take out the transaction (any block-level construct will cause this), and the CFC. This is the most pared-down I can get it: <cfscript> if(true) { a=1; // any statement at all f(arg1={key1="value 3"}); // only a problem with named args & struct-literal notation } function f(){ writeDump(arguments); } </cfscript> This is a VERY serious bug, I think -- Adam
Comment by External U.
16207 | February 28, 2013 02:11:26 PM GMT
See my note: it's a lot less of an edge-case than we initially thought. Needs hotfixing I'd say (not just for it to be raised here and forgotten until CF11, I mean). -- Adam
Vote by External U.
16213 | February 28, 2013 02:12:22 PM GMT
Actually... for all intents and purposes, this is the same as the bug I raised earlier: https://bugbase.adobe.com/index.cfm?event=bug&id=CF-3482734
Comment by External U.
16208 | February 28, 2013 02:34:55 PM GMT
You cant even break down the error on a particular case. Sometimes there is an error, sometimes not. Sometimes the values in the struct in a loop are the same... Horrible bug, dont use literal structs in function.
Vote by External U.
16214 | April 24, 2013 03:28:35 AM GMT
Is the build version for the fix correct? It seems suspicionly like the ticket number, not the build number..? -- Adam
Comment by External U.
16209 | October 07, 2013 01:50:58 PM GMT
You are right - it was the bug number indeed. Thanks for pointing that out Adam! Corrected.
Comment by Rupesh K.
16210 | October 07, 2013 08:07:42 PM GMT