Bug 917720

Summary: Infinite loop when expanding DSL rule
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Jiri Locker <jlocker>
Component: BRE (Expert, Fusion)Assignee: Mario Fusco <mfusco>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: BRMS 5.3.1CC: mfusco
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-02-10 03:27:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jiri Locker 2013-03-04 16:06:59 UTC
Description of problem:
Given a DSL configuration containing
> [when]Foo with {var} bars=Foo( bars == {var} )

and a probably incorrect rule containing
> when
>     Foo with {var} bars

When this rule is expanded by org.drools.lang.dsl.DefaultExpander the expansion gets stuck in an infinite loop, probably substituting {var} with {var} again and again.

Version-Release number of selected component (if applicable):
BRMS 5.3.1

How reproducible:
always

Steps to Reproduce:
see description

Actual results:
infinite loop

Expected results:
DefaultExpander.expand() should finish and should describe the errors by DefaultExpander.getErrors().

Additional info:

Comment 1 Jiri Locker 2013-03-04 16:30:31 UTC
Test case demonstrating the defect available in https://github.com/droolsjbpm/drools/pull/180

The issue is especially harmful in Guvnor. When user tries to validate or view source of the described rule (which can happen very easily), the command will never finish and will consume entire CPU/core until the webapp is restarted.

Comment 2 JBoss JIRA Server 2013-03-08 15:08:25 UTC
Mario Fusco <mario.fusco> updated the status of jira DROOLS-73 to Resolved

Comment 3 Mario Fusco 2013-03-08 15:10:37 UTC
I fixed this issue on the master and backported the fix to the 5.5.x branch.
Let me know if it should be backported also on the 5.3.x branch where it has been reported.

Comment 5 Red Hat Bugzilla 2025-02-10 03:27:31 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.