[jboss-jira] [JBoss JIRA] (JBRULES-3659) matches operator on variable cause intermittent thread fork and throws exception

Andreas Ali (JIRA) jira-events at lists.jboss.org
Wed Oct 17 23:55:01 EDT 2012


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

Andreas Ali updated JBRULES-3659:
---------------------------------

    Description: 
When an event is inserted and fired multiple times where the matches operator is used using a variable (instead of a constant string), a separate thread can be spawn and cause a null pointer exception.
{code}
Exception in thread "Thread-0" java.lang.NullPointerException
	at org.drools.rule.constraint.ConditionAnalyzer.analyzeSingleCondition(ConditionAnalyzer.java:113)
	at org.drools.rule.constraint.ConditionAnalyzer.analyzeCondition(ConditionAnalyzer.java:99)
	at org.drools.rule.constraint.ConditionAnalyzer.analyzeCondition(ConditionAnalyzer.java:70)
	at org.drools.rule.constraint.MvelConditionEvaluator.getAnalyzedCondition(MvelConditionEvaluator.java:83)
	at org.drools.rule.constraint.MvelConstraint.executeJitting(MvelConstraint.java:269)
	at org.drools.rule.constraint.MvelConstraint.access$200(MvelConstraint.java:50)
	at org.drools.rule.constraint.MvelConstraint$ConditionJitter.run(MvelConstraint.java:249)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
{code}

This problem disappear when the regexp is a constant string instead of a variable.  No new thread is spawned when using the constant string.

The thread spawning was observed using a separate profiler tool.

The exception usually happens in the middle of the console output.  A search on null pointer exception will get you there.

  was:
When an event is inserted and fired multiple times where the matches operator is used using a variable (instead of a constant string), a separate thread can be spawn and cause a null pointer exception.
{code}
Exception in thread "Thread-0" java.lang.NullPointerException
	at org.drools.rule.constraint.ConditionAnalyzer.analyzeSingleCondition(ConditionAnalyzer.java:113)
	at org.drools.rule.constraint.ConditionAnalyzer.analyzeCondition(ConditionAnalyzer.java:99)
	at org.drools.rule.constraint.ConditionAnalyzer.analyzeCondition(ConditionAnalyzer.java:70)
	at org.drools.rule.constraint.MvelConditionEvaluator.getAnalyzedCondition(MvelConditionEvaluator.java:83)
	at org.drools.rule.constraint.MvelConstraint.executeJitting(MvelConstraint.java:269)
	at org.drools.rule.constraint.MvelConstraint.access$200(MvelConstraint.java:50)
	at org.drools.rule.constraint.MvelConstraint$ConditionJitter.run(MvelConstraint.java:249)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
{code}

This problem disappear when the regexp is a constant string instead of a variable.  No new thread is spawned when using the constant string.

The thread spawning was observed using a separate profiler tool.

Reproducing this bug is easy using for loop with 100 tries, but the exception happens in the middle.  A search on the console on null pointer exception will get you there.


    
> matches operator on variable cause intermittent thread fork and throws exception
> --------------------------------------------------------------------------------
>
>                 Key: JBRULES-3659
>                 URL: https://issues.jboss.org/browse/JBRULES-3659
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 5.4.0.Final, 5.5.0.Beta1
>         Environment: Windows 7, Java
>            Reporter: Andreas Ali
>            Assignee: Mark Proctor
>              Labels: match, operator
>
> When an event is inserted and fired multiple times where the matches operator is used using a variable (instead of a constant string), a separate thread can be spawn and cause a null pointer exception.
> {code}
> Exception in thread "Thread-0" java.lang.NullPointerException
> 	at org.drools.rule.constraint.ConditionAnalyzer.analyzeSingleCondition(ConditionAnalyzer.java:113)
> 	at org.drools.rule.constraint.ConditionAnalyzer.analyzeCondition(ConditionAnalyzer.java:99)
> 	at org.drools.rule.constraint.ConditionAnalyzer.analyzeCondition(ConditionAnalyzer.java:70)
> 	at org.drools.rule.constraint.MvelConditionEvaluator.getAnalyzedCondition(MvelConditionEvaluator.java:83)
> 	at org.drools.rule.constraint.MvelConstraint.executeJitting(MvelConstraint.java:269)
> 	at org.drools.rule.constraint.MvelConstraint.access$200(MvelConstraint.java:50)
> 	at org.drools.rule.constraint.MvelConstraint$ConditionJitter.run(MvelConstraint.java:249)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)
> {code}
> This problem disappear when the regexp is a constant string instead of a variable.  No new thread is spawned when using the constant string.
> The thread spawning was observed using a separate profiler tool.
> The exception usually happens in the middle of the console output.  A search on null pointer exception will get you there.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list