Status/Resolution/Reason: Closed/Withdrawn/Duplicate
Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)
Created: 02/20/2016
Components: Core Runtime
Versions: 2016
Failure Type: Data Corruption
Found In Build/Fixed In Build: CF2016_Final /
Priority/Frequency: Critical / Some users will encounter
Locale/System: English / Platforms All
Vote Count: 0
Duplicate ID: CF-4126397
cfthread causes data corruption in CF2016 but doesn't in CF11.
Here is a cfhttp and a cfhtmltopdf example:
----------------------
cfhttp example
----------------------
index.cfm
----------------------
<cfscript>
SERVER.delete("results");
SERVER.results=[];
for(i=1; i<=100; i++) {
targetURL = 'http://' & CGI.HTTP_HOST & CGI.PATH_INFO & getDirectoryFromPath(CGI.SCRIPT_NAME) & '/mypage.cfm';
thread action="run" name="myThread#variables.i#" myNumber=variables.i targetURL=variables.targetURL {
cfhttp(url=ATTRIBUTES.targetURL, method="post", timeout=10) {
cfhttpparam(type="formfield", name="myField", value=ATTRIBUTES.myNumber);
}
}
}
threadJoin();
writeDump(SERVER.results);
for(item in CFTHREAD) {
if(CFTHREAD[item].keyExists("error")) {
writeDump(CFTHREAD[item].error);
}
}
</cfscript>
mypage.cfm
----------------------
<cfscript>
if(FORM.count()) {
lock name="myLock" type="exclusive" timeout=10 {
if(FORM.count()) {
SERVER.results.append(duplicate(FORM));
}
}
}
</cfscript>
Steps to reproduce: Just run the above code.
Actual result: errors such as:
1) Attribute validation error for CFHTTPPARAM.It requires the attribute(s): TYPE.
2) java.lang.ArrayIndexOutOfBoundsException at java.util.ArrayList.batchRemove(ArrayList.java:726) at java.util.ArrayList.removeAll(ArrayList.java:690) at coldfusion.tagext.net.HttpTag.release(HttpTag.java:373)
3) coldfusion.tagext.net.HttpTag$HttpTagChunkSizeFailureException: The requested page has a content length of -1
4) The cfhttp tag requires at least one cfhttpparam tag for a POST operation.
5) java.lang.Double cannot be cast to java.lang.String (it referenced the cfhttpparam line)
6) java.lang.NullPointerException at coldfusion.tagext.net.HttpTag.setFormData(HttpTag.java:1629) at coldfusion.tagext.net.HttpParamTag.doStartTag(HttpParamTag.java:205)
9) random corruption of the submitted form field values
10) sometimes not all the fields are submitted; and sometimes fields are submitted multiple times
Expected result: No errors
----------------------
cfhtmltopdf example
----------------------
<cfscript>
for(i=1; i<=20; i++) {
thread action="run" name="myThread#variables.i#" myNumber=variables.i {
cfhtmltopdf(name="THREAD.myPDF") {//Bug 1: The "name" attribute is ignored and PDF is rendered in browser
var foo = ATTRIBUTES.myNumber;//workaround for 4120116
cfhtmltopdfitem(type="header") {writeOutput(foo);}//Bug 2: The header sometimes displays the wrong value or doesn't appear at all
writeOutput(ATTRIBUTES.myNumber);
}
}
}
threadJoin();
for(item in CFTHREAD) {
if(CFTHREAD[item].keyExists("error")) {
writeDump(CFTHREAD[item].error);
}
}
</cfscript>
Actual result: 1) The "name" attribute is ignored and PDF is rendered in browser and 2) The header sometimes displays the wrong value or doesn't appear at all
Workaround: JVM arg -Dcoldfusion.udf.reuseTagInstances=false
Related ticket: 4114981
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4120120
External Customer Info:
External Company:
External Customer Name: Aaron Neff
External Customer Email:
Attachments:
Comments: