-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Analysis server crashes on recursive symlinks (possibly created by Flutter) #36919
Comments
This paths seems to repeated repeatedly:
My guess is that there is a symlink that points back further up its own tree, making an infinite loop while following all the folders. If you remove the symlink does it stop? @bwilkerson this looks a bit like Dart-Code/Dart-Code#1565. If we can't easily support symlinks, maybe we could detect this and send a server error with some info about the problem? |
I don't know off-hand, how easy or hard it would be, but I know that we made a conscious decision to move away from symlinks when we moved from a @stereotype441 @devoncarew for thoughts |
I think the concept of "supporting symlinks" is a little ambiguous. We're in some ways supporting them today, as we follow them, and if they don't loop, things work! However if they create loops, then we crash. Similarly, "not supporting" them could describe both deliberate skipping over them (eg. "you can't use them") as well as not doing any special handling of them. I think there are potential issue in both cases (following them or not):
I think the best we could do would be to raise a more obvious error. Maybe each time we enumerate a folder (I think this issue can only occur for folders) if it's a symlink, we resolve it and check whether that path is an ancestor (or otherwise in the set to analyze) and throw an error explaining we found a loop and providing the details of the symlink. Whether it's worth the complexity, I don't know. It came up twice recently, but it doesn't seem like this has changed for a long time so my guess is it's not happening very often. |
Thank you very much for your positive answers and help. The problem has been solved. The reason for this problem is that I added a lot of projects using vscode. I guess it may be the conflict of dependencies between projects. I emptied the workspace of vscode and added an independent project to solve the problem. |
@bwilkerson @devoncarew this seems to be coming up a lot. It seems like something related to Flutter may be creating these symlink folders? https://github.com/flutter/flutter/search?q=%22.symlinks%22&type=Code I think we need to may need to do something (even if it's just skip folders named |
cc @dnfield - I saw your name on some symlinks code in Flutter, so maybe you understand why they're needed (and when they're created)? |
Cocoapods uses symlinks, I believe after |
From the bug report, it looks like the recursion is happening here:
and
It looks like this recursion is happing during the AndroidManifest.xml check. This issue was addressed by a later code change - we no longer recurse into dot directories here. My guess is that the fix did not make it into the Flutter stable channel. @keertip can you confirm? |
The fix did not make it to the Flutter stable channel. |
Aha, I didn't realise this had been fixed (looks like 14d0949 is the fix). In that case I'll close this and advise those seeing it to switch to a different branch in the meantime. Thanks! |
Please review the below report for any information you do not wish to share and report to
https://github.com/dart-lang/sdk/issues/new
Exception from analysis server (running from VSCode / Dart Code)
What I was doing
(please describe what you were doing when this exception occurred)
Request
While responding to request:
analysis.setAnalysisRoots
Versions
Analyzer Info
The analyzer was launched using the arguments:
Exception
FileSystemException(path=/work/Project/flutter/fluwx-master/example/ios/.symlinks/plugins/fluwx/example/ios/.symlinks/plugins/fluwx/example/ios/.symlinks/plugins/fluwx/example/ios/.symlinks/plugins/fluwx/example/ios/.symlinks/plugins/fluwx/example/ios/.symlinks/plugins/fluwx/example/ios/.symlinks/plugins/fluwx/example/ios/.symlinks/plugins/fluwx/example/ios/.symlinks/plugins/fluwx/example/ios/.symlinks/plugins/fluwx/example/ios/.symlinks/plugins/fluwx/example/ios/.symlinks/plugins/fluwx/example/ios/.symlinks/plugins/fluwx/example/ios/.symlinks/plugins/fluwx/example/ios/.symlinks/plugins/fluwx/example/ios/.symlinks/plugins/fluwx/example/ios/.symlinks/plugins/fluwx/example/ios/.symlinks/plugins/fluwx/example/ios/.symlinks/plugins/fluwx/example/ios/.symlinks/plugins/fluwx/example/ios/.symlinks/plugins/fluwx/example/ios/.symlinks/plugins/fluwx/example/ios/.symlinks/plugins/fluwx/example/ios/.symlinks/plugins/fluwx/example/ios/.symlinks/plugins/fluwx/example/ios/Flutter/App.framework/flutter_assets/packages/cupertino_icons/assets/Cuperti; message=Directory listing failed)
Diagnostics requested after the error occurred are:
The text was updated successfully, but these errors were encountered: