Skip to content

ops.help in matching failure can cause infinite loop #187

Closed

Description

@hinerm

This call to env.help will trigger another match, which if itself is invalid will cause an infinite loop and lead to StackOverflowException.

Observed on opencv-ops in this commit adding new engine.simplify methods.

I think this will only happen if the invalid Op is an engine.simplify Op

Activity

  1. added this to the 1.0.0 milestone on Feb 23, 2024
  2. hinerm commented on Feb 23, 2024

    @hinerm
    MemberAuthor

    In this particular case, separating the ops arbitrarily by priority avoided the infinite loop

  3. gselzer commented on Feb 23, 2024

    @gselzer
    Member

    I think that the best idea here would be to change that call to run env.helpVerbose(), which does not attempt to simplify (in the current design). I think it has the added benefit of jumping straight to the verbose information, which the user probably wants anyways if matching didn't work, but I'd defer to @elevans' opinion on that one.

  4. self-assigned this
    on Feb 26, 2024
  5. elevans commented on Feb 26, 2024

    @elevans
    Member

    I just talked to @gselzer about this and I agree that using env.helpVerbose() here instead of env.help() 1) results in an ideal output for this scenario and 2) allows us to bypass this for now.

  6. gselzer commented on Feb 28, 2024

    @gselzer
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions