Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

AVN goes into an infinite loop on cd into a directory with a .node-version file #41

Open
ravasthi opened this issue Mar 29, 2016 · 6 comments

Comments

@ravasthi
Copy link

Just what the title says. Trying to cd into a directory with a .node-version file, or run __avn_debug in that directory goes into an infinite loop for me. I've done it with an empty directory containing nothing but the .node-version file. My primary shell is zsh, and I use oh-my-zsh with it. I've reproduced the issue with both zsh and bash. I'm hoping this is just a setup problem on my part. Please let me know if there's something I'm doing wrong—my dotfiles setup is on github.

Thanks for your time.

Details

  • avn 0.2.3
  • node v5.9.1
  • nvm 0.31.0
  • zsh zsh 5.2 (x86_64-apple-darwin15.0.0) – Installed with homebrew
  • bash GNU bash, version 4.3.42(1)-release (x86_64-apple-darwin15.0.0) – Installed with homebrew

The output of __avn_debug in the directory with a .node-version file is:

# None, because any avn command goes into an infinite loop. Here's the output of ps while trying
# to cd into a directory with a .node-version file:
15326 ttys004    0:00.16 node /Users/ravasthi/.avn/bin/_avn chpwd --color /Users/ravasthi/code/avn-test .node-version
15327 ttys004    0:00.07 /usr/local/bin/zsh -c source $NVM_DIR/nvm.sh; nvm list
15482 ttys004    0:00.16 node /Users/ravasthi/.avn/bin/_avn chpwd /Users/ravasthi/code/avn-test .node-version
15483 ttys004    0:00.08 /usr/local/bin/zsh -c source $NVM_DIR/nvm.sh; nvm list
15637 ttys004    0:00.16 node /Users/ravasthi/.avn/bin/_avn chpwd /Users/ravasthi/code/avn-test .node-version
15638 ttys004    0:00.07 /usr/local/bin/zsh -c source $NVM_DIR/nvm.sh; nvm list
15794 ttys004    0:00.16 node /Users/ravasthi/.avn/bin/_avn chpwd /Users/ravasthi/code/avn-test .node-version
15796 ttys004    0:00.07 /usr/local/bin/zsh -c source $NVM_DIR/nvm.sh; nvm list
15965 ttys004    0:00.17 node /Users/ravasthi/.avn/bin/_avn chpwd /Users/ravasthi/code/avn-test .node-version
15987 ttys004    0:00.08 /usr/local/bin/zsh -c source $NVM_DIR/nvm.sh; nvm list
16143 ttys004    0:00.17 node /Users/ravasthi/.avn/bin/_avn chpwd /Users/ravasthi/code/avn-test .node-version
16166 ttys004    0:00.07 /usr/local/bin/zsh -c source $NVM_DIR/nvm.sh; nvm list
16342 ttys004    0:00.16 node /Users/ravasthi/.avn/bin/_avn chpwd /Users/ravasthi/code/avn-test .node-version
16348 ttys004    0:00.08 /usr/local/bin/zsh -c source $NVM_DIR/nvm.sh; nvm list
16526 ttys004    0:00.16 node /Users/ravasthi/.avn/bin/_avn chpwd /Users/ravasthi/code/avn-test .node-version
16527 ttys004    0:00.08 /usr/local/bin/zsh -c source $NVM_DIR/nvm.sh; nvm list
16706 ttys004    0:00.16 node /Users/ravasthi/.avn/bin/_avn chpwd /Users/ravasthi/code/avn-test .node-version
16708 ttys004    0:00.08 /usr/local/bin/zsh -c source $NVM_DIR/nvm.sh; nvm list
16886 ttys004    0:00.15 node /Users/ravasthi/.avn/bin/_avn chpwd /Users/ravasthi/code/avn-test .node-version
16887 ttys004    0:00.07 /usr/local/bin/zsh -c source $NVM_DIR/nvm.sh; nvm list
17043 ttys004    0:00.16 node /Users/ravasthi/.avn/bin/_avn chpwd /Users/ravasthi/code/avn-test .node-version
17065 ttys004    0:00.08 /usr/local/bin/zsh -c source $NVM_DIR/nvm.sh; nvm list
17236 ttys004    0:00.16 node /Users/ravasthi/.avn/bin/_avn chpwd /Users/ravasthi/code/avn-test .node-version
17237 ttys004    0:00.08 /usr/local/bin/zsh -c source $NVM_DIR/nvm.sh; nvm list
17414 ttys004    0:00.16 node /Users/ravasthi/.avn/bin/_avn chpwd /Users/ravasthi/code/avn-test .node-version
17416 ttys004    0:00.07 /usr/local/bin/zsh -c source $NVM_DIR/nvm.sh; nvm list
17439 ttys004    0:00.00 /usr/local/bin/zsh -c source $NVM_DIR/nvm.sh; nvm list
17442 ttys004    0:00.00 /usr/local/bin/zsh -c source $NVM_DIR/nvm.sh; nvm list
17443 ttys004    0:00.00 /usr/local/bin/zsh -c source $NVM_DIR/nvm.sh; nvm list
17444 ttys004    0:00.00 tail -n1

Note that there are more processes the longer I wait before I run ps.

avn is loaded in my ~/.bashrc file with:

if [[ -s "$HOME/.avn/bin/avn.sh" ]]; then
  source "$HOME/.avn/bin/avn.sh"
fi

avn is loaded in my ~/.zshenv file with:

if [[ -s "$HOME/.avn/bin/avn.sh" ]]; then
  source "$HOME/.avn/bin/avn.sh"
fi

nvm specific

  • [×] As an nvm user I am confirming that I did not install with Homebrew
@wbyoung
Copy link
Owner

wbyoung commented Mar 30, 2016

It looks like this is a bit of a fork bomb.

My guess is that it's something conflicting that's trying to do something on changing directories as well. I'd recommend disabling most extras and just enabling avn, then enable until you find the problem.

rbenv would be a good candidate as I haven't tested with that.

Let me know what you find and we can try to make things compatible.

FYI: in using zsh with oh-my-zsh as well. So it should work!

@ravasthi
Copy link
Author

rbenv doesn't override cd, but rvm does—my setup supports both, but I use rvm. Your guess is most likely right; I've had similar problems with trying to get autoenv, another cd-overrider, to coexist with rvm. I'll try disabling rvm and let you know if avn starts working. Thanks for your prompt reply.

@wbyoung
Copy link
Owner

wbyoung commented Mar 30, 2016

I've worked with the rvm team to ensure comparability and opened hyperupcall/autoenv#92 for comparability with autoenv. I use both of those, too.

See the hack that I posted for how I get things working between all three.

@ravasthi
Copy link
Author

Turns out that, as you predicted, disabling rvm did not fix the problem. I'll get a chance to mess around with my setup more this weekend and will respond back once I've tracked down the cause. Thanks for your responsiveness!

@ravasthi
Copy link
Author

ravasthi commented Apr 18, 2016

Sorry for the late update on this @wbyoung. I had the chance to try the process-of-elimination thing a few days ago and now I'm more confused than ever. I disabled literally everything except for NVM, NPM and AVN—including Oh My Zsh—and I still got the fork bomb. My next step is to try it with a brand new user on my machine (running, since I didn't mention it before, OS X 10.11.4) and seeing if I can slowly add things to it to make it break.

@wbyoung
Copy link
Owner

wbyoung commented Apr 19, 2016

@ravasthi I just found an issue with my config personally & updated the autoenv hack that I'm using. Since I linked to that in here, I figured I'd ping you about it.

Thanks for the update, by the way.

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

No branches or pull requests

2 participants