Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COMPILER BUG! REPORT THIS IMMEDIATELY #355

Open
frank-montyne opened this issue Feb 8, 2024 · 0 comments
Open

COMPILER BUG! REPORT THIS IMMEDIATELY #355

frank-montyne opened this issue Feb 8, 2024 · 0 comments

Comments

@frank-montyne
Copy link

frank-montyne commented Feb 8, 2024

I have the following reduced my problem to the foillowing simple script:

import java.util.List;

List aList = [];
for (int index = 0; index < 96; index++) {
	aList.add(index);
}
			
for (int index = 0; index < aList.size(); index++) {
	a = aList[index];
	System.out.println(a);
}

a = aList[index]; fails with a compiler bug the moment the index is equal to 51. Until then everything is fine. I have no idea why. If I use a = aList.get(index); then I get no error.

Any idea what is going on here?
I am running on Java 21 with the latest version of MVEL.

**** COMPILER BUG! REPORT THIS IMMEDIATELY AT http://jira.codehaus.org/browse/MVEL
Expression: import java.util.List;

List aList = [];
for (int index = 0; index < 96; index++) {
	aList.add(index);
}

for (int index = 0; index < aList.size(); index++) {
	a = aList[index];
	System.out.println(a);
}

2024-02-08 15:05:04.182Z n/a|n/a|n/a|n/a|n/a|n/a|[qtp557037330-108]|ERROR|c.b.s.s.r.m.JerseyExceptionMapper Jersey exception
java.lang.VerifyError: Bad type on operand stack
Exception Details:
Location:
ASMAccessorImpl_136247507217074047041735.getValue(Ljava/lang/Object;Ljava/lang/Object;Lorg/mvel2/integration/VariableResolverFactory;)Ljava/lang/Object; @27: invokeinterface
Reason:
Type 'java/lang/Object' (current frame, stack[1]) is not assignable to integer
Current Frame:
bci: @27
flags: { }
locals: { 'ASMAccessorImpl_136247507217074047041735', 'java/lang/Object', 'java/lang/Object', 'org/mvel2/integration/VariableResolverFactory' }
stack: { 'java/util/List', 'java/lang/Object' }
Bytecode:
0000000: 2d12 0eb9 0014 0200 b900 1901 00c0 001b
0000010: 2ab4 001f 2c2d b900 2403 00b9 0028 0200
0000020: b0

at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3549)
at java.base/java.lang.Class.getConstructor0(Class.java:3754)
at java.base/java.lang.Class.getConstructor(Class.java:2442)
at org.mvel2.optimizers.impl.asm.ASMAccessorOptimizer._initializeAccessor(ASMAccessorOptimizer.java:830)
at org.mvel2.optimizers.impl.asm.ASMAccessorOptimizer.compileAccessor(ASMAccessorOptimizer.java:957)
at org.mvel2.optimizers.impl.asm.ASMAccessorOptimizer.optimizeAccessor(ASMAccessorOptimizer.java:345)
at org.mvel2.optimizers.dynamic.DynamicGetAccessor.optimize(DynamicGetAccessor.java:95)
at org.mvel2.optimizers.dynamic.DynamicGetAccessor.getValue(DynamicGetAccessor.java:65)
at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:108)
at org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:38)
at org.mvel2.ast.AssignmentNode.getReducedValueAccelerated(AssignmentNode.java:116)
at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
at org.mvel2.compiler.CompiledExpression.getDirectValue(CompiledExpression.java:115)
at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:111)
at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:98)
at org.mvel2.ast.ForNode.getReducedValue(ForNode.java:76)
at org.mvel2.MVELInterpretedRuntime.parseAndExecuteInterpreted(MVELInterpretedRuntime.java:112)
at org.mvel2.MVELInterpretedRuntime.parse(MVELInterpretedRuntime.java:58)
at org.mvel2.MVEL.eval(MVEL.java:142)
at com.bynubian.scriptengine.mvel.MVELEngine$Evaluator.execute(MVELEngine.java:137)
at com.bynubian.scriptengine.AbstractScriptEngine$Evaluator.execute(AbstractScriptEngine.java:362)
at com.bynubian.shared.entities.resource.ScriptingResource.execute(ScriptingResource.java:272)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:146)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:189)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:176)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:93)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:478)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:400)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81)
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:261)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
at org.glassfish.jersey.internal.Errors.process(Errors.java:244)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:240)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:697)
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:357)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:311)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)
at org.eclipse.jetty.ee10.servlet.ServletHolder.handle(ServletHolder.java:736)
at org.eclipse.jetty.ee10.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1614)
at org.eclipse.jetty.ee10.servlet.ServletHandler$MappedServlet.handle(ServletHandler.java:1547)
at org.eclipse.jetty.ee10.servlet.ServletChannel.dispatch(ServletChannel.java:797)
at org.eclipse.jetty.ee10.servlet.ServletChannel.handle(ServletChannel.java:428)
at org.eclipse.jetty.ee10.servlet.ServletHandler.handle(ServletHandler.java:464)
at org.eclipse.jetty.ee10.servlet.SessionHandler.handle(SessionHandler.java:703)
at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:761)
at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:594)
at org.eclipse.jetty.server.Server.handle(Server.java:179)
at org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker.run(HttpChannelState.java:594)
at org.eclipse.jetty.server.internal.HttpConnection.onFillable(HttpConnection.java:424)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:322)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:99)
at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:478)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:441)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:293)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:201)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:410)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:971)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1201)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1156)
at java.base/java.lang.Thread.run(Thread.java:1583)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant