Skip to content
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

Infinite recursive call in asdf list golang #83

Closed
thinca opened this issue Jun 30, 2022 · 13 comments · Fixed by #93
Closed

Infinite recursive call in asdf list golang #83

thinca opened this issue Jun 30, 2022 · 13 comments · Fixed by #93

Comments

@thinca
Copy link

thinca commented Jun 30, 2022

Describe the bug
asdf-vm/asdf#762
Since this change of asdf core, asdf list golang may call parse-legacy-file script internally.
parse-legacy-file script invokes asdf list golang.
The result is an infinite recursive call.

To Reproduce
Steps to reproduce the behavior:

  1. Install head version of asdf
  2. mkdir example; cd example; go mod init example.com/m
  3. asdf list golang
  4. Command hung(infinite recursive call).

Expected behavior
Show the version and exit.

Desktop (please complete the following information):

  • OS: Linux
  • asdf version: v0.10.2-624aede
  • asdf-golang cc8bc47
@yokonao
Copy link

yokonao commented Nov 5, 2022

@kennyp
Hi! I'm sorry to bother you when you're busy.

This issue is critical for asdf users which' enable legacy_version_file.
One solution is to revert #34 . Another is listing installed versions independent from asdf list command (a little complex and redundant).

I would like to work on solving this problem, so please let me know the desired solution!

@kennyp
Copy link
Member

kennyp commented Nov 6, 2022

@yokonao I'm using asdf version v0.10.2-7e7a1fa and I can't reproduce. 🤔

I'm working on pulling out the recursive call back into asdf list, but it would be great to reproduce before saying I've fixed it if that makes sense.

@yokonao
Copy link

yokonao commented Nov 7, 2022

@kennyp
This PR is merged after released v0.10.2. So, it makes sense that You are unable to reproduce when v0.10.2-7e7a1fa.
Howerver, this problem occurs if v0.10.3 is released in the future.

Please try to reproduce using latest asdf.

@kennyp
Copy link
Member

kennyp commented Nov 18, 2022

Ahh, I missed the note that you were using asdf head. Let me see what I can figure out.

@elementalvoid
Copy link

I'll note that I did experience this. But I am no longer able to after ensuring everything was up to date.

I updated asdf and the plugin:

$ asdf update
$ asdf plugin update golang

After which, I'm no longer able to replicate.


Looking at my git reflog for both the plugin and asdf, I was able to reset my installation to a reproducible configuration!

According to my reflog, I've had version cc8bc47 of the plugin the whole time (recently deleted it and reinstalled it for other reasons).

But for asdf, this update took me from asdf-vm/asdf@cd31d57 (can reproduce) to asdf-vm/asdf@7e7a1fa (cannot reproduce).

$ cd ~/.asdf
$ git checkout cd31d57

And 💥 recursion bug. Hopefully that helps!

@dushyantss
Copy link

dushyantss commented Dec 16, 2022

asdf version 0.11.0 is out and after updating my local setup I can confirm facing this bug.

Note: this bug has been the cause for bash warning shell level (1000) too high resetting to 1 message(got this when simply cd'ing into a go project) and "fork failed: Resource temporarily unavailable" issue(got this after running the gopls server for a while in neovim. I couldn't do anything on the terminal and just kept getting this error message, since my system had too many processes running asdf list golang).

@jharley
Copy link

jharley commented Dec 16, 2022

+1 to @dushyantss is reporting above

@jharley
Copy link

jharley commented Dec 16, 2022

I just tried the regex fix in #89 and it seems to have helped

@kennyp
Copy link
Member

kennyp commented Dec 16, 2022

I'm trying to resolve this on the issue I opened on asdf as I need a way to get a list of the currently installed versions to accurately conform to go.mod.

@kennyp
Copy link
Member

kennyp commented Dec 17, 2022

@yokonao, @dushyantss, or @jharley can y'all verify that #93 fixes the issue for you?

@dushyantss
Copy link

Tested #93, works for me 🥳. Tried both, cd'ing into a go project and opening it in neovim with gopls.

Thanks @kennyp for the prompt fix.

@kennyp
Copy link
Member

kennyp commented Dec 17, 2022

Awesome! I'll merge it.

@jharley
Copy link

jharley commented Dec 17, 2022

#93 fixed things for me as well!

Thanks for the quick resolution, @kennyp!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

6 participants