Copy link to clipboard
Copied
I recently started using CFB 2. Going into an old application and editing some of its files, I noticed that it freezes repeatedly with a particular file. It uses the old cfx_image and I was updating it to use CFIMAGE at multiple loctions within the file. Not sure what might be going on. Text of the file is attached.
Thanks
Khaled
=======================
<cfinclude template="../ActLockEnforce.cfm">
<!--- THIS PAGE USES CFX_IMAGE --->
<!--- CREATES THUMBNAILS ON THE FLY AND SPECIFIES THE SIZE --->
<cfmodule template="../tags/autoresize.cfm" filefield="PicFile" imagepath="#ExpandPath('../picFiles/')#" thumbpath="#ExpandPath('../ThumbsFiles/')#" thumbsize="150">
<!--- maxsize="450" --->
<!--- IF THE PICTURE FILE IS TOO BIG, SOUND A WARNING AND ROLLBACK THE WHOLE PROCEDURE --->
<!--- DEBUG: checkignsize <br> --->
<cfif photoSize GT (request.picSize*1000)>
<!--- DEBug: pic too big<br> --->
<cfset size = photosize\2000>
<cfset d =
<!--- <cfoutput >#expandpath('../pic/#photo#')#<br>
size is #size#</cfoutput>
<cfabort> --->
<!--- debug: deleting pic & thujmb<br> --->
<cffile action="DELETE" file="#expandpath('../picFiles/#photo#')#">
<cffile action="DELETE" file="#expandpath('../ThumbsFiles/#photo#')#">
<cfoutput>
<script>
alert('Your uploaded file was #size# KB. \n The maximum file size you can upload is #request.picSize# KB. \n Your operation has been cancelled')
</script>
</cfoutput>
<cfinclude template="../queries/qryGetCategories.cfm">
<cfset attributes.fuseaction="UpLoadForm">
<cfinclude template="index.cfm" >
<cfelseif TheWidth LT request.minwidth><!--- if the picture is too narrow, stop --->
<!--- debug: picture too narrow<br> --->
<cffile action="DELETE" file="#expandpath('../picFiles/#photo#')#">
<cffile action="DELETE" file="#expandpath('../ThumbsFiles/#photo#')#">
<cfoutput>
<script>
alert("The width of the uploaded picture is #TheWidth# pixels, too small for display. \n The minimum width required is #request.minwidth# pixels. \n Please resize your picture and upload again. \n Your operation has been cancelled ")
</script>
</cfoutput>
<cfinclude template="../queries/qryGetCategories.cfm">
<cfset attributes.fuseaction="UpLoadForm">
<cfinclude template="index.cfm" >
<cfelse><!--- if the picture size is ok, insert the water mark logo5 --->
<!--- debug: putting water mark<br>
<CFX_IMAGE
ACTION="PASTE"
FILE="#expandpath('..\graphics\logo5.gif')#"
TO_FILE="#expandpath('..\PicFiles\#photo#')#"
OUTPUT="#expandpath('..\PicFiles\#photo#')#"
x="0"
y="0"
transparent="yes"
origin="top"> --->
<cfimage action="read" name="thephoto" source="#expandpath('..\PicFiles\#photo#')#" >
<!--- insert into PIX table --->
<!--- "TheWidth comes from cfx_image in the AutoResize Custom tag --->
<cflock timeout="2" throwontimeout="No" type="READONLY" scope="SESSION">
<cfset memberID = session.memberID>
</cflock>
<cfmodule template="../tags/max_ID.cfm"
datasource="#request.DSN#"
tablename="pix"
primarykey="picID">
<cfquery username="#request.SQLusername#" password="#request.SQLpassword#" name="ActInsertPic" datasource="#request.dsn#" >
INSERT into pix (picID, PicFile, PicThumbFile, CategoryID, OwnerID,
forSale, StatusID, DatePosted,PicTitle, PicInfo, width, height )
VALUES (#max_id#, '#photo#', '#photo#', #CategoryID#, #memberID#, #forSale#, #request.newstatus#, #CreateODBCDateTime(Now ())#, '#HTMLEditFormat(PicTitle)#', '#HTMLEditFormat(PicInfo)#', #TheWidth#, #TheHeight#)
</cfquery>
<!--- insert a blank line in the VOTESPIX table so you can retrieve pictures, even if the picture does not have any votes in queries/ActSearch.cfm --->
<cfquery username="#request.SQLusername#" password="#request.SQLpassword#" name="insertvote" datasource="#request.dsn#" dbtype="ODBC">
INSERT into VotesPics (picID )
VALUES (#max_id#)
</cfquery>
<!--- save max_id before getting new values for KeyWords and Prices --->
<cfset newPicID = max_ID>
<!--- insert keywords --->
<cfloop index="word" list="#attributes.keywords#" delimiters=" ,">
<cfmodule template="../tags/max_ID.cfm"
datasource="#request.DSN#"
tablename="KeyWords"
primarykey="KeyWordID">
<cfquery username="#request.SQLusername#" password="#request.SQLpassword#" name="actInsertKeywords" datasource="#request.dsn#" dbtype="ODBC">
INSERT into KeyWords (KeyWordID, PicID, KeyWord )
VALUES (#max_id#, #newPicID#, '#word#')
</cfquery>
</cfloop>
<cfif attributes.forSale is 1><!--- if picture is for sale, insert prices --->
<cfloop index="sizenumber" from="1" to="#numberOfSizes#">
<!--- <cfif val(attributes.price#sizeNumber#) GT 0> --->
<cfmodule template="../tags/max_ID.cfm"
datasource="#request.DSN#"
tablename="prices"
primarykey="priceID">
<cfquery username="#request.SQLusername#" password="#request.SQLpassword#" name="ActInsertPrices" datasource="#request.dsn#" dbtype="ODBC">
INSERT into prices (priceID, PicID, sizeID,price )
VALUES (#max_id#, #NewPicID#, #sizeNumber#, #evaluate('attributes.price' & sizeNumber)# )
</cfquery>
<!--- </cfif> --->
</cfloop>
</cfif>
<!--- start setting parameters for history insertion --->
<!--- memberID defined above in the session lock --->
<cfset ztransaction = "upload">
<cfset PicID = newPicID>
<!--- <cfif request.costPerPic GT 0 and enforce>if pictue upload is not free --->
<!--- set transaction value to picture upload price
<cfset ztransactionsum = request.costPerPic>--->
<!--- increase number of pix uploaded --->
<!--- <cfinclude template="../queries/ActIncrementPixUploaded.cfm"> incrment when approved, not when uploaded
<cfelse>
<cfset ztransactionSum = 0>
</cfif>--->
<!--- deBUG POINT: inserting histroy<BR> --->
<!--- <cfinclude template="../admin/ActInsertHistory.cfm"> No more hx for upload--->
<cfinclude template="DspUploadLanding.cfm">
</cfif>
Khaled, the error is not in CF but in CFB (two entirely separate processes). Though sometimes CFB does communicate to CF, in this case the error you quoted in the previous message (which was from the CFB error log) means it’s happening in CFB. So restarting CF has nothing to do with the problem.
Ram suspected it might be a circular reference problem, and he’s right: the “stackoverflow” and the hundreds of repeating line pairs in the stack trace you shared is confirmation.
As for if it will be wit
...Copy link to clipboard
Copied
Do you see any errors in the erro log when CFB freezes? If error log view is not already opened, you can open it by invoking menu Window->Show View->Other->General->Error Log.
-Ram
ColdFusion Builder Team.
Copy link to clipboard
Copied
The log file has many entries just from the last few minutes after I reproduced the last crash. There's no way to attach a file on this BB. But I exported it. Some of the entries are about:
-Aptana categories not found
- Unhandled event loop exception
- Dangling meta character.
- Failing to load an extension
etc.
Thanks
Khaled
Copy link to clipboard
Copied
Can you post details of ' Unhandled event loop exception' error, like stack trace?
-Ram
Copy link to clipboard
Copied
Ram
Here it is:
eclipse.buildId=unknown
java.version=1.6.0_24
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86
Error
Fri Feb 17 05:57:56 EST 2012
Unhandled event loop exception
java.lang.StackOverflowError
at java.io.WinNTFileSystem.canonicalize0(Native Method)
at java.io.Win32FileSystem.canonicalize(Unknown Source)
at java.io.File.getCanonicalPath(Unknown Source)
at com.adobe.ide.editor.model.CFMLDOMUtils.resolveIncludedFilePath(CFMLDOMUtils.java:1800)
at com.adobe.ide.editor.model.CFMLDOMUtils.getIncludedUDFs(CFMLDOMUtils.java:1648)
at com.adobe.ide.editor.model.CFMLDOMUtils.getUDFs(CFMLDOMUtils.java:1756)
at com.adobe.ide.editor.model.CFMLDOMUtils.getIncludedUDFs(CFMLDOMUtils.java:1650)
at com.adobe.ide.editor.model.CFMLDOMUtils.getUDFs(CFMLDOMUtils.java:1756)
at com.adobe.ide.editor.model.CFMLDOMUtils.getIncludedUDFs(CFMLDOMUtils.java:1650)
at com.adobe.ide.editor.model.CFMLDOMUtils.getUDFs(CFMLDOMUtils.java:1756)
at com.adobe.ide.editor.model.CFMLDOMUtils.getIncludedUDFs(CFMLDOMUtils.java:1650)
[the last 2 lines repeat numerous times]
LDOMUtils.java:1756)
Copy link to clipboard
Copied
This is a bug and caused by cyclic inclusion of cfm files (e.g. a includes b and b includes a). CFB does not check conditional statments in the code before processing included files. We are in the process of fixing this issue
-Ram
Copy link to clipboard
Copied
But why does it seem to happen with certain cfm files only?
And does this mean it should not happen when I stop the server in CFB? (it still does)
Thanks
Khaled
Copy link to clipboard
Copied
Khaled, the error is not in CF but in CFB (two entirely separate processes). Though sometimes CFB does communicate to CF, in this case the error you quoted in the previous message (which was from the CFB error log) means it’s happening in CFB. So restarting CF has nothing to do with the problem.
Ram suspected it might be a circular reference problem, and he’s right: the “stackoverflow” and the hundreds of repeating line pairs in the stack trace you shared is confirmation.
As for if it will be with certain files, likely yes. It’s about code in one file including another, that then calls the original, and so on.
To be clear, the problem does not happen when you run your page, because as he said the problem in CFB is about it not taking into account coding logic you have that would prevent it happening at runtime. CFB, being an editor, is not “running” your code. They do scan the code, to enable various features to help you in development. This is just one place where you’ve tripped over a known bug. Hopefully you’ll hear again here if/when it’s fixes.
Hope that’s helpful.
/charlie
Copy link to clipboard
Copied
Thanks, Charlie. I guess I'll have to use another editor when needed.