Title:
True application exception is masked by CF's built-in Exception Handler code, resulting in Error while reading header
| View in TrackerStatus/Resolution/Reason: Closed/Withdrawn/
Reporter/Name(from Bugbase): Steven Erat / Steven Erat (StevenErat)
Created: 03/07/2012
Components: Core Runtime
Versions: 9.0.1
Failure Type: Non Functioning
Found In Build/Fixed In Build: 9.0.1 /
Priority/Frequency: Major / Some users will encounter
Locale/System: English / Windows 7
Vote Count: 1
Problem Description:
ColdFusion's default exception handler WEB-INF\exception\coldfusion\runtime\ApplicationException.cfm (and TemplateNotFoundException.cfm) make use of WEB-INF/exception/exception_en.xml and in turn WEB-INF/cftags/savecontent.cfm, which are all built-in to ColdFusion.
When an unhandled exception occurs and ColdFusion's built-in exception handler code is triggered in order to present the familiar blue screen showing the Robust Exception details, the CF exception handler attempts to report on a variety of request information such as the date and time, or the referrer, or the stack trace as well as many other fields. Part of that handling includes calls to cfsavecontent which is implemented as the custom tag in WEB-INF/cftags/. The way in which the content is generated in the savecontent tag may cause ColdFusion to try to resolve some of those important error keys like browser, referrer, and stack trace by looking them up in various scopes including the CGI scope.
However, if the user has closed their browser, clicked away, or a network interruption occured, the TCP connection between the browser and the webserver connector may have been broken. When ColdFusion attempts to resolve a CGI variable the request will ask the connector, and the connector will try to make use of the TCP handle back to the browser. If the connection was terminated, then the connector may report an "Error while reading header <headername>" back to the request, which in turn gets logged by CF.
The problem there is that the original application error that was being handled by CF's built-in exception handlers is thrown away when ColdFusion tries to resolve one of the exception variables and tries to look in the CGI scope but instead encounters a dead TCP connection still held by the connector stub. The original application exception is never logged, only the downstream "Error while reading header".
Users may never see this because the problem typically occurs with a broken or closed browser session.
Related links about this issue:
http://stackoverflow.com/questions/9473252/why-does-a-coldfusion-implicit-setter-end-up-making-networking-calls/9607378#9607378
http://corfield.org/blog/index.cfm/do/blog.entry/entry/isDefined_vs_structKeyExists
http://www.coldfusionmuse.com/index.cfm/2009/8/6/examining.isDefined
http://www.mail-archive.com/cf-talk@houseoffusion.com/msg196119.html
http://mail.pukkasoft.com/archives/?0::16828
http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:37354
http://forums.adobe.com/thread/790175
Steps to Reproduce:
Create a long running request. It could just do something like sleep(120000) to sleep for 2 minutes.
Make sure the page or cfadmin timeout permits it run that long.
After the sleep, do an isDefined on a key known to not exist in any scope, like isDefined("myUniqueKeyFoundNowhere");
Enable robust exceptions in CF Admin debug page.
Request that long running page from a browser.
Close the browser while request is sleeping.
Check the logs when the request is finished.
Actual Result:
Exception handler code built into CF blocks logging of true application error
Expected Result:
Application error is logged and handled properly with the built-in exception handler
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3132879
Deployment Phase: Release Candidate
External Customer Info:
External Company:
External Customer Name: StevenErat
External Customer Email:
External Test Config: Reproduces on any platform with ColdFusion 7.x, 8.x, and 9.x.
Attachments:
Comments: