Infinite loop #200

Closed
vipcxj opened this Issue Jan 27, 2016 · 4 comments

Projects

None yet

2 participants

@vipcxj
vipcxj commented Jan 27, 2016

In org.omnifaces.util.Components.findComponentInParents, line 257;

    while (parent != null) {

        UIComponent result = null;
        if (parent instanceof NamingContainer) {
            try {
                result = parent.findComponent(clientId);
            } catch (IllegalArgumentException e) {
                continue; //note here! line 257
            }
        }
        ......
    }

Result: Infinite loop.
This function is used by this framework everywhere, so the bug is a fatal bug!

@BalusC
Member
BalusC commented Jan 27, 2016

Can you supply a reproducer?

@vipcxj
vipcxj commented Jan 27, 2016

If “result = parent.findComponent(clientId);” throw a IllegalArgumentException, the loop will continue. However parent and clientId are not changed. So “result = parent.findComponent(clientId);” will throw the same exception again. This is a infinite loop.
In the browser, the page will be loading forever. And there is no error show in the log of server. Because the exception is catched by you! Even no "stack overflow exception". Because it is not a recursive but a loop.
All in all, the logical of code is wrong!

@vipcxj
vipcxj commented Jan 27, 2016

I found this bug when I use a illegal id.

@BalusC
Member
BalusC commented Jan 28, 2016

Indeed, that should not have happened.

It's fixed and available as per today's 2.3 snapshot.

Thank you for reporting!

@BalusC BalusC closed this Jan 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment