New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite loop #200

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

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

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC Jan 27, 2016

Member

Can you supply a reproducer?

Member

BalusC commented Jan 27, 2016

Can you supply a reproducer?

@vipcxj

This comment has been minimized.

Show comment
Hide comment
@vipcxj

vipcxj 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 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

This comment has been minimized.

Show comment
Hide comment
@vipcxj

vipcxj Jan 27, 2016

I found this bug when I use a illegal id.

vipcxj commented Jan 27, 2016

I found this bug when I use a illegal id.

@BalusC

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC Jan 28, 2016

Member

Indeed, that should not have happened.

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

Thank you for reporting!

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