tracker issue : CF-4205210

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

java.lang.VerifyError for code construct within CFC/try-catch (<cfreturn anyFunction({})>)

| View in Tracker

Status/Resolution/Reason: To Fix//BugVerified

Reporter/Name(from Bugbase): Alexandre P. / ()

Created: 09/13/2019

Components: Core Runtime, Parser/Compiler

Versions: 2016,2018

Failure Type: Incorrect w/Workaround

Found In Build/Fixed In Build: 2018.0.04.314546 /

Priority/Frequency: Normal / Some users will encounter

Locale/System: / Win 2016

Vote Count: 1

Problem Description: When the java-compiled CFC class is loaded it throws a java.lang.VerifyError. It seems like the java bytecode compiled by the ColdFusion's compiler is invalid when compiling the code in "Steps to Reproduce". 

Steps to Reproduce:

1. Create Test.cfc that contains the following code:

{code:java}
<cfcomponent>
	<cffunction name="someFunction">    	
        <cftry>
	     <cfcatch>
                <cfreturn anyFunction({})>
            </cfcatch>
        </cftry>
    </cffunction>
</cfcomponent>
{code}


2. Run the following:
{code:java}
<cfset t = new Test()>
{code}


Actual Result:

java.lang.VerifyError: (class: cfTest2ecfc1631497326$funcSOMEFUNCTION, method: runFunction signature: (Lcoldfusion/runtime/LocalScope;Ljava/lang/Object;Lcoldfusion/runtime/CFPage;Lcoldfusion/runtime/ArgumentCollection;)Ljava/lang/Object;) Register 12 contains wrong type at cfTest2ecfc1631497326.<clinit>(D:\inetpub\wwwroot\@users\...\migration_tests\bugs_and_breaking\verify_error\err2\Test.cfc) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) at coldfusion.runtime.TemplateClassLoader.newInstance(TemplateClassLoader.java:621) at coldfusion.runtime.TemplateClassLoader.newInstance(TemplateClassLoader.java:592) at coldfusion.runtime.TemplateProxyFactory.getCFCInstance(TemplateProxyFactory.java:289) at coldfusion.runtime.TemplateProxyFactory.resolveName(TemplateProxyFactory.java:182) at coldfusion.runtime.TemplateProxyFactory.resolveName(TemplateProxyFactory.java:162) at coldfusion.runtime.TemplateProxyFactory.resolveName(TemplateProxyFactory.java:152) at coldfusion.cfc.ComponentProxyFactory.getProxy(ComponentProxyFactory.java:74) at coldfusion.cfc.ComponentProxyFactory.getProxy(ComponentProxyFactory.java:56) at coldfusion.runtime.CFPage.___createObjectInternal(CFPage.java:14323) at coldfusion.runtime.CFPage._createObject(CFPage.java:14305) at cfindex2ecfm1416188483.runPage(D:\inetpub\wwwroot\@users\...\migration_tests\bugs_and_breaking\verify_error\err2\index.cfm:1) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:262) at coldfusion.tagext.lang.IncludeTag.handlePageInvoke(IncludeTag.java:729) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:565) at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:557) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:43) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:162) at coldfusion.filter.IpFilter.invoke(IpFilter.java:45) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:96) at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:78) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:60) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62) at coldfusion.CfmServlet.service(CfmServlet.java:226) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:311) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:46) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:47) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at coldfusion.inspect.weinre.MobileDeviceDomInspectionFilter.doFilter(MobileDeviceDomInspectionFilter.java:57) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:47) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357) at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:422) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.base/java.lang.Thread.run(Thread.java:834) 

Expected Result: No error should be thrown

Any Workarounds:

Avoid in-lining the object literal in the function call:

<cfset var obj = {}>
<cfreturn anyFunction(obj)>

Attachments:

Comments: