dcmaf opened a new issue, #6422:
URL: https://github.com/apache/incubator-kie-drools/issues/6422

   We have encountered a null pointer exception being thrown due to an attempt 
to remove a tuple from the dormant matches list when the tuple is not on the 
list. An example call stack is included below (10.1.0 code base).
   
   We do not have a unit test that reproduces this exception. It has been 
observed in two instances: one involved the insertion of logical facts, which 
was resolved by not using logical when inserting the facts. The other involves 
a rule that is extended by two other rules. We are able to work around the 
second issue by locally building drools-core and adding a check that the tuple 
is on the dormant matches list before attempting to remove it in 
RuleExecutor::modifyActiveTuple, as shown below:
   
   ```java
       public void modifyActiveTuple(RuleTerminalNodeLeftTuple tuple) {
           if (dormantMatches.contains(tuple))
               removeDormantTuple(tuple);
           addActiveTuple(tuple);
       }
   ```
   
   @mariofusco This issue appears to have been introduced by 
[KIE-1064](https://github.com/apache/incubator-kie-issues/issues/1064) (see PR 
https://github.com/apache/incubator-kie-drools/pull/5821 and commit 
https://github.com/apache/incubator-kie-drools/pull/5852/commits/f7e16a6ea06822606ed986a201dcb2fb4028a517).
   
   Call stack example:
   
   ```
   Caused by: java.lang.NullPointerException: Cannot invoke 
"org.drools.core.util.DoubleLinkedEntry.setNext(org.drools.core.util.SingleLinkedEntry)"
 because the return value of 
"org.drools.core.util.DoubleLinkedEntry.getPrevious()" is null
        at org.drools.core.util.LinkedList.remove(LinkedList.java:178)
        at 
org.drools.core.phreak.RuleExecutor.removeDormantTuple(RuleExecutor.java:318)
        at 
org.drools.core.phreak.RuleExecutor.modifyActiveTuple(RuleExecutor.java:338)
        at 
org.drools.core.phreak.PhreakRuleTerminalNode.doLeftTupleUpdate(PhreakRuleTerminalNode.java:224)
        at 
org.drools.core.phreak.PhreakRuleTerminalNode.doLeftUpdates(PhreakRuleTerminalNode.java:166)
        at 
org.drools.core.phreak.PhreakRuleTerminalNode.doNode(PhreakRuleTerminalNode.java:56)
        at 
org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:335)
        at 
org.drools.core.phreak.RuleNetworkEvaluator.evalStackEntry(RuleNetworkEvaluator.java:251)
        at 
org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:194)
        at 
org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:147)
        at 
org.drools.core.phreak.RuleExecutor.evaluateNetwork(RuleExecutor.java:230)
        at 
org.drools.core.phreak.RuleExecutor.evaluateNetworkIfDirty(RuleExecutor.java:240)
        at 
org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:85)
        at 
org.drools.core.concurrent.AbstractGroupEvaluator.evaluateAndFire(AbstractGroupEvaluator.java:49)
        at 
org.drools.kiesession.agenda.DefaultAgenda.fireLoop(DefaultAgenda.java:620)
        at 
org.drools.kiesession.agenda.DefaultAgenda.internalFireAllRules(DefaultAgenda.java:573)
        at 
org.drools.kiesession.agenda.DefaultAgenda.fireAllRules(DefaultAgenda.java:565)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to