Bug 1278059 - String.compareTo() in jitted constraint does not work correctly on Weblogic
Summary: String.compareTo() in jitted constraint does not work correctly on Weblogic
Keywords:
Status: CLOSED EOL
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: BRE
Version: 6.1.0
Hardware: Unspecified
OS: All
high
medium
Target Milestone: ---
: ---
Assignee: Mario Fusco
QA Contact: Marek Winkler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-04 16:01 UTC by Hiroko Miura
Modified: 2020-03-27 19:04 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-03-27 19:04:25 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
reproducer of jit compilation problem on wls (50.39 KB, application/zip)
2015-11-04 16:01 UTC, Hiroko Miura
no flags Details
reproducer:RuleTestServlet result on WLS (71.15 KB, image/png)
2015-11-05 01:05 UTC, Hiroko Miura
no flags Details
reproducer:JitCompileTest servlet result on WLS (180.82 KB, image/png)
2015-11-05 01:06 UTC, Hiroko Miura
no flags Details
reproducer:RuleTestServlet result on EAP (good) (74.87 KB, image/png)
2015-11-05 01:07 UTC, Hiroko Miura
no flags Details
reproducer:JitCompileTest servlet result on EAP (good) (71.40 KB, image/png)
2015-11-05 01:08 UTC, Hiroko Miura
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker DROOLS-900 0 'Minor' 'Resolved' 'java.lang.IncompatibleClassChangeError error while using HashSets' 2019-11-12 08:23:11 UTC

Description Hiroko Miura 2015-11-04 16:01:21 UTC
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 16:37:01 UTC
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 17:08:58 UTC
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-05 01:05:41 UTC
Created attachment 1089927 [details]
reproducer:RuleTestServlet result on WLS

Comment 7 Hiroko Miura 2015-11-05 01:06:44 UTC
Created attachment 1089928 [details]
reproducer:JitCompileTest servlet result on WLS

Comment 8 Hiroko Miura 2015-11-05 01:07:34 UTC
Created attachment 1089929 [details]
reproducer:RuleTestServlet result on EAP (good)

Comment 9 Hiroko Miura 2015-11-05 01:08:22 UTC
Created attachment 1089930 [details]
reproducer:JitCompileTest servlet result on EAP (good)

Comment 10 Hiroko Miura 2015-11-06 08:05:19 UTC
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 09:48:43 UTC
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 15:41:14 UTC
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.