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
--auto-gen-config runs forever #9946
Comments
I have not been able to reproduce. @jaredbeck Do you also get it if there's no |
Hi Jonas, Please try the following minimal reproduction:
It should print
And then run forever, at 100% CPU. Critical problematic inputA long comment (in this case, 13228 chars), of random content. SuggestionsAdd a |
Do you have the same behaviour if you just run rubocop (without |
Yes.
Also, the ruby version doesn't seem to matter. I reproduced this with both ruby 2.7.2 and 3.0.2. |
I've been able to reproduce the problem. Thanks @jaredbeck! And I've found that it's the It's a regular expression that can't always be matched in reasonable time. I suggest we correct this cop rather than monitoring time-outs in cops. |
I'll try to fix it. |
[Fix #9946] Avoid slow regexp match in Style/CommentedKeyword
Thanks for the quick fix, everyone. |
Expected behavior
--auto-gen-config should finish eventually.
Actual behavior
--auto-gen-config ran at 100% CPU for 25 minutes before I gave up.
With
--debug
, the last line printed before it hangs is:Workaround
Why can't --auto-gen-config handle this .rake file?
I don't know.
--debug
doesn't provide any clues, so I can only speculate. The file (below, redacted) has a very long string. Perhaps that's the culprit?Steps to reproduce the problem
Try creating a file with a 28 kilobyte string?
RuboCop version
The text was updated successfully, but these errors were encountered: