Bug 860698 - java.lang.VerifyError: JVMVRFY012 stack shape inconsistent
java.lang.VerifyError: JVMVRFY012 stack shape inconsistent
Status: VERIFIED
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRE (Expert, Fusion) (Show other bugs)
BRMS 5.3.0.GA
Unspecified Unspecified
unspecified Severity unspecified
: ER4
: One Off Releases
Assigned To: Mario Fusco
Radovan Synek
:
Depends On:
Blocks: 873846
  Show dependency treegraph
 
Reported: 2012-09-26 10:07 EDT by Geoffrey De Smet
Modified: 2014-10-26 21:13 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
When a declaration double dereferences within the Business Rules Engine, and the value of the method returned by the second dereferencing is a primitive type, the bytecode of the eval class using it is not correctly generated. A java.lang.VerifyError occurs when trying to instance a class from the incorrectly generated bytecode. This has been resolved by fixing the bytecode generator to allow it to work even in these specific primitive dereferencing instances. It is now possible to have an eval class do a double dereferencing, which returns a primitive type without any malformed bytecodes.
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker JBRULES-3657 Major Resolved Eval bytecode not correctly generated 2016-05-24 06:39 EDT

  None (edit)
Description Geoffrey De Smet 2012-09-26 10:07:30 EDT
A customer gets this error with Drools from BRMS 5.3.0.GA, but not with drools community 5.3.0.Final (so it's regression):

Exception in thread "main" java.lang.VerifyError: JVMVRFY012 stack shape inconsistent; class=.../rules/Rule_myrule01Eval0Invoker, method=evaluate(Lorg/drools/spi/Tuple;[Lorg/drools/rule/Declaration;Lorg/drools/WorkingMemory;Ljava/lang/Object;)Z, pc=122
        at java.lang.J9VMInternals.verifyImpl(Native Method)
        at java.lang.J9VMInternals.verify(J9VMInternals.java:72)
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:134)
        at java.lang.J9VMInternals.newInstanceImpl(Native Method)
        at java.lang.Class.newInstance(Class.java:1345)
        at org.drools.rule.JavaDialectRuntimeData.wire(JavaDialectRuntimeData.java:413)


On master this problem is fixed, so it's likely, but not certain that BRMS 5.3.1 will fix it. Currently I have no reproduce recipe. Contact is Prabakar Singaram (RH consultant).
Comment 1 Rick Wagner 2012-09-26 15:16:11 EDT
This bug is manifested in a mixed community / product environment.  Please see the associated support case for customer interactions.

Thanks,

Rick
Comment 2 Lukáš Petrovický 2012-09-27 03:02:15 EDT
Can we have a reproducer, please? 

Also, from the stack trace it would appear that the bug occurs with IBM JVM. Which version? Which platform?
Comment 3 Rick Wagner 2012-09-27 09:40:34 EDT
Hi Lukas,

Fair requests.  We've requested a reproducer, we'll ask for the JVM information as well.

Thanks,

Rick
Comment 4 Rick Wagner 2012-09-27 09:57:11 EDT
Talked to the customer, they are running Oracle JDK 1.6 on Windows.

Thanks,

Rick
Comment 6 Geoffrey De Smet 2012-10-03 11:34:51 EDT
I have been asked to clarify this bug report:

It's a bug in Drools Expert (found by a customer using Planner, but that's irrelevant).
It's a regression from drools community 5.3.0.Final
and this bug prevented the customer from migrating from community to BRMS 5.3.0.Final.

BRMS 5.3.1.Final likely fixes it already, thanks to Mario's fixes.
But without a reproduce recipe or more information (which I do not have), it's impossible to tell.
Comment 7 Edson Tirelli 2012-10-15 09:44:25 EDT
Geoffrey, Rick,

Can we ask the customer to test with the current snapshot of BRMS.5.3.1? 

Until we know if the problem is fixed or not, there isn't much we can do on this ticket. If it is not fixed, then we need a way to reproduce and/or more information. The above stack trace does not tell us much other than the problem is happening on an "eval" invocation.
Comment 10 Geoffrey De Smet 2012-10-15 14:25:36 EDT
Morteza confirmed the bug is still present in BRMS 5.3.1-ER3. "He used the 5.1.0.BRMS.ER3 core/compiler/knowledge-api and mvel2-2.1.3.Final".
Comment 11 Morteza Karyar 2012-10-15 15:44:35 EDT
Getting a similar exception when using Oracle JDK 1.6.0.31: 

