[jboss-jira] [JBoss JIRA] (DROOLS-635) NPE thrown intermittently in multi-threading environment

Mario Fusco (JIRA) issues at jboss.org
Wed Dec 10 11:15:41 EST 2014


     [ https://issues.jboss.org/browse/DROOLS-635?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mario Fusco resolved DROOLS-635.
--------------------------------
    Resolution: Cannot Reproduce Bug


> NPE thrown intermittently in multi-threading environment
> --------------------------------------------------------
>
>                 Key: DROOLS-635
>                 URL: https://issues.jboss.org/browse/DROOLS-635
>             Project: Drools
>          Issue Type: Bug
>    Affects Versions: 6.1.0.Final, 6.2.0.Beta1, 6.2.0.CR1
>            Reporter: John Le
>            Assignee: Mario Fusco
>
> Below is the stacktrace for the NPE, it appears to be an issue when accumulate function is called under multi-threading condition. Please look at the remove function in the RightTupleIndexHashTable.java file. The remove function does not appear to have proper null checking around the "current" object.
>    public void remove(final RightTuple rightTuple) {
>         RightTupleList memory = rightTuple.getMemory();
>         memory.remove( rightTuple );
>         this.factSize--;
>         if ( memory.first == null ) {
>             final int index = indexOf( memory.hashCode(),
>                                        this.table.length );
>             RightTupleList previous = null;
>             RightTupleList current = (RightTupleList) this.table[index];
>             while ( current != memory ) {  
>                 previous = current;
>                 current = (RightTupleList) current.getNext();
>             }
>             if ( previous != null ) {
>                 previous.next = current.next;
>             } else {
>                 this.table[index] = current.next;
>             }
>             this.size--;
>         }
>         rightTuple.clear();
>     }
> Stacktrace:
> java.lang.NullPointerException
>         org.drools.core.util.index.RightTupleIndexHashTable.remove(RightTupleIndexHashTable.java:389)
>         org.drools.core.phreak.RuleNetworkEvaluator.doUpdatesReorderRightMemory(RuleNetworkEvaluator.java:855)
>         org.drools.core.phreak.PhreakJoinNode.doNode(PhreakJoinNode.java:43)
>         org.drools.core.phreak.RuleNetworkEvaluator.switchOnDoBetaNode(RuleNetworkEvaluator.java:548)
>         org.drools.core.phreak.RuleNetworkEvaluator.evalBetaNode(RuleNetworkEvaluator.java:534)
>         org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:334)
>         org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:161)
>         org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:116)
>         org.drools.core.phreak.RuleExecutor.reEvaluateNetwork(RuleExecutor.java:230)
>         org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:103)
>         org.drools.core.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:988)
>         org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1274)
>         org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1284)
>         org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1257)



--
This message was sent by Atlassian JIRA
(v6.3.8#6338)


More information about the jboss-jira mailing list