Bug 1278059 - String.compareTo() in jitted constraint does not work correctly on Weblogic
String.compareTo() in jitted constraint does not work correctly on Weblogic
Status: VERIFIED
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: BRE (Show other bugs)
6.1.0
Unspecified All
high Severity medium
: ---
: ---
Assigned To: Mario Fusco
Marek Winkler
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-04 11:01 EST by Hiroko Miura
Modified: 2015-11-09 04:05 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
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)
reproducer of jit compilation problem on wls (50.39 KB, application/zip)
2015-11-04 11:01 EST, Hiroko Miura
no flags Details
reproducer:RuleTestServlet result on WLS (71.15 KB, image/png)
2015-11-04 20:05 EST, Hiroko Miura
no flags Details
reproducer:JitCompileTest servlet result on WLS (180.82 KB, image/png)
2015-11-04 20:06 EST, Hiroko Miura
no flags Details
reproducer:RuleTestServlet result on EAP (good) (74.87 KB, image/png)
2015-11-04 20:07 EST, Hiroko Miura
no flags Details
reproducer:JitCompileTest servlet result on EAP (good) (71.40 KB, image/png)
2015-11-04 20:08 EST, Hiroko Miura
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker DROOLS-900 Minor Resolved java.lang.IncompatibleClassChangeError error while using HashSets 2017-03-12 22:04 EDT

  None (edit)
Description Hiroko Miura 2015-11-04 11:01:21 EST
Created attachment 1089740 [details]
reproducer of jit compilation problem on wls

Description of problem:
When String.compareTO() is used in constraint of decision table(XLS), the result of it becomes wrong on weblogic once jit compilation takes  place.
It works on EAP.

Version-Release number of selected component (if applicable):
6.1.x


How reproducible:

reproducer is attached.


Steps to Reproduce:
1. deploy servlet application
2. fire rules more than 20 times with same fact(s)
3.

Actual results:
result of rule evaluation become wrong  


Expected results:
result of rule evaluation is same even after jit compilation


Additional info:
Comment 2 Edson Tirelli 2015-11-04 11:37:01 EST
Is this Weblogic related or JVM related? By the description, I would guess it must be JVM, since the engine compiles down to bytecode without any "involvement" of weblogic in the process.

Can you please:

1. let us know which JVM is being used?

2. clarify what do you mean by "becomes wrong"?

Thank you
Comment 5 Hiroko Miura 2015-11-04 12:08:58 EST
1. let us know which JVM is being used?

=> OracleJDK(HotSpot) 1.7.0_71 with both WLS and EAP.


2. clarify what do you mean by "becomes wrong"?

=> Please see screen shot attached.
Comment 6 Hiroko Miura 2015-11-04 20:05 EST
Created attachment 1089927 [details]
reproducer:RuleTestServlet result on WLS
Comment 7 Hiroko Miura 2015-11-04 20:06 EST
Created attachment 1089928 [details]
reproducer:JitCompileTest servlet result on WLS
Comment 8 Hiroko Miura 2015-11-04 20:07 EST
Created attachment 1089929 [details]
reproducer:RuleTestServlet result on EAP (good)
Comment 9 Hiroko Miura 2015-11-04 20:08 EST
Created attachment 1089930 [details]
reproducer:JitCompileTest servlet result on EAP (good)
Comment 10 Hiroko Miura 2015-11-06 03:05:19 EST
Here is a workaround we confirmed so far.

- This does not happen if JIT is turned off like the following.

   kieBaseConfiguration.setProperty("drools.permgenThreshold", "0");
  
- This does not happen if the problematic constraint is changed 

  from  xxx.compareTo(yyy) <= 0
  to    xxx <= yyy
Comment 11 Mario Fusco 2015-11-06 04:48:43 EST
In reality what is not working is a constraint in the form

  (xxx).compareTo(yyy) <= 0

If you change it in 

  xxx.compareTo(yyy) <= 0

it works as expected. 

This problem has been already reported here https://issues.jboss.org/browse/DROOLS-900 and fixed by this commit https://github.com/droolsjbpm/drools/commit/a2ab9d4b96641f042187a5b833dd3ae4ef8bde64 

I checked on eap that using Drools 6.2.0.Final the constraint "(xxx).compareTo(yyy) <= 0" generates the warning but "xxx.compareTo(yyy) <= 0" works correctly. Conversely on 6.3.0.Final, that contains that fix, also "(xxx).compareTo(yyy) <= 0" works without generating any warning.

Marek, can you please confirm that the same commit also fixes the issue under WebLogic?
Comment 13 Edson Tirelli 2015-11-06 10:41:14 EST
Setting the ticket to MODIFIED as this is already fixed in 6.2 product as per Mario's comment. If the fix needs to be backported to 6.1 product, please open the appropriate BZ targeting the next update patch.

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