tracker issue : CF-3698426

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

CF internal _TEMPINDEX variable bleeds into CFC variables scope

| View in Tracker

Status/Resolution/Reason: Closed/Deferred/HighRisk

Reporter/Name(from Bugbase): Aaron Shurmer / Aaron Shurmer (Aaron Shurmer)

Created: 01/23/2014

Components: General Server

Versions: 10.0

Failure Type: Memory Leak

Found In Build/Fixed In Build: Final /

Priority/Frequency: Major / Some users will encounter

Locale/System: English / Win 2008 Server R2 64 bit

Vote Count: 0

Problem Description: 
Coldfusion has an internal variable bleed into the variables scope of CFC's

basically, it appears that CF is caching the string value of a structure index if it is used more than once in a function, so lets say we access temp[-1] a few times, or even temp[local.someVariable & "-" & local.someOtherVariable]
cf will optimize this by storing the value of the index away for use next time it needs it. however, this storage bleeds into the variables scope so we see variables appear in our variables scope like the following:
_TEMPINDEX1220474724 - "-1" 
_TEMPINDEX360946627 - "-1" 

Steps to Reproduce:
create a CFC, run a function with a string index being used a few times to index a structure, then dump the variables scope after running the function, you will see the _tempindex variables bleed into your CFC.

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

Watson Bug ID:	3698426

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



Aaron, is it possible for you to add some sort of repro case here? I do see we create this temp var but not very sure under which specific cases this is being done.
Comment by Awdhesh K.
13613 | February 14, 2014 01:54:36 AM GMT
give this a go. <cfcomponent output="false"> <cffunction name="temp" access="remote"> <cfdump var="#variables#"> <cfscript> local.delayedFireEvents = {}; lock timeout="10" throwontimeout="yes" name="#application.applicationName#.delayedFireEvents" type="EXCLUSIVE" { local.delayedFireEvents["0_" & 0] = { }; } </cfscript> <cfdump var="#variables#"> </cffunction> </cfcomponent>
Comment by External U.
13614 | February 17, 2014 04:57:31 PM GMT
the cfscript and the lock are irrelevant to the issue btw.
Comment by External U.
13615 | February 17, 2014 04:59:20 PM GMT
Thanks Aaron . Bug Verified (Comment added from ex-user id:vnigam)
Comment by Adobe D.
13616 | February 18, 2014 01:27:15 AM GMT