Bug 917720 - Infinite loop when expanding DSL rule
Summary: Infinite loop when expanding DSL rule
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRE (Expert, Fusion)
Version: BRMS 5.3.1
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Mario Fusco
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-04 16:06 UTC by Jiri Locker
Modified: 2025-02-10 03:27 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-02-10 03:27:31 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker DROOLS-73 0 Major Resolved Infinite loop when expanding DSL rule 2014-01-15 15:49:00 UTC

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.


Note You need to log in before you can comment on or make changes to this bug.