-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Long freeze(>3 minutes - probably infinite) when checking file #15248
Comments
Minimized
|
Cc. @dylwil3 as well |
I demoted the rule to testing only for now, see #15252 Let's do some more fuzzing (we have multiple fuzzer scripts) before promoting the rule to preview |
dylwil3
added a commit
that referenced
this issue
Jan 7, 2025
…r `unreachable` (`PLW0101`) (#15276) Note: `PLW0101` remains in testing rather than preview, so this PR does not modify any public behavior (hence the title beginning with `internal` rather than `pylint`, for the sake of the changelog.) Fixes an error in the processing of `try` statements in the control flow graph builder. When processing a try statement, the block following a `return` was forced to point to the `finally` block. However, if the return was _in_ the `finally` block, this caused the block to point to itself. In the case where the whole `try-finally` statement was also included inside of a loop, this caused an infinite loop in the builder for the control flow graph as it attempted to resolve edges. Closes #15248 ## Test function ### Source ```python def l(): while T: try: while (): if 3: break finally: return ``` ### Control Flow Graph ```mermaid flowchart TD start(("Start")) return(("End")) block0[["`*(empty)*`"]] block1[["Loop continue"]] block2["return\n"] block3[["Loop continue"]] block4["break\n"] block5["if 3: break\n"] block6["while (): if 3: break\n"] block7[["Exception raised"]] block8["try: while (): if 3: break finally: return\n"] block9["while T: try: while (): if 3: break finally: return\n"] start --> block9 block9 -- "T" --> block8 block9 -- "else" --> block0 block8 -- "Exception raised" --> block7 block8 -- "else" --> block6 block7 --> block2 block6 -- "()" --> block5 block6 -- "else" --> block2 block5 -- "3" --> block4 block5 -- "else" --> block3 block4 --> block2 block3 --> block6 block2 --> return block1 --> block9 block0 --> return ```
dylwil3
added a commit
that referenced
this issue
Jan 8, 2025
<!-- Thank you for contributing to Ruff! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary Fix infinite loop issue reported here #15248. The issue was caused by the break inside the if block, which caused the flow to exit in an unforeseen way. This caused other issues, eventually leading to an infinite loop. Resolves #15248. Resolves #15336. ## Test Plan Added failing code to fixture. --------- Co-authored-by: Micha Reiser <[email protected]> Co-authored-by: dylwil3 <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Probably caused by #10891 - CC @augustelalande
Command
SANITIZER_6-before.zip
The text was updated successfully, but these errors were encountered: