Title:
[ANeff] Bug for: CF11 vs CF2016 - cfwddx now throws StackOverflow when using extends
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)
Created: 07/15/2016
Components: Language, WDDX Serialization
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
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.
Repro:
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:
Application.cfc
--------------------------------------------
component {THIS.name = "ticket_CFWDDXThrowsStackOverflowWhenUsingExtends";}
index.cfm
--------------------------------------------
<cfset writeDump(invoke("MyCFC1", "foo"))>
MyCFC1.cfc
--------------------------------------------
component extends="MyCFC2" {function foo() {cfwddx(action="cfml2wddx", input=local, output="local.r");return local.r;}}
MyCFC2.cfc
--------------------------------------------
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
Workarounds:
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:
MyCFC1.cfc
--------------------------------------------
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:
Attachments:
Comments: