-
-
Notifications
You must be signed in to change notification settings - Fork 12
Avoid hang when linting projects with symlink loops #175
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@per1234
per1234
added
type: bug
topic: code
Related to content of the project itself
labels
May 26, 2021
@per1234
per1234
changed the title
(削除) Avoid hang during discovery in projects with symlink loops (削除ここまで)
(追記) Avoid hang when linting projects with symlink loops (追記ここまで)
May 26, 2021
Codecov Report
@@ Coverage Diff @@ ## main #175 +/- ## ========================================== - Coverage 84.34% 84.32% -0.03% ========================================== Files 43 43 Lines 2971 2979 +8 ========================================== + Hits 2506 2512 +6 - Misses 373 374 +1 - Partials 92 93 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
cmaglie
cmaglie
requested changes
May 26, 2021
Specific combinations of symlinks can cause infinite recursion loops during project discovery. This is avoided by limiting the depth of symlink follows to a reasonable number.
Even though the previous commit caused the project discovery code to gracefully avoid perpetual recursion when specific configurations of symlinks are present in the linting target path, it turned out that the project data phase that comes after is also not able to handle this correctly, and fixing that is more difficult since the incompatible code is in Arduino CLI. So for now the provisional fix is to panic during the project discovery phase, which will at least avoid the far worse behavior of a permanent hang.
cmaglie
cmaglie
approved these changes
May 26, 2021
@rsora
rsora
added
the
type: imperfection
Perceived defect in any part of project
label
Sep 22, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Specific combinations of symlinks can cause infinite recursion loops during project discovery. This can be avoided by
limiting the depth of symlink follows to a reasonable number.
This was implemented in ef717d2 to make the project discovery code gracefully avoid perpetual recursion in this situation. Unfortunately, it turned out that the project data collection phase that comes after project discovery also suffers from the same problem. Fixing that is more difficult since the incompatible code is in Arduino CLI. So for now the provisional fix is to panic during the project discovery phase, which will at least avoid the far worse behavior of a permanent hang.