tracker issue : CF-4172952

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

[ANeff] Bug for: CF11 vs CF2016 - cfwddx now throws StackOverflow when using extends

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

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

Created: 07/15/2016

Components: Serialization, WDDX

Versions: 2016

Failure Type:

Found In Build/Fixed In Build: CF2016_Update2 /

Priority/Frequency: Major / Some users will encounter

Locale/System: English / Win All

Vote Count: 0

Listed in the version 2016.0.03.300466 Issues Fixed doc
In CF11, serializeJSON(local) and cfwddx(action="cfml2wddx", input=local, ..) skip serialization of THIS scope - even if CFC extends another CFC. Good.

In CF2016, cfwddx tries to serialize the THIS scope, if CFC extends another CFC. Bad. If extended CFC is edited/re-saved, then error goes away. If CF is restarted or "Clear Template Cache Now" is clicked, in CF Admin, then error comes back.

Verified correct behavior in CF11 Update 7 (build 11,0,07,296330).
Verified incorrect behavior in CF2016 Final (build 2016.0.0.297996), Update 1 (build 2016.0.01.298513) and Update 2 (build 2016.0.02.299200). Even w/ JVM Heap Size min=4096 and max=15360.


1) On CF Admin's Caching page, uncheck all caching settings, then set "Maximum number of cached templates" to something like 1024 or whatever, then click "Submit Changes".
2) Run this app in CF11 and CF2016:

component { = "ticket_CFWDDXThrowsStackOverflowWhenUsingExtends";}

<cfset writeDump(invoke("MyCFC1", "foo"))>

component extends="MyCFC2" {function foo() {cfwddx(action="cfml2wddx", input=local, output="local.r");return local.r;}}

component {function bar() {return "bar";}}

Actual result in CF2016: 1) WDDX'd result is not displayed, 2) java.lang.StackOverflowError written to exception.log

Actual result in CF11 (and expected result in CF2016): WDDX'd result is displayed

1) Edit/re-save MyCFC2.cfc (ex: change {return "bar";} to {return "bar2";}). However, this workaround is only temporary. If CF is restarted, or template cache is cleared, then error comes back.
2) Replace cfwddx w/ serializeJSON(). However, this is not a valid workaround b/c serializeJSON() is not a complete replacement for cfwddx (ex: cfwddx honors such things as query column types and will eventually honor struct ordering).
3) Change MyCFC1.cfc to:

component extends="MyCFC2" {function foo() {var temp=duplicate(local); temp.this=""; cfwddx(action="cfml2wddx", input=temp, output="local.r"); return local.r;}}

However, that is not a valid workaround b/c temp and local are not identical. So the WDDX'd result cannot be deserialized back to a duplicate of local.

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

Watson Bug ID:	4172952

External Customer Info:
External Company:  
External Customer Name: Aaron Neff
External Customer Email:



This issue is resolved now. The fix for this issue will be available as part of an upcoming update of ColdFusion 2016.
Comment by Nimit S.
2185 | August 08, 2016 06:50:18 AM GMT