Exception in thread "main" java.lang.VerifyError: (class: gov/ssa/asa/rules/Rule_vhrGroupingByLocationEval0Invoker, method: evaluate signature: (Lorg/drools/spi/Tuple;[Lorg/drools/rule/Declaration;Lorg/drools/WorkingMemory;Ljava/lang/Object;)Z) Expecting to find integer on stack
       at java.lang.Class.getDeclaredConstructors0(Native Method)
       at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
       at java.lang.Class.getConstructor0(Class.java:2699)
       at java.lang.Class.newInstance0(Class.java:326)
       at java.lang.Class.newInstance(Class.java:308)
       at org.drools.rule.JavaDialectRuntimeData.wire(JavaDialectRuntimeData.java:413)
       at org.drools.rule.JavaDialectRuntimeData.wire(JavaDialectRuntimeData.java:400)
       at org.drools.rule.JavaDialectRuntimeData.onBeforeExecute(JavaDialectRuntimeData.java:241)
       at org.drools.rule.DialectRuntimeRegistry.onBeforeExecute(DialectRuntimeRegistry.java:134)
       at org.drools.compiler.PackageBuilder.reloadAll(PackageBuilder.java:1025)
       at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:976)
       at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:405)
       at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:380)
       at org.drools.planner.config.score.director.ScoreDirectorFactoryConfig.buildRuleBase(ScoreDirectorFactoryConfig.java:245)
       at org.drools.planner.config.score.director.ScoreDirectorFactoryConfig.buildDroolsScoreDirectorFactory(ScoreDirectorFactoryConfig.java:225)
       at org.drools.planner.config.score.director.ScoreDirectorFactoryConfig.buildScoreDirectorFactory(ScoreDirectorFactoryConfig.java:157)
       at org.drools.planner.config.solver.SolverConfig.buildSolver(SolverConfig.java:142)
       at gov.ssa.asa.service.impl.EngineServiceImpl.configurePlanner(EngineServiceImpl.java:153)
       at gov.ssa.asa.service.impl.EngineServiceImpl.runEngine(EngineServiceImpl.java:74)
       at gov.ssa.asa.main.EngineMain.main(EngineMain.java:44)
Comment 12 Edson Tirelli 2012-10-15 20:19:04 EDT
This seems to be a JIT problem when compiling the invoker, but that is all we can infer from the stack trace. 

We will investigate, but without being able to reproduce the problem, it will be hard to fix this one.
Comment 14 JBoss JIRA Server 2012-10-17 04:13:27 EDT
Mario Fusco <mario.fusco@gmail.com> updated the status of jira JBRULES-3657 to Resolved
Comment 15 lcarlon 2012-11-05 22:31:17 EST
Hi Mario,

Can you provided release notes content for this issue to be included in the BRMS 5.3.1 release notes.

Thanks
Lee
Comment 16 Douglas Hoffman 2012-11-08 20:29:53 EST
Thanks for the updated information. Editing the doc text for Release Notes purposes. Thanks again, guys.

- Doug
Comment 17 Radovan Synek 2012-11-13 09:43:56 EST
Verified on 5.3.1.BRMS-ER4
Comment 18 Amana 2013-01-17 10:25:10 EST
Has it been fixed on brms 5.3.1. GA deployable ? I have one customer getting the same error described in comment #11 on brms 5.3.1.
Comment 19 JBoss JIRA Server 2013-01-17 10:38:45 EST
Mario Fusco <mario.fusco@gmail.com> made a comment on jira JBRULES-3657

This seems to be a duplicate of this bug: https://issues.jboss.org/browse/JBRULES-3283
If so I backported the fix to the 5.3.x branch only 2 days ago.
Comment 20 Julian Coleman 2013-03-20 08:41:57 EDT
Included in roll-up #1: BZ-873846
Comment 21 Radovan Synek 2013-03-29 11:54:29 EDT
Verified on 5.3.1.BRMS roll-up #1

Note You need to log in before you can comment on or make changes to this bug.