Bug 860698

Summary: java.lang.VerifyError: JVMVRFY012 stack shape inconsistent
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Geoffrey De Smet <gdesmet>
Component: BRE (Expert, Fusion)Assignee: Mario Fusco <mfusco>
Status: VERIFIED --- QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: BRMS 5.3.0.GACC: ajuricic, alazarot, cbasquez, kverlaen, mfusco, rwagner
Target Milestone: ER4   
Target Release: One Off Releases   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 873846    

Description Geoffrey De Smet 2012-09-26 14:07:30 UTC
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 19:16:11 UTC
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 07:02:15 UTC
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 13:40:34 UTC
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 13:57:11 UTC
Talked to the customer, they are running Oracle JDK 1.6 on Windows.

Thanks,

Rick

Comment 6 Geoffrey De Smet 2012-10-03 15:34:51 UTC
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 13:44:25 UTC
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 18:25:36 UTC
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 19:44:35 UTC
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-16 00:19:04 UTC
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 08:13:27 UTC
Mario Fusco <mario.fusco> updated the status of jira JBRULES-3657 to Resolved

Comment 15 lcarlon 2012-11-06 03:31:17 UTC
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-09 01:29:53 UTC
Thanks for the updated information. Editing the doc text for Release Notes purposes. Thanks again, guys.

- Doug

Comment 17 Radovan Synek 2012-11-13 14:43:56 UTC
Verified on 5.3.1.BRMS-ER4

Comment 18 Amana 2013-01-17 15:25:10 UTC
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 15:38:45 UTC
Mario Fusco <mario.fusco> 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 12:41:57 UTC
Included in roll-up #1: BZ-873846

Comment 21 Radovan Synek 2013-03-29 15:54:29 UTC
Verified on 5.3.1.BRMS roll-up #